Nikolay Sivov : d2d1/tests: Test that device is reused for compatible targets.

Alexandre Julliard julliard at winehq.org
Mon Sep 24 15:48:23 CDT 2018


Module: wine
Branch: master
Commit: 7c4f85ed0645cbdfdf597ec2c0b48855c547fa1e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7c4f85ed0645cbdfdf597ec2c0b48855c547fa1e

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Sep 24 07:58:30 2018 +0300

d2d1/tests: Test that device is reused for compatible targets.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d2d1/tests/d2d1.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 9e6ce06..65ab5c2 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -6772,14 +6772,26 @@ static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, B
     /* Pixel format is not defined until target is set, for DC target it's specified on creation. */
     if (target || dc_rt)
     {
+        ID2D1Device *device = NULL, *device2 = NULL;
         ID2D1DeviceContext *context2;
 
+        ID2D1DeviceContext_GetDevice(context, &device);
+
         hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, NULL, NULL, NULL,
                 D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, (ID2D1BitmapRenderTarget **)&compatible_rt);
         ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create compatible render target, hr %#x.\n", hr);
 
         hr = ID2D1RenderTarget_QueryInterface(compatible_rt, &IID_ID2D1DeviceContext, (void **)&context2);
         ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get device context, hr %#x.\n", hr);
+
+        ID2D1DeviceContext_GetDevice(context2, &device2);
+        ok_(__FILE__, line)(device == device2, "Unexpected device.\n");
+
+        if (device)
+            ID2D1Device_Release(device);
+        if (device2)
+            ID2D1Device_Release(device2);
+
         ID2D1DeviceContext_Release(context2);
 
         hr = ID2D1RenderTarget_CreateBitmap(compatible_rt, size, bitmap_data, sizeof(*bitmap_data), &bitmap_desc, &bitmap);




More information about the wine-cvs mailing list