d2d1: Create GDI-compatible target bitmap for GDI-compatible target usage.

This commit is contained in:
Nikolay Sivov 2023-05-22 20:08:50 +02:00 committed by Alexandre Julliard
parent 612020f952
commit 981db8313f
2 changed files with 2 additions and 3 deletions

View file

@ -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,

View file

@ -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);