Commit 6556ed20 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

d2d1: Use newer blend options in d2d_device_context_SetTarget() for bitmaps of…

d2d1: Use newer blend options in d2d_device_context_SetTarget() for bitmaps of D2D1_ALPHA_MODE_IGNORE. When bitmap alpha mode is D2D1_ALPHA_MODE_IGNORE, D3D11_BLEND_ZERO is used for SrcBlendAlpha and D3D11_BLEND_ONE for DestBlendAlpha on Win7. However, tests show that D3D11_BLEND_ONE is used for SrcBlendAlpha and D3D11_BLEND_INV_SRC_ALPHA for DestBlendAlpha on Win8+. The patch changes d2d_device_context_SetTarget() to use the Win8+ behaviour. Fix PowerPoint 2016 slideshow artifacts. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent fe4c187a
......@@ -2069,16 +2069,8 @@ static void STDMETHODCALLTYPE d2d_device_context_SetTarget(ID2D1DeviceContext *i
blend_desc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE;
blend_desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
blend_desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
if (context->desc.pixelFormat.alphaMode == D2D1_ALPHA_MODE_IGNORE)
{
blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ZERO;
blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ONE;
}
else
{
blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;
}
blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;
blend_desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
blend_desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
if (FAILED(hr = ID3D11Device1_CreateBlendState(context->d3d_device, &blend_desc, &context->bs)))
......
......@@ -4585,7 +4585,6 @@ static void test_alpha_mode(BOOL d3d11)
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
match = compare_surface(&ctx, "e7ee77e89745fa5d195fd78bd398738330cfcde8");
match2 = compare_surface(&ctx, "4855c7c082c8ede364cf6e2dcde83f95b88aecbe");
todo_wine
ok(match || broken(match2) /* Win7 TestBots */, "Surface does not match.\n");
IDXGISurface_Release(ctx.surface);
ctx.surface = surface;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment