diff options
author | Uli Schlachter <psychon@znc.in> | 2011-03-21 18:42:27 +0100 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2011-03-24 18:09:34 +0100 |
commit | 532cbcfbc7d1b710daf7b506bfd87048dd8d44db (patch) | |
tree | 459a560ec8f91886de5aebac84e4151a0e3fa31e /test/operator-source.c | |
parent | 90156f6ab7b94e9e576e34f6a2d8cb809242f8d0 (diff) | |
download | cairo-532cbcfbc7d1b710daf7b506bfd87048dd8d44db.tar.gz |
Add unaligned boxes to "operator-source" test
These ref images might be wrong. Since the test failed here already before this
change, I took the old ref images and copied the new part from the test output
underneath it. For the backends that I don't have, I deleted the images (sorry).
After this, the "operator-source" test still fails for me on all backends, but
much more prominently so for the image backend. xcb-render-0.0/argb32 gets
compared against a rgb24 ref image, but apparently this was already the case
before(?). The rest are minor differences.
This reveals a bug in the image backend. This was originally reported here:
http://lists.cairographics.org/archives/cairo/2011-March/021827.html
Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'test/operator-source.c')
-rw-r--r-- | test/operator-source.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/test/operator-source.c b/test/operator-source.c index d734167c6..3dee57000 100644 --- a/test/operator-source.c +++ b/test/operator-source.c @@ -22,6 +22,7 @@ * * Authors: Kristian Høgsberg <krh@redhat.com> * Owen Taylor <otaylor@redhat.com> + * Uli Schlachter <psychon@znc.in> */ #include <math.h> @@ -145,12 +146,15 @@ draw_polygon (cairo_t *cr, int x, int y) } static void -draw_rects (cairo_t *cr, int x, int y) +draw_rects (cairo_t *cr, int x, int y, double offset) { - double block_width = (int)(0.33 * WIDTH + 0.5); - double block_height = (int)(0.33 * HEIGHT + 0.5); + double block_width = (int)(0.33 * WIDTH + 0.5) - offset/3; + double block_height = (int)(0.33 * HEIGHT + 0.5) - offset/3; int i, j; + x += offset/2; + y += offset/2; + for (i = 0; i < 3; i++) for (j = 0; j < 3; j++) if ((i + j) % 2 == 0) @@ -161,6 +165,18 @@ draw_rects (cairo_t *cr, int x, int y) cairo_fill (cr); } +static void +draw_aligned_rects (cairo_t *cr, int x, int y) +{ + draw_rects (cr, x, y, 0); +} + +static void +draw_unaligned_rects (cairo_t *cr, int x, int y) +{ + draw_rects (cr, x, y, 2.1); +} + static void (* const pattern_funcs[])(cairo_t *cr, int x, int y) = { set_solid_pattern, set_translucent_pattern, @@ -172,7 +188,8 @@ static void (* const draw_funcs[])(cairo_t *cr, int x, int y) = { draw_mask, draw_glyphs, draw_polygon, - draw_rects + draw_aligned_rects, + draw_unaligned_rects }; #define IMAGE_WIDTH (ARRAY_LENGTH (pattern_funcs) * (WIDTH + PAD) + PAD) |