From 4796dc0b26d5f56eecc4e208afc6b99ee4a7483e Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 12 Jan 2005 14:38:22 +0000 Subject: [PATCH] Add big_star_path which shows we still have fill bugs, (even now that little_star_path is working). --- test/fill-rule-ref.png | Bin 408 -> 1983 bytes test/fill-rule.c | 58 ++++++++++++++++++++++++++++++++++------- test/fill_rule-ref.png | Bin 408 -> 1983 bytes test/fill_rule.c | 58 ++++++++++++++++++++++++++++++++++------- 4 files changed, 98 insertions(+), 18 deletions(-) diff --git a/test/fill-rule-ref.png b/test/fill-rule-ref.png index 25442c049a431609e1a39b1025024ed5f499c35b..93ebe5aa98f6816bb7c64d5995b0d9c6fe3e3845 100644 GIT binary patch literal 1983 zcmV;w2SE6VP)7^e~dm6z>uAn8uJHu#dnF0lL`X^wmt&n8pYouvwWjv)I%& zrcpj?06^d}fq!cz2vL8v`=IV;-58fW#ym9vCe;9NYSoy=NFZ>6!1IO);SCLWxH^- zy_suFV+6P@mevht?rmr{Zq=k7(-;;_uAR34PEUY8oBpHw-f8!JSOlscOE5U8VW$*D1k37j^@s%L`u?7`!f9_ra7*; z&y8?QLkS4nuT*C4=gy}@OhW+(93=3mBIG9m2Xp6D5~XRVd71tJz+WlYKSgP% zc`{z`{F>2>X&4KEbpju1{F5Iz|4cU;Fb##^^!P!Oq1RfWcu=B-T9@gzrNovQKTN|| z2&@r!)AFo-L%mNT6_|!X5IEB!;w;YO&Qmj`YN+wq;j@I;GSiM}C;@>N9?$9*x%1SF zX()j6-K`RF7V72BD#b$tbZzjD49g4P)VI z-<@xa)}Ln@3PC^Loo}e~=k>vmG@RY8?Fxa9g1?kkK(;m-Qj?X6j|8q{)^Kz2)^}Y4 z_4jn_O~YLXoFwonLo%htD*`7KXeed_W0?IciH6l=4iUJg;18`m?h!boKtpkZEd7kR zNj0n{Ga>K`+iyrT*7)qSnJCfly68-t=6+p+hKos^qs&#>P~r`NbAf-@)EbIka8UMw zC|bj6Vn+x(R4@^8$3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+ * + * * src/cairo_wideint.c: (_cairo_int32x32_64_mul), + * (_cairo_int64x64_128_mul): + * * src/cairo_wideint.h: + * int32x32_64_mul and int64x64_128_mul are different from their + * unsigned compatriots + * + * 2005-01-12 Carl Worth + * + * Going back to the SVG test suite, however, the original star + * shape is still broken. Adding both shapes now as little_star_path + * and big_star_path. + * */ #include "cairo_test.h" -#define STAR_SIZE 20 +#define LITTLE_STAR_SIZE 20 +#define BIG_STAR_SIZE 80 cairo_test_t test = { "fill_rule", - "Tests cairo_set_full_rule with a star shape", - STAR_SIZE * 2 + 3, STAR_SIZE +2 + "Tests cairo_set_full_rule with some star shapes", + BIG_STAR_SIZE * 2 + 3, BIG_STAR_SIZE + LITTLE_STAR_SIZE + 3 }; - -/* Not a perfect star, but one that does show the tessellation bug. */ +/* The SVG start trimmed down, but still showing the bug (originally) */ static void -star_path (cairo_t *cr) +little_star_path (cairo_t *cr) { cairo_move_to (cr, 10, 0); cairo_rel_line_to (cr, 6, 20); @@ -66,6 +83,19 @@ star_path (cairo_t *cr) cairo_rel_line_to (cr, -16, 12); } +/* The star shape from the SVG test suite. This was is still buggy even after + we got little_star_path working. */ +static void +big_star_path (cairo_t *cr) +{ + cairo_move_to (cr, 40, 0); + cairo_rel_line_to (cr, 25, 80); + cairo_rel_line_to (cr, -65, -50); + cairo_rel_line_to (cr, 80, 0); + cairo_rel_line_to (cr, -65, 50); + cairo_close_path (cr); +} + /* Fill the same path twice, once with each fill rule */ static void draw (cairo_t *cr, int width, int height) @@ -73,12 +103,22 @@ draw (cairo_t *cr, int width, int height) cairo_set_rgb_color (cr, 1, 0, 0); cairo_translate (cr, 1, 1); - star_path (cr); + little_star_path (cr); cairo_set_fill_rule (cr, CAIRO_FILL_RULE_WINDING); cairo_fill (cr); - cairo_translate (cr, STAR_SIZE + 1, 0); - star_path (cr); + cairo_translate (cr, LITTLE_STAR_SIZE + 1, 0); + little_star_path (cr); + cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); + cairo_fill (cr); + + cairo_translate (cr, -(LITTLE_STAR_SIZE + 1), LITTLE_STAR_SIZE + 1); + big_star_path (cr); + cairo_set_fill_rule (cr, CAIRO_FILL_RULE_WINDING); + cairo_fill (cr); + + cairo_translate (cr, BIG_STAR_SIZE + 1, 0); + big_star_path (cr); cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); cairo_fill (cr); } diff --git a/test/fill_rule-ref.png b/test/fill_rule-ref.png index 25442c049a431609e1a39b1025024ed5f499c35b..93ebe5aa98f6816bb7c64d5995b0d9c6fe3e3845 100644 GIT binary patch literal 1983 zcmV;w2SE6VP)7^e~dm6z>uAn8uJHu#dnF0lL`X^wmt&n8pYouvwWjv)I%& zrcpj?06^d}fq!cz2vL8v`=IV;-58fW#ym9vCe;9NYSoy=NFZ>6!1IO);SCLWxH^- zy_suFV+6P@mevht?rmr{Zq=k7(-;;_uAR34PEUY8oBpHw-f8!JSOlscOE5U8VW$*D1k37j^@s%L`u?7`!f9_ra7*; z&y8?QLkS4nuT*C4=gy}@OhW+(93=3mBIG9m2Xp6D5~XRVd71tJz+WlYKSgP% zc`{z`{F>2>X&4KEbpju1{F5Iz|4cU;Fb##^^!P!Oq1RfWcu=B-T9@gzrNovQKTN|| z2&@r!)AFo-L%mNT6_|!X5IEB!;w;YO&Qmj`YN+wq;j@I;GSiM}C;@>N9?$9*x%1SF zX()j6-K`RF7V72BD#b$tbZzjD49g4P)VI z-<@xa)}Ln@3PC^Loo}e~=k>vmG@RY8?Fxa9g1?kkK(;m-Qj?X6j|8q{)^Kz2)^}Y4 z_4jn_O~YLXoFwonLo%htD*`7KXeed_W0?IciH6l=4iUJg;18`m?h!boKtpkZEd7kR zNj0n{Ga>K`+iyrT*7)qSnJCfly68-t=6+p+hKos^qs&#>P~r`NbAf-@)EbIka8UMw zC|bj6Vn+x(R4@^8$3p@~lxg^y3ASQ5-70#mNyBP#`w09>;H!d3(RX}xzkAe8k`ifn zGwKi9p6^X<8ZIVyfxtTj6Qr+rN8zf3u!hN6l(4-uN>&Z4Np28$reLC^j%Nfm6l<8& z*uZ$>MN$o`iS8$GOTmOm6}JfNSFYiml=-)M~g3^;d1;D*=gV(XjV+B&@gQsn>89 z>a5zxR{|2!py9O)d0Z=1!#Sv@YLl)KkeCGxdv9UKJ&$9t8t%gURh#scfW$ZrlW%ml zJpP?NG)#T~X9D~M;BM;2Y2mKRp;%o0Pncmt**)fy(ly+LdCsTIVh}wDD;oAvYU6y# zau6DJ=@}>;s(KK1p+>``Z#`<>TJ@q~ALnF4dj?9Qss~|57BxHx;Ax5r3OD9c%$N3t zpdms^N-3l0`z*I;D7MwY)!T7JYZ%irP&(A~APmJ*!>CPY`V}gQ)er!>+K^I3a@$o3 z0yOMYo?}=Ew@3{EAl9HM9ohEjVhGgG+ql4P=9VHgl(Mc%hKe49Aw+1{YUyHk+h1`S z0)XV99?4L7pXDYZHLNweGTsoKOv990E*k5Y8gptRCf^MJk65YNxX&LUZjUmVhDl73 zoKEt;A!9T8&wZ4rI{X9Rn+fn$V63DFYxtY{__M%R#b^isk}Wb`xn)K2tW6Pp98E(Z zDAPP>?oBx5&f17KOG<%hC zIB!!AiJ+1e!nK-{knUp^XHj{LU6V3 zuGcPA^s6|i^5>a`La^O;m!(S;S63WV`SVOe0od%j%ig7m?G*<#{yfuA2-f@VRCTFh zbHzc0$I&ztg3GsRP}!x5^%aL?x3CDoG!%gI_d8bKrHacHhwS%RHVx$xoB8gF>Qcq| zibGa^o@pqT&~+Bt>5F?6hphfQ({PH!OY07Rvn6(^ayg&H^moXKX=oUl_#Z&91v?cq R)?WYs002ovPDHLkV1oFX$sqs$ delta 399 zcmV;A0dW4m510cXiBL{Q4GJ0x0000DNk~Le0000h0000M2nGNE09mDZ<=k zkl6w3x=j0Pw*psBLQGr*wvpyjA + * + * Keith committed some fixes that fix the original size-20 + * star_path: + * + * * src/cairo_wideint.c: (_cairo_int32x32_64_mul), + * (_cairo_int64x64_128_mul): + * * src/cairo_wideint.h: + * int32x32_64_mul and int64x64_128_mul are different from their + * unsigned compatriots + * + * 2005-01-12 Carl Worth + * + * Going back to the SVG test suite, however, the original star + * shape is still broken. Adding both shapes now as little_star_path + * and big_star_path. + * */ #include "cairo_test.h" -#define STAR_SIZE 20 +#define LITTLE_STAR_SIZE 20 +#define BIG_STAR_SIZE 80 cairo_test_t test = { "fill_rule", - "Tests cairo_set_full_rule with a star shape", - STAR_SIZE * 2 + 3, STAR_SIZE +2 + "Tests cairo_set_full_rule with some star shapes", + BIG_STAR_SIZE * 2 + 3, BIG_STAR_SIZE + LITTLE_STAR_SIZE + 3 }; - -/* Not a perfect star, but one that does show the tessellation bug. */ +/* The SVG start trimmed down, but still showing the bug (originally) */ static void -star_path (cairo_t *cr) +little_star_path (cairo_t *cr) { cairo_move_to (cr, 10, 0); cairo_rel_line_to (cr, 6, 20); @@ -66,6 +83,19 @@ star_path (cairo_t *cr) cairo_rel_line_to (cr, -16, 12); } +/* The star shape from the SVG test suite. This was is still buggy even after + we got little_star_path working. */ +static void +big_star_path (cairo_t *cr) +{ + cairo_move_to (cr, 40, 0); + cairo_rel_line_to (cr, 25, 80); + cairo_rel_line_to (cr, -65, -50); + cairo_rel_line_to (cr, 80, 0); + cairo_rel_line_to (cr, -65, 50); + cairo_close_path (cr); +} + /* Fill the same path twice, once with each fill rule */ static void draw (cairo_t *cr, int width, int height) @@ -73,12 +103,22 @@ draw (cairo_t *cr, int width, int height) cairo_set_rgb_color (cr, 1, 0, 0); cairo_translate (cr, 1, 1); - star_path (cr); + little_star_path (cr); cairo_set_fill_rule (cr, CAIRO_FILL_RULE_WINDING); cairo_fill (cr); - cairo_translate (cr, STAR_SIZE + 1, 0); - star_path (cr); + cairo_translate (cr, LITTLE_STAR_SIZE + 1, 0); + little_star_path (cr); + cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); + cairo_fill (cr); + + cairo_translate (cr, -(LITTLE_STAR_SIZE + 1), LITTLE_STAR_SIZE + 1); + big_star_path (cr); + cairo_set_fill_rule (cr, CAIRO_FILL_RULE_WINDING); + cairo_fill (cr); + + cairo_translate (cr, BIG_STAR_SIZE + 1, 0); + big_star_path (cr); cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); cairo_fill (cr); }