mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 10:53:38 +00:00
d2d1: Reject D2D1_ALPHA_MODE_STRAIGHT alpha mode for HWND targets.
This commit is contained in:
parent
02919e4298
commit
ae43a87d01
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue