2 * Copyright © 2008 Chris Wilson
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Chris Wilson not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior
11 * permission. Chris Wilson makes no representations about the
12 * suitability of this software for any purpose. It is provided "as
13 * is" without express or implied warranty.
15 * CHRIS WILSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
16 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 * FITNESS, IN NO EVENT SHALL CHRIS WILSON BE LIABLE FOR ANY SPECIAL,
18 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
19 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
21 * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 * Author: Chris Wilson <chris@chris-wilson.co.uk>
26 /* Extracted from a test case reported by Jeff Muizelaar found whilst running
27 * firefox http://people.mozilla.com/~jmuizelaar/BerlinDistricts-check.svg
30 #include "cairo-test.h"
35 static cairo_test_draw_function_t draw
;
37 static const cairo_test_t test
= {
38 "leaky-dashed-stroke",
39 "Exercises bug in which a dashed stroke leaks in from outside the surface",
44 static cairo_test_status_t
45 draw (cairo_t
*cr
, int width
, int height
)
47 const double dash
[2] = {.5, .5};
49 cairo_set_source_rgb (cr
, 1, 1, 1);
52 cairo_set_source_rgb (cr
, 1., 0., 0);
54 /* By adjusting the miter limit, we can see variations on the artifact.
55 * cairo_set_miter_limit (cr, 4.);
58 cairo_translate (cr
, -720, -484);
59 cairo_scale (cr
, 2.5, 2.5);
61 cairo_set_dash (cr
, dash
, 2, 0);
63 cairo_move_to (cr
, 293.622, 330);
64 cairo_line_to (cr
, 293.703, 337.028);
65 cairo_line_to (cr
, 297.45, 336.851);
66 cairo_line_to (cr
, 308.88, 342.609);
67 cairo_line_to (cr
, 309.736, 346.107);
68 cairo_line_to (cr
, 312.972, 348.128);
69 cairo_line_to (cr
, 312.977, 353.478);
70 cairo_line_to (cr
, 322.486, 359.355);
71 cairo_line_to (cr
, 320.831, 363.642);
72 cairo_line_to (cr
, 315.175, 367.171);
73 cairo_line_to (cr
, 308.987, 365.715);
74 cairo_line_to (cr
, 301.3, 365.964);
75 cairo_line_to (cr
, 304.712, 368.852);
76 cairo_line_to (cr
, 305.349, 373.022);
77 cairo_line_to (cr
, 303.211, 376.551);
78 cairo_line_to (cr
, 304.915, 382.855);
79 cairo_line_to (cr
, 323.715, 400.475);
80 cairo_line_to (cr
, 355.323, 424.072);
81 cairo_line_to (cr
, 443.078, 426.534);
82 cairo_line_to (cr
, 455.26, 400.603);
83 cairo_line_to (cr
, 471.924, 392.604);
84 cairo_line_to (cr
, 478.556, 390.797);
85 cairo_line_to (cr
, 477.715, 386);
86 cairo_line_to (cr
, 456.807, 376.507);
87 cairo_line_to (cr
, 449.134, 368.722);
88 cairo_line_to (cr
, 449.147, 365.847);
89 cairo_line_to (cr
, 439.981, 361.692);
90 cairo_line_to (cr
, 439.994, 358.603);
91 cairo_line_to (cr
, 454.645, 336.128);
92 cairo_line_to (cr
, 434.995, 324.005);
93 cairo_line_to (cr
, 423.884, 319.354);
94 cairo_line_to (cr
, 421.098, 312.569);
95 cairo_line_to (cr
, 424.291, 305.997);
96 cairo_line_to (cr
, 431.308, 305.069);
97 cairo_line_to (cr
, 437.257, 296.882);
98 cairo_line_to (cr
, 448.544, 296.808);
99 cairo_line_to (cr
, 452.113, 290.651);
100 cairo_line_to (cr
, 448.469, 285.483);
101 cairo_line_to (cr
, 442.903, 282.877);
102 cairo_line_to (cr
, 447.798, 281.124);
103 cairo_line_to (cr
, 454.622, 274.911);
104 cairo_line_to (cr
, 449.491, 269.978);
105 cairo_line_to (cr
, 443.666, 253.148);
106 cairo_line_to (cr
, 445.741, 250.834);
107 cairo_line_to (cr
, 441.87, 247.131);
108 cairo_line_to (cr
, 436.932, 246.203);
109 cairo_line_to (cr
, 430.5, 251.252);
110 cairo_line_to (cr
, 427.483, 250.751);
111 cairo_line_to (cr
, 427.26, 253.572);
112 cairo_line_to (cr
, 423.621, 255.539);
113 cairo_line_to (cr
, 423.824, 257.933);
114 cairo_line_to (cr
, 425.239, 259.582);
115 cairo_line_to (cr
, 422.385, 261.443);
116 cairo_line_to (cr
, 421.665, 260.53);
117 cairo_line_to (cr
, 419.238, 262.819);
118 cairo_line_to (cr
, 418.731, 257.849);
119 cairo_line_to (cr
, 419.72, 255.227);
120 cairo_line_to (cr
, 418.786, 250.258);
121 cairo_line_to (cr
, 405.685, 235.254);
122 cairo_line_to (cr
, 427.167, 215.127);
123 cairo_line_to (cr
, 413.852, 196.281);
124 cairo_line_to (cr
, 420.177, 192.379);
125 cairo_line_to (cr
, 419.885, 185.701);
126 cairo_line_to (cr
, 413.401, 185.428);
127 cairo_line_to (cr
, 407.985, 186.863);
128 cairo_line_to (cr
, 397.11, 189.112);
129 cairo_line_to (cr
, 390.505, 186.664);
130 cairo_line_to (cr
, 388.527, 183.694);
131 cairo_line_to (cr
, 336.503, 221.048);
132 cairo_line_to (cr
, 367.028, 241.656);
133 cairo_line_to (cr
, 365.103, 244.117);
134 cairo_line_to (cr
, 364.886, 246.792);
135 cairo_line_to (cr
, 361.467, 247.119);
136 cairo_line_to (cr
, 360.396, 245.525);
137 cairo_line_to (cr
, 356.336, 245.638);
138 cairo_line_to (cr
, 353.344, 242.122);
139 cairo_line_to (cr
, 347.149, 242.876);
140 cairo_line_to (cr
, 341.809, 256.652);
141 cairo_line_to (cr
, 342.232, 268.72);
142 cairo_line_to (cr
, 329.579, 269.095);
143 cairo_line_to (cr
, 327.001, 271.009);
144 cairo_line_to (cr
, 325.579, 275.598);
145 cairo_line_to (cr
, 318.941, 277.313);
146 cairo_line_to (cr
, 306.048, 277.231);
147 cairo_line_to (cr
, 304.071, 276.27);
148 cairo_line_to (cr
, 301.153, 277.175);
149 cairo_line_to (cr
, 293.52, 277.529);
150 cairo_line_to (cr
, 290.682, 281.947);
151 cairo_line_to (cr
, 293.911, 286.63);
152 cairo_line_to (cr
, 302.417, 290.547);
153 cairo_line_to (cr
, 303.521, 294.73);
154 cairo_line_to (cr
, 307.787, 298.088);
155 cairo_line_to (cr
, 311.718, 299.126);
156 cairo_line_to (cr
, 313.255, 302.146);
157 cairo_line_to (cr
, 314.6, 306.206);
158 cairo_line_to (cr
, 322.603, 308.96);
159 cairo_line_to (cr
, 321.718, 314.477);
160 cairo_line_to (cr
, 319.596, 320.341);
161 cairo_line_to (cr
, 300.689, 323.69);
162 cairo_line_to (cr
, 301.232, 326.789);
163 cairo_line_to (cr
, 293.622, 330);
164 cairo_close_path (cr
);
167 return CAIRO_TEST_SUCCESS
;
173 return cairo_test (&test
);