From 378b11aaf39496919fd10108c00946cffe1fafc4 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 9 Sep 2008 09:06:10 +0100 Subject: [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. --- test/fill-alpha-pattern-ps-ref.png | Bin 4519 -> 4380 bytes test/fill-alpha-pattern-ref.png | Bin 3855 -> 3653 bytes test/fill-alpha-pattern.c | 9 +++++---- test/fill-alpha-ref.png | Bin 3182 -> 2989 bytes test/fill-alpha.c | 9 +++++---- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/test/fill-alpha-pattern-ps-ref.png b/test/fill-alpha-pattern-ps-ref.png index a56b36c7..c8d14b11 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 2b7ff9ca..0031c04c 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 7b0714af..79722ca7 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 cb18226d..61aaac29 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 ee712476..db395b3b 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; -- cgit v1.2.3