From 981db8313fc305412add7c91c36f4f72bad5a0da Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 22 May 2023 20:08:50 +0200 Subject: [PATCH] d2d1: Create GDI-compatible target bitmap for GDI-compatible target usage. --- dlls/d2d1/device.c | 2 ++ dlls/d2d1/tests/d2d1.c | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 93fcecf72ba..42db30b2888 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -4456,6 +4456,8 @@ HRESULT d2d_d3d_create_render_target(ID2D1Device *device, IDXGISurface *surface, { bitmap_desc.pixelFormat = desc->pixelFormat; bitmap_desc.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW; + if (desc->usage & D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE) + bitmap_desc.bitmapOptions |= D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE; bitmap_desc.colorContext = NULL; if (FAILED(hr = ID2D1DeviceContext1_CreateBitmapFromDxgiSurface(&object->ID2D1DeviceContext1_iface, diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index bff93c1815c..ae0e36f1e17 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -6453,10 +6453,7 @@ static void test_dxgi_surface_target_gdi_interop(BOOL d3d11) desc.usage = D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE; hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(ctx.factory, surface, &desc, &rt); - todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr); - if (SUCCEEDED(hr)) - ID2D1RenderTarget_Release(rt); refcount = IDXGISurface_Release(surface); ok(!refcount, "Unexpected refcount %lu.\n", refcount);