[cairo-commit] test/fill-alpha.c test/fill-alpha-pattern.c test/fill-alpha-pattern-ps-ref.png test/fill-alpha-pattern-ref.png test/fill-alpha-ref.png

Chris Wilson ickle at kemper.freedesktop.org
Tue Sep 9 01:15:15 PDT 2008


 test/fill-alpha-pattern-ps-ref.png |binary
 test/fill-alpha-pattern-ref.png    |binary
 test/fill-alpha-pattern.c          |    9 +++++----
 test/fill-alpha-ref.png            |binary
 test/fill-alpha.c                  |    9 +++++----
 5 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 378b11aaf39496919fd10108c00946cffe1fafc4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Sep 9 09:06:10 2008 +0100

    [test] fill-alpha
    
    Update alpha value to non-divisable-by-256 number to expose a bug in
    pixman where it appears to be mixing in empty registers.

diff --git a/test/fill-alpha-pattern-ps-ref.png b/test/fill-alpha-pattern-ps-ref.png
index a56b36c..c8d14b1 100644
Binary files a/test/fill-alpha-pattern-ps-ref.png and b/test/fill-alpha-pattern-ps-ref.png differ
diff --git a/test/fill-alpha-pattern-ref.png b/test/fill-alpha-pattern-ref.png
index 2b7ff9c..0031c04 100644
Binary files a/test/fill-alpha-pattern-ref.png and b/test/fill-alpha-pattern-ref.png differ
diff --git a/test/fill-alpha-pattern.c b/test/fill-alpha-pattern.c
index 7b0714a..79722ca 100644
--- a/test/fill-alpha-pattern.c
+++ b/test/fill-alpha-pattern.c
@@ -40,6 +40,7 @@ static const cairo_test_t test = {
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
+    const double alpha = 1./3;
     cairo_pattern_t *pattern;
     int n;
 
@@ -53,13 +54,13 @@ draw (cairo_t *cr, int width, int height)
 
     /* square */
     cairo_rectangle (cr, PAD, PAD, SIZE, SIZE);
-    cairo_set_source_rgba (cr, 1, 0, 0, .5);
+    cairo_set_source_rgba (cr, 1, 0, 0, alpha);
     cairo_fill (cr);
 
     /* circle */
     cairo_translate (cr, SIZE + 2 * PAD, 0);
     cairo_arc (cr, PAD + SIZE / 2., PAD + SIZE / 2., SIZE / 2., 0, 2 * M_PI);
-    cairo_set_source_rgba (cr, 0, 1, 0, .5);
+    cairo_set_source_rgba (cr, 0, 1, 0, alpha);
     cairo_fill (cr);
 
     /* triangle */
@@ -67,7 +68,7 @@ draw (cairo_t *cr, int width, int height)
     cairo_move_to (cr, PAD + SIZE / 2, PAD);
     cairo_line_to (cr, PAD + SIZE, PAD + SIZE);
     cairo_line_to (cr, PAD, PAD + SIZE);
-    cairo_set_source_rgba (cr, 0, 0, 1, .5);
+    cairo_set_source_rgba (cr, 0, 0, 1, alpha);
     cairo_fill (cr);
 
     /* star */
@@ -81,7 +82,7 @@ draw (cairo_t *cr, int width, int height)
 		       SIZE/4 * cos ((2*n+1)*2*M_PI / 10),
 		       SIZE/4 * sin ((2*n+1)*2*M_PI / 10));
     }
-    cairo_set_source_rgba (cr, 0, 0, 0, .5);
+    cairo_set_source_rgba (cr, 0, 0, 0, alpha);
     cairo_fill (cr);
 
     return CAIRO_TEST_SUCCESS;
diff --git a/test/fill-alpha-ref.png b/test/fill-alpha-ref.png
index cb18226..61aaac2 100644
Binary files a/test/fill-alpha-ref.png and b/test/fill-alpha-ref.png differ
diff --git a/test/fill-alpha.c b/test/fill-alpha.c
index ee71247..db395b3 100644
--- a/test/fill-alpha.c
+++ b/test/fill-alpha.c
@@ -40,6 +40,7 @@ static const cairo_test_t test = {
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
+    const double alpha = 1./3;
     int n;
 
     /* flatten to white */
@@ -48,13 +49,13 @@ draw (cairo_t *cr, int width, int height)
 
     /* square */
     cairo_rectangle (cr, PAD, PAD, SIZE, SIZE);
-    cairo_set_source_rgba (cr, 1, 0, 0, .5);
+    cairo_set_source_rgba (cr, 1, 0, 0, alpha);
     cairo_fill (cr);
 
     /* circle */
     cairo_translate (cr, SIZE + 2 * PAD, 0);
     cairo_arc (cr, PAD + SIZE / 2., PAD + SIZE / 2., SIZE / 2., 0, 2 * M_PI);
-    cairo_set_source_rgba (cr, 0, 1, 0, .5);
+    cairo_set_source_rgba (cr, 0, 1, 0, alpha);
     cairo_fill (cr);
 
     /* triangle */
@@ -62,7 +63,7 @@ draw (cairo_t *cr, int width, int height)
     cairo_move_to (cr, PAD + SIZE / 2, PAD);
     cairo_line_to (cr, PAD + SIZE, PAD + SIZE);
     cairo_line_to (cr, PAD, PAD + SIZE);
-    cairo_set_source_rgba (cr, 0, 0, 1, .5);
+    cairo_set_source_rgba (cr, 0, 0, 1, alpha);
     cairo_fill (cr);
 
     /* star */
@@ -76,7 +77,7 @@ draw (cairo_t *cr, int width, int height)
 		       SIZE/4 * cos ((2*n+1)*2*M_PI / 10),
 		       SIZE/4 * sin ((2*n+1)*2*M_PI / 10));
     }
-    cairo_set_source_rgba (cr, 0, 0, 0, .5);
+    cairo_set_source_rgba (cr, 0, 0, 0, alpha);
     cairo_fill (cr);
 
     return CAIRO_TEST_SUCCESS;


More information about the cairo-commit mailing list