[cairo-commit] test/overlapping-dash-caps.c test/overlapping-dash-caps.ref.png

Chris Wilson ickle at kemper.freedesktop.org
Tue Aug 2 07:39:23 PDT 2011


 test/overlapping-dash-caps.c       |   17 +++++++++++++----
 test/overlapping-dash-caps.ref.png |binary
 2 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit d356deb18201dd8054cff158c95c6fd6f0f38dcd
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Aug 2 15:37:50 2011 +0100

    test: Add a second ring to overlapping-dash-caps
    
    Demonstrate a second artefact when using SQUARE.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/overlapping-dash-caps.c b/test/overlapping-dash-caps.c
index 0d06d11..f7ba248 100644
--- a/test/overlapping-dash-caps.c
+++ b/test/overlapping-dash-caps.c
@@ -31,22 +31,31 @@
 static cairo_test_status_t
 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_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_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_width (cr, 15);
+    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;
 }
 
diff --git a/test/overlapping-dash-caps.ref.png b/test/overlapping-dash-caps.ref.png
index 13d1664..6b3b0ce 100644
Binary files a/test/overlapping-dash-caps.ref.png and b/test/overlapping-dash-caps.ref.png differ


More information about the cairo-commit mailing list