From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/d2d1/tests/d2d1.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 665c3200e21..23144f0cbac 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -6024,6 +6024,34 @@ static void test_dc_target(BOOL d3d11) clr = GetPixel(hdc2, 0, 0); todo_wine ok(clr == RGB(0, 0, 255), "Got unexpected colour 0x%08lx.\n", clr);
+ /* DC content is retained after an empty draw */ + hr = ID2D1DCRenderTarget_BindDC(rt, hdc, &rect); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + ID2D1DCRenderTarget_BeginDraw(rt); + + set_color(&color, 1.0f, 0.0f, 0.0f, 1.0f); + ID2D1DCRenderTarget_Clear(rt, &color); + + hr = ID2D1DCRenderTarget_EndDraw(rt, NULL, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + clr = GetPixel(hdc, 0, 0); + ok(clr == RGB(255, 0, 0), "Got unexpected colour 0x%08lx.\n", clr); + + hr = ID2D1DCRenderTarget_BindDC(rt, hdc, &rect); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + clr = GetPixel(hdc, 0, 0); + ok(clr == RGB(255, 0, 0), "Got unexpected colour 0x%08lx.\n", clr); + + ID2D1DCRenderTarget_BeginDraw(rt); + hr = ID2D1DCRenderTarget_EndDraw(rt, NULL, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + clr = GetPixel(hdc, 0, 0); + todo_wine ok(clr == RGB(255, 0, 0), "Got unexpected colour 0x%08lx.\n", clr); + DeleteDC(hdc); DeleteDC(hdc2); ID2D1DCRenderTarget_Release(rt);