[PATCH 5/5] d2d1: Take the render target transform into account when evaluating flatness in vs_code_bezier_outline[].

Henri Verbeet hverbeet at codeweavers.com
Wed May 31 04:07:06 CDT 2017


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/d2d1/render_target.c | 83 +++++++++++++++++++++++++----------------------
 dlls/d2d1/tests/d2d1.c    |  2 +-
 2 files changed, 45 insertions(+), 40 deletions(-)

diff --git a/dlls/d2d1/render_target.c b/dlls/d2d1/render_target.c
index 99c8713..c55401a 100644
--- a/dlls/d2d1/render_target.c
+++ b/dlls/d2d1/render_target.c
@@ -2224,15 +2224,16 @@ static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_t
             q_i = l * q_prev + v_p;
             p += stroke_width * q_i;
 
-            v_p = normalize(float2(-p2.y, p2.x));
-            if (abs(dot(p1, v_p)) < 1.0f)
+            v_p = mul(rt, p2);
+            v_p = normalize(float2(-v_p.y, v_p.x));
+            if (abs(dot(mul(rt, p1), v_p)) < 1.0f)
             {
                 texcoord.xzw = float3(0.0f, 0.0f, 0.0f);
-                texcoord.y = dot(p, v_p);
+                texcoord.y = dot(mul(rt, p), v_p);
             }
             else
             {
-                texcoord.zw = sign(dot(p1, v_p)) * v_p;
+                texcoord.zw = sign(dot(mul(rt, p1), v_p)) * v_p;
                 v_p = -float2(-p.y, p.x) / dot(float2(-p1.y, p1.x), p2);
                 texcoord.x = dot(v_p, p1 - 0.5f * p2);
                 texcoord.y = dot(v_p, p1);
@@ -2246,7 +2247,7 @@ static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_t
             return float4(position, 0.0f, 1.0f);
         }
 #endif
-        0x43425844, 0x411d8ea2, 0xae9762e9, 0x31a7c2d1, 0x529c1b7e, 0x00000001, 0x00000a04, 0x00000003,
+        0x43425844, 0x2b43c2df, 0x861ad5cd, 0x32b8fe33, 0x2d50f992, 0x00000001, 0x00000a9c, 0x00000003,
         0x0000002c, 0x000000e4, 0x00000174, 0x4e475349, 0x000000b0, 0x00000006, 0x00000008, 0x00000098,
         0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000303, 0x000000a1, 0x00000000, 0x00000000,
         0x00000003, 0x00000001, 0x00000303, 0x000000a1, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
@@ -2257,12 +2258,12 @@ static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_t
         0x00000003, 0x00000000, 0x0000000f, 0x00000074, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
         0x0000000f, 0x00000077, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000c03, 0x00000077,
         0x00000001, 0x00000000, 0x00000003, 0x00000003, 0x00000c03, 0x505f5653, 0x5449534f, 0x004e4f49,
-        0x53005655, 0x4b4f5254, 0x52545f45, 0x46534e41, 0x004d524f, 0x52444853, 0x00000888, 0x00010040,
-        0x00000222, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, 0x0300005f, 0x00101032, 0x00000000,
+        0x53005655, 0x4b4f5254, 0x52545f45, 0x46534e41, 0x004d524f, 0x52444853, 0x00000920, 0x00010040,
+        0x00000248, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, 0x0300005f, 0x00101032, 0x00000000,
         0x0300005f, 0x00101032, 0x00000001, 0x0300005f, 0x00101032, 0x00000002, 0x0300005f, 0x00101032,
         0x00000003, 0x0300005f, 0x00101032, 0x00000004, 0x0300005f, 0x00101032, 0x00000005, 0x04000067,
         0x001020f2, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000001, 0x03000065, 0x00102032,
