From: Hajo Nils Krabbenhöft hnk.git@hajo.me
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47165 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d2d1/dc_render_target.c | 12 ++++++++++++ dlls/d2d1/tests/d2d1.c | 4 ---- 2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/d2d1/dc_render_target.c b/dlls/d2d1/dc_render_target.c index adda6560deb..b09b77ff788 100644 --- a/dlls/d2d1/dc_render_target.c +++ b/dlls/d2d1/dc_render_target.c @@ -586,9 +586,21 @@ static void STDMETHODCALLTYPE d2d_dc_render_target_Clear(ID2D1DCRenderTarget *if static void STDMETHODCALLTYPE d2d_dc_render_target_BeginDraw(ID2D1DCRenderTarget *iface) { struct d2d_dc_render_target *render_target = impl_from_ID2D1DCRenderTarget(iface); + const RECT *dst_rect = &render_target->dst_rect; + HDC hdc;
TRACE("iface %p.\n", iface);
+ if (render_target->dxgi_surface) + { + if (SUCCEEDED(IDXGISurface1_GetDC(render_target->dxgi_surface, TRUE, &hdc))) + { + BitBlt(hdc, 0, 0, dst_rect->right - dst_rect->left, dst_rect->bottom - dst_rect->top, + render_target->hdc, dst_rect->left, dst_rect->top, SRCCOPY); + IDXGISurface1_ReleaseDC(render_target->dxgi_surface, NULL); + } + } + ID2D1RenderTarget_BeginDraw(render_target->dxgi_target); }
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 909944a8bf6..bb41d401bf3 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -6170,7 +6170,6 @@ static void test_dc_target(BOOL d3d11) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
clr = GetPixel(hdc, 0, 0); - todo_wine ok(clr == RGB(128, 128, 128), "Got unexpected colour 0x%08lx.\n", clr);
/* Partially fill. */ @@ -6190,7 +6189,6 @@ static void test_dc_target(BOOL d3d11) clr = GetPixel(hdc, 0, 0); ok(clr == RGB(0, 255, 0), "Got unexpected colour 0x%08lx.\n", clr); clr = GetPixel(hdc, 12, 0); - todo_wine ok(clr == RGB(128, 128, 128), "Got unexpected colour 0x%08lx.\n", clr);
/* Bind to a subrectangle. */ @@ -6208,7 +6206,6 @@ static void test_dc_target(BOOL d3d11) clr = GetPixel(hdc, 0, 0); ok(clr == RGB(128, 128, 128), "Got unexpected colour 0x%08lx.\n", clr); clr = GetPixel(hdc, 12, 0); - todo_wine ok(clr == RGB(128, 128, 128), "Got unexpected colour 0x%08lx.\n", clr);
/* GDI-clear while drawing. */ @@ -6223,7 +6220,6 @@ static void test_dc_target(BOOL d3d11) clr = GetPixel(hdc, 0, 0); ok(clr == RGB(192, 192, 192), "Got unexpected colour 0x%08lx.\n", clr); clr = GetPixel(hdc, 12, 0); - todo_wine ok(clr == RGB(128, 128, 128), "Got unexpected colour 0x%08lx.\n", clr);
ID2D1DCRenderTarget_Release(rt);