Commit ae43a87d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d2d1: Reject D2D1_ALPHA_MODE_STRAIGHT alpha mode for HWND targets.

parent 02919e42
......@@ -862,6 +862,13 @@ HRESULT d2d_hwnd_render_target_init(struct d2d_hwnd_render_target *render_target
if (dxgi_rt_desc.pixelFormat.alphaMode == D2D1_ALPHA_MODE_UNKNOWN)
dxgi_rt_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
if (dxgi_rt_desc.pixelFormat.alphaMode == D2D1_ALPHA_MODE_STRAIGHT)
{
IDXGIFactory_Release(dxgi_factory);
WARN("Alpha mode %u is not supported.\n", dxgi_rt_desc.pixelFormat.alphaMode);
return D2DERR_UNSUPPORTED_PIXEL_FORMAT;
}
render_target->desc = dxgi_rt_desc;
/* FIXME: should be resolved to either HW or SW type. */
if (render_target->desc.type == D2D1_RENDER_TARGET_TYPE_DEFAULT)
......
......@@ -6214,10 +6214,7 @@ static void test_hwnd_target(BOOL d3d11)
hr = ID2D1Factory_CreateHwndRenderTarget(ctx.factory, &desc, &hwnd_rt_desc, &rt);
if (format_tests[i].expected_failure)
{
todo_wine
ok(FAILED(hr), "Got unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
ID2D1HwndRenderTarget_Release(rt);
ok(hr == D2DERR_UNSUPPORTED_PIXEL_FORMAT, "Got unexpected hr %#lx.\n", hr);
winetest_pop_context();
continue;
}
......
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