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

d2d1: Create GDI-compatible swapchain only for corresponding target usage.

parent 6526de5c
......@@ -889,7 +889,9 @@ HRESULT d2d_hwnd_render_target_init(struct d2d_hwnd_render_target *render_target
swapchain_desc.Windowed = TRUE;
swapchain_desc.SwapEffect = hwnd_rt_desc->presentOptions & D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS ?
DXGI_SWAP_EFFECT_SEQUENTIAL : DXGI_SWAP_EFFECT_DISCARD;
swapchain_desc.Flags = DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE;
swapchain_desc.Flags = 0;
if (desc->usage & D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE)
swapchain_desc.Flags = DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE;
hr = IDXGIFactory_CreateSwapChain(dxgi_factory, (IUnknown *)d3d_device, &swapchain_desc, &render_target->swapchain);
IDXGIFactory_Release(dxgi_factory);
......
......@@ -13732,10 +13732,7 @@ static void test_hwnd_target_is_supported(BOOL d3d11)
desc = template_desc;
desc.pixelFormat = pixel_formats[i];
hr = ID2D1Factory_CreateHwndRenderTarget(ctx.factory, &desc, &hwnd_rt_desc, &rt);
todo_wine_if(i == 3 || i == 4 || i == 5)
ok(hr == S_OK, "%u: unexpected hr %#lx.\n", i, hr);
if (FAILED(hr))
continue;
/* Resolve to default format. */
if (desc.pixelFormat.format == DXGI_FORMAT_UNKNOWN)
......
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