-        0x00000002, 0x03000065, 0x00102032, 0x00000003, 0x02000068, 0x00000004, 0x0800000f, 0x00100012,
+        0x00000002, 0x03000065, 0x00102032, 0x00000003, 0x02000068, 0x00000005, 0x0800000f, 0x00100012,
         0x00000000, 0x00208046, 0x00000000, 0x00000000, 0x00101046, 0x00000005, 0x0800000f, 0x00100022,
         0x00000000, 0x00208046, 0x00000000, 0x00000001, 0x00101046, 0x00000005, 0x0700000f, 0x00100042,
         0x00000000, 0x00100046, 0x00000000, 0x00100046, 0x00000000, 0x05000044, 0x00100042, 0x00000000,
@@ -2294,39 +2295,43 @@ static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_t
         0x00000000, 0x00000000, 0x00101046, 0x00000001, 0x0800000f, 0x00100022, 0x00000002, 0x00208046,
         0x00000000, 0x00000001, 0x00101046, 0x00000001, 0x08000000, 0x001000c2, 0x00000000, 0x00100406,
         0x00000001, 0x80100406, 0x00000041, 0x00000002, 0x0a000032, 0x00100032, 0x00000000, 0x00208ff6,
-        0x00000000, 0x00000001, 0x00100046, 0x00000000, 0x00100ae6, 0x00000000, 0x06000036, 0x00100042,
+        0x00000000, 0x00000001, 0x00100046, 0x00000000, 0x00100ae6, 0x00000000, 0x0800000f, 0x00100012,
+        0x00000001, 0x00208046, 0x00000000, 0x00000002, 0x00100046, 0x00000000, 0x0800000f, 0x00100022,
+        0x00000001, 0x00208046, 0x00000000, 0x00000003, 0x00100046, 0x00000000, 0x0800000f, 0x00100012,
+        0x00000003, 0x00208046, 0x00000000, 0x00000000, 0x00101046, 0x00000003, 0x0800000f, 0x00100022,
+        0x00000003, 0x00208046, 0x00000000, 0x00000001, 0x00101046, 0x00000003, 0x08000000, 0x001000c2,
+        0x00000001, 0x80100406, 0x00000041, 0x00000002, 0x00100406, 0x00000003, 0x0800000f, 0x00100082,
+        0x00000000, 0x00208046, 0x00000000, 0x00000003, 0x00100ae6, 0x00000001, 0x06000036, 0x00100042,
+        0x00000002, 0x8010003a, 0x00000041, 0x00000000, 0x0800000f, 0x00100082, 0x00000002, 0x00208046,
+        0x00000000, 0x00000002, 0x00100ae6, 0x00000001, 0x0700000f, 0x00100082, 0x00000000, 0x00100ae6,
+        0x00000002, 0x00100ae6, 0x00000002, 0x05000044, 0x00100082, 0x00000000, 0x0010003a, 0x00000000,
+        0x07000038, 0x001000c2, 0x00000002, 0x00100ff6, 0x00000000, 0x00100ea6, 0x00000002, 0x0700000f,
+        0x00100022, 0x00000003, 0x00100046, 0x00000001, 0x00100ae6, 0x00000002, 0x06000036, 0x00100042,
         0x00000000, 0x8010001a, 0x00000041, 0x00000000, 0x0800000f, 0x00100012, 0x00000001, 0x00208046,
         0x00000000, 0x00000000, 0x00101046, 0x00000002, 0x0800000f, 0x00100022, 0x00000001, 0x00208046,
