summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/dash-caps-joins-ps-argb32-ref.pngbin1247 -> 2205 bytes
-rw-r--r--test/dash-caps-joins-ref.pngbin2583 -> 4680 bytes
-rw-r--r--test/dash-caps-joins.c45
3 files changed, 27 insertions, 18 deletions
diff --git a/test/dash-caps-joins-ps-argb32-ref.png b/test/dash-caps-joins-ps-argb32-ref.png
index 629b97b3..974c2813 100644
--- a/test/dash-caps-joins-ps-argb32-ref.png
+++ b/test/dash-caps-joins-ps-argb32-ref.png
Binary files differ
diff --git a/test/dash-caps-joins-ref.png b/test/dash-caps-joins-ref.png
index 9218ae49..ec1f2f7d 100644
--- a/test/dash-caps-joins-ref.png
+++ b/test/dash-caps-joins-ref.png
Binary files differ
diff --git a/test/dash-caps-joins.c b/test/dash-caps-joins.c
index 722a59d2..370d05dd 100644
--- a/test/dash-caps-joins.c
+++ b/test/dash-caps-joins.c
@@ -41,7 +41,7 @@ cairo_test_t test = {
"dash-caps-joins",
"Test caps and joins when dashing",
3 * (PAD + SIZE) + PAD,
- PAD + SIZE + PAD,
+ PAD + SIZE + PAD + SIZE + PAD,
draw
};
@@ -62,6 +62,8 @@ static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
double dash[] = {LINE_WIDTH, 1.5 * LINE_WIDTH};
+ double dash_offset = -2 * LINE_WIDTH;
+ int i;
/* We draw in the default black, so paint white first. */
cairo_save (cr);
@@ -69,29 +71,36 @@ draw (cairo_t *cr, int width, int height)
cairo_paint (cr);
cairo_restore (cr);
- cairo_set_line_width (cr, LINE_WIDTH);
- cairo_set_dash (cr, dash, sizeof(dash)/sizeof(dash[0]), - 2 * LINE_WIDTH);
+ for (i=0; i<2; i++) {
+ cairo_save (cr);
+ cairo_set_line_width (cr, LINE_WIDTH);
+ cairo_set_dash (cr, dash, sizeof(dash)/sizeof(dash[0]), dash_offset);
- cairo_translate (cr, PAD, PAD);
+ cairo_translate (cr, PAD, PAD);
- make_path (cr);
- cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
- cairo_set_line_join (cr, CAIRO_LINE_JOIN_BEVEL);
- cairo_stroke (cr);
+ make_path (cr);
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
+ cairo_set_line_join (cr, CAIRO_LINE_JOIN_BEVEL);
+ cairo_stroke (cr);
- cairo_translate (cr, SIZE + PAD, 0.);
+ cairo_translate (cr, SIZE + PAD, 0.);
- make_path (cr);
- cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
- cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
- cairo_stroke (cr);
+ make_path (cr);
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
+ cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
+ cairo_stroke (cr);
- cairo_translate (cr, SIZE + PAD, 0.);
+ cairo_translate (cr, SIZE + PAD, 0.);
- make_path (cr);
- cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
- cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
- cairo_stroke (cr);
+ make_path (cr);
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
+ cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
+ cairo_stroke (cr);
+
+ cairo_restore (cr);
+ cairo_translate (cr, 0., SIZE + PAD);
+ dash_offset = 0;
+ }
return CAIRO_TEST_SUCCESS;
}