test: Add a second ring to overlapping-dash-caps

Demonstrate a second artefact when using SQUARE.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-08-02 15:37:50 +01:00
parent 3f2126f092
commit d356deb182
2 changed files with 14 additions and 5 deletions

View file

@ -31,22 +31,31 @@
static cairo_test_status_t static cairo_test_status_t
draw (cairo_t *cr, int width, int height) draw (cairo_t *cr, int width, int height)
{ {
double dashes[] = {20, 10}; double dashes1[] = {20, 10};
double dashes2[] = {10, 1};
cairo_set_source_rgb (cr, 1, 1, 1); cairo_set_source_rgb (cr, 1, 1, 1);
cairo_paint (cr); cairo_paint (cr);
cairo_set_source_rgba (cr, 0, 0, 0, 0.5); cairo_set_line_width (cr, 15);
cairo_set_dash (cr, dashes1, 2, 0);
cairo_new_sub_path (cr); cairo_new_sub_path (cr);
cairo_arc (cr, SIZE/2, SIZE/2, SIZE/2-10, 0, 2*M_PI); cairo_arc (cr, SIZE/2, SIZE/2, SIZE/2-10, 0, 2*M_PI);
cairo_set_dash (cr, dashes, 2, 0); cairo_set_source_rgba (cr, 1, 0, 0, 0.5);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
cairo_set_line_width (cr, 15);
cairo_stroke (cr); cairo_stroke (cr);
cairo_set_dash (cr, dashes2, 2, 0);
cairo_new_sub_path (cr);
cairo_arc (cr, SIZE/2, SIZE/2, SIZE/4-5, 0, 2*M_PI);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
cairo_set_source_rgba (cr, 0, 1, 0, 0.5);
cairo_stroke (cr);
return CAIRO_TEST_SUCCESS; return CAIRO_TEST_SUCCESS;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB