Matteo Bruni : d3d9/tests: Use the new readback helpers in test_pointsize( ).

Alexandre Julliard julliard at wine.codeweavers.com
Mon Oct 12 09:51:13 CDT 2015


Module: wine
Branch: master
Commit: 742d4df55bbd9db555a41fdbfe7a71a556856f85
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=742d4df55bbd9db555a41fdbfe7a71a556856f85

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Fri Oct  9 15:55:42 2015 +0200

d3d9/tests: Use the new readback helpers in test_pointsize().

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d9/tests/visual.c | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 50149e0..57d110a 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -10195,7 +10195,7 @@ static BOOL point_match(IDirect3DDevice9 *device, UINT x, UINT y, UINT r)
     return TRUE;
 }
 
-static void pointsize_test(void)
+static void test_pointsize(void)
 {
     static const float a = 1.0f, b = 1.0f, c = 1.0f;
     float ptsize, ptsizemax_orig, ptsizemin_orig;
@@ -10718,35 +10718,40 @@ static void pointsize_test(void)
             }
             else
             {
+                struct surface_readback rb;
+
+                get_rt_readback(backbuffer, &rb);
                 /* On AMD apparently only the first texcoord is modified by the point coordinates
                  * when using SM2/3 pixel shaders. */
-                color = getPixelColor(device, 64 - size / 2 + 1, 64 - size / 2 + 1);
+                color = get_readback_color(&rb, 64 - size / 2 + 1, 64 - size / 2 + 1);
                 ok(color_match(color, 0x00ff0000, 0),
                         "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size);
-                color = getPixelColor(device, 64 + size / 2 - 1, 64 - size / 2 + 1);
+                color = get_readback_color(&rb, 64 + size / 2 - 1, 64 - size / 2 + 1);
                 ok(color_match(color, test_setups[i].gives_0_0_texcoord ? 0x00ff0000 : 0x00ffff00, 0)
                         || (allow_broken && broken(color_match(color, 0x00ff0000, 0))),
                         "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size);
-                color = getPixelColor(device, 64 - size / 2 + 1, 64 + size / 2 - 1);
+                color = get_readback_color(&rb, 64 - size / 2 + 1, 64 + size / 2 - 1);
                 ok(color_match(color, test_setups[i].gives_0_0_texcoord ? 0x00ff0000 : 0x00000000, 0),
                         "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size);
-                color = getPixelColor(device, 64 + size / 2 - 1, 64 + size / 2 - 1);
+                color = get_readback_color(&rb, 64 + size / 2 - 1, 64 + size / 2 - 1);
                 ok(color_match(color, test_setups[i].gives_0_0_texcoord ? 0x00ff0000 : 0x0000ff00, 0)
                         || (allow_broken && broken(color_match(color, 0x00000000, 0))),
                         "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size);
 
-                color = getPixelColor(device, 64 - size / 2 - 1, 64 - size / 2 - 1);
-                ok(color_match(color, 0x0000ffff, 0),
+                color = get_readback_color(&rb, 64 - size / 2 - 1, 64 - size / 2 - 1);
+                ok(color_match(color, 0xff00ffff, 0),
                         "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size);
-                color = getPixelColor(device, 64 + size / 2 + 1, 64 - size / 2 - 1);
-                ok(color_match(color, 0x0000ffff, 0),
+                color = get_readback_color(&rb, 64 + size / 2 + 1, 64 - size / 2 - 1);
+                ok(color_match(color, 0xff00ffff, 0),
                         "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size);
-                color = getPixelColor(device, 64 - size / 2 - 1, 64 + size / 2 + 1);
-                ok(color_match(color, 0x0000ffff, 0),
+                color = get_readback_color(&rb, 64 - size / 2 - 1, 64 + size / 2 + 1);
+                ok(color_match(color, 0xff00ffff, 0),
                         "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size);
-                color = getPixelColor(device, 64 + size / 2 + 1, 64 + size / 2 + 1);
-                ok(color_match(color, 0x0000ffff, 0),
+                color = get_readback_color(&rb, 64 + size / 2 + 1, 64 + size / 2 + 1);
+                ok(color_match(color, 0xff00ffff, 0),
                         "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size);
+
+                release_surface_readback(&rb);
             }
         }
         IDirect3DDevice9_SetVertexShader(device, NULL);
@@ -20008,7 +20013,7 @@ START_TEST(visual)
     fixed_function_decl_test();
     conditional_np2_repeat_test();
     fixed_function_bumpmap_test();
-    pointsize_test();
+    test_pointsize();
     tssargtemp_test();
     np2_stretch_rect_test();
     yuv_color_test();




More information about the wine-cvs mailing list