-        0x00000000, 0x00000001, 0x00101046, 0x00000002, 0x08000000, 0x00100032, 0x00000001, 0x80100046,
-        0x00000041, 0x00000002, 0x00100046, 0x00000001, 0x06000036, 0x00100042, 0x00000001, 0x8010001a,
-        0x00000041, 0x00000001, 0x0800000f, 0x00100012, 0x00000003, 0x00208046, 0x00000000, 0x00000000,
-        0x00101046, 0x00000003, 0x0800000f, 0x00100022, 0x00000003, 0x00208046, 0x00000000, 0x00000001,
-        0x00101046, 0x00000003, 0x08000000, 0x00100032, 0x00000002, 0x80100046, 0x00000041, 0x00000002,
-        0x00100046, 0x00000003, 0x0700000f, 0x00100082, 0x00000000, 0x00100a26, 0x00000001, 0x00100046,
-        0x00000002, 0x0800000e, 0x001000c2, 0x00000000, 0x801002a6, 0x00000041, 0x00000000, 0x00100ff6,
-        0x00000000, 0x0d000032, 0x001000c2, 0x00000001, 0x80100406, 0x00000041, 0x00000002, 0x00004002,
-        0x00000000, 0x00000000, 0x3f000000, 0x3f000000, 0x00100406, 0x00000001, 0x0700000f, 0x00100012,
-        0x00000003, 0x00100ae6, 0x00000000, 0x00100ae6, 0x00000001, 0x0700000f, 0x00100022, 0x00000003,
-        0x00100ae6, 0x00000000, 0x00100046, 0x00000001, 0x06000036, 0x001000c2, 0x00000002, 0x80100556,
-        0x00000041, 0x00000002, 0x0700000f, 0x00100042, 0x00000000, 0x00100086, 0x00000002, 0x001000c6,
-        0x00000002, 0x0a000038, 0x001000c2, 0x00000001, 0x00100156, 0x00000002, 0x00004002, 0x00000000,
-        0x00000000, 0xbf800000, 0x3f800000, 0x05000044, 0x00100042, 0x00000000, 0x0010002a, 0x00000000,
-        0x07000038, 0x001000c2, 0x00000000, 0x00100aa6, 0x00000000, 0x00100ea6, 0x00000001, 0x0700000f,
-        0x00100022, 0x00000002, 0x00100046, 0x00000000, 0x00100ae6, 0x00000000, 0x08000036, 0x001000d2,
-        0x00000002, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0700000f, 0x00100012,
-        0x00000000, 0x00100046, 0x00000001, 0x00100ae6, 0x00000000, 0x07000031, 0x00100022, 0x00000000,
-        0x00004001, 0x00000000, 0x0010000a, 0x00000000, 0x07000031, 0x00100012, 0x00000001, 0x0010000a,
-        0x00000000, 0x00004001, 0x00000000, 0x08000031, 0x00100012, 0x00000000, 0x8010000a, 0x00000081,
-        0x00000000, 0x00004001, 0x3f800000, 0x0800001e, 0x00100022, 0x00000000, 0x8010001a, 0x00000041,
-        0x00000000, 0x0010000a, 0x00000001, 0x0500002b, 0x00100022, 0x00000000, 0x0010001a, 0x00000000,
-        0x07000038, 0x001000c2, 0x00000003, 0x00100ea6, 0x00000000, 0x00100556, 0x00000000, 0x09000037,
-        0x001020f2, 0x00000001, 0x00100006, 0x00000000, 0x00100e46, 0x00000002, 0x00100e46, 0x00000003,
-        0x06000036, 0x00100032, 0x00000000, 0x00208046, 0x00000000, 0x00000002, 0x06000036, 0x001000c2,
-        0x00000000, 0x00208406, 0x00000000, 0x00000003, 0x08000038, 0x001000f2, 0x00000000, 0x00100e46,
-        0x00000000, 0x00208ff6, 0x00000000, 0x00000001, 0x0a000038, 0x001000f2, 0x00000000, 0x00100e46,
-        0x00000000, 0x00004002, 0x3f000000, 0x3f000000, 0x3f000000, 0x3f000000, 0x05000036, 0x00102032,
-        0x00000002, 0x00100086, 0x00000000, 0x05000036, 0x00102032, 0x00000003, 0x001005d6, 0x00000000,
-        0x0100003e,
+        0x00000000, 0x00000001, 0x00101046, 0x00000002, 0x08000000, 0x00100032, 0x00000004, 0x80100046,
+        0x00000041, 0x00000002, 0x00100046, 0x00000001, 0x06000036, 0x00100042, 0x00000004, 0x8010001a,
+        0x00000041, 0x00000004, 0x0700000f, 0x00100022, 0x00000000, 0x00100a26, 0x00000004, 0x00100ae6,
+        0x00000001, 0x0d000032, 0x00100032, 0x00000001, 0x80100ae6, 0x00000041, 0x00000001, 0x00004002,
+        0x3f000000, 0x3f000000, 0x00000000, 0x00000000, 0x00100046, 0x00000004, 0x0800000e, 0x00100032,
+        0x00000000, 0x80100a26, 0x00000041, 0x00000000, 0x00100556, 0x00000000, 0x0700000f, 0x00100012,
+        0x00000001, 0x00100046, 0x00000000, 0x00100046, 0x00000001, 0x0700000f, 0x00100022, 0x00000001,
+        0x00100046, 0x00000000, 0x00100046, 0x00000004, 0x0800000f, 0x00100012, 0x00000000, 0x00208046,
+        0x00000000, 0x00000002, 0x00100046, 0x00000004, 0x0800000f, 0x00100022, 0x00000000, 0x00208046,
+        0x00000000, 0x00000003, 0x00100046, 0x00000004, 0x0700000f, 0x00100012, 0x00000000, 0x00100046,
+        0x00000000, 0x00100ae6, 0x00000002, 0x07000031, 0x00100022, 0x00000000, 0x00004001, 0x00000000,
+        0x0010000a, 0x00000000, 0x07000031, 0x00100042, 0x00000000, 0x0010000a, 0x00000000, 0x00004001,
+        0x00000000, 0x08000031, 0x00100012, 0x00000000, 0x8010000a, 0x00000081, 0x00000000, 0x00004001,
+        0x3f800000, 0x0800001e, 0x00100022, 0x00000000, 0x8010001a, 0x00000041, 0x00000000, 0x0010002a,
+        0x00000000, 0x0500002b, 0x00100022, 0x00000000, 0x0010001a, 0x00000000, 0x07000038, 0x001000c2,
+        0x00000001, 0x00100ea6, 0x00000002, 0x00100556, 0x00000000, 0x08000036, 0x001000d2, 0x00000003,
+        0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x09000037, 0x001020f2, 0x00000001,
+        0x00100006, 0x00000000, 0x00100e46, 0x00000003, 0x00100e46, 0x00000001, 0x06000036, 0x00100032,
+        0x00000000, 0x00208046, 0x00000000, 0x00000002, 0x06000036, 0x001000c2, 0x00000000, 0x00208406,
+        0x00000000, 0x00000003, 0x08000038, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00208ff6,
+        0x00000000, 0x00000001, 0x0a000038, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00004002,
+        0x3f000000, 0x3f000000, 0x3f000000, 0x3f000000, 0x05000036, 0x00102032, 0x00000002, 0x00100086,
+        0x00000000, 0x05000036, 0x00102032, 0x00000003, 0x001005d6, 0x00000000, 0x0100003e,
     };
     static const DWORD vs_code_bezier[] =
     {
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 2d64615..b26b7b1 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -4368,7 +4368,7 @@ static void test_draw_geometry(void)
             "JAhbuQGAAcABesYBc84Ba9YBTvQBP4MCOIoCNI4CM5ACMZICL5QCLZYCK5kCKJsCJ54CI6MCHq8C"
             "EraSAQAA");
     ok(match, "Figure does not match.\n");
-    match = compare_figure(surface,   0, 160, 160, 320, 0xff652e89, 256,
+    match = compare_figure(surface,   0, 160, 160, 320, 0xff652e89, 512,
             "xWkCmwEFmAEJlQELlAENkgEOkQEPjwESjQETjAEVigELAQqJAQsCCogBCwQKhwEKBQqGAQoGCoYB"
             "CgcKhAEKCAqEAQoIC4IBCgoKggEKCgqBAQoMCoABCgwKfwoNCn8KDgp9Cg8KfQoPCnwKEQp7ChEK"
             "egoSCnoKEwp4ChQKeAoUCncLFQp2ChYKdgoWCnYKFwp2ChYKdgoWCncKFgp2ChYKdgoWCncKFQt2"
-- 
2.1.4




More information about the wine-patches mailing list