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 * Owen Taylor + * Uli Schlachter */ #include @@ -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) diff --git a/test/operator-source.image16.ref.png b/test/operator-source.image16.ref.png index 09173e0f2..45562603c 100644 Binary files a/test/operator-source.image16.ref.png and b/test/operator-source.image16.ref.png differ diff --git a/test/operator-source.pdf.rgb24.ref.png b/test/operator-source.pdf.rgb24.ref.png deleted file mode 100644 index 9482ed812..000000000 Binary files a/test/operator-source.pdf.rgb24.ref.png and /dev/null differ diff --git a/test/operator-source.quartz.argb32.ref.png b/test/operator-source.quartz.argb32.ref.png deleted file mode 100644 index 83d788c5b..000000000 Binary files a/test/operator-source.quartz.argb32.ref.png and /dev/null differ diff --git a/test/operator-source.quartz.rgb24.ref.png b/test/operator-source.quartz.rgb24.ref.png deleted file mode 100644 index 038662f66..000000000 Binary files a/test/operator-source.quartz.rgb24.ref.png and /dev/null differ diff --git a/test/operator-source.ref.png b/test/operator-source.ref.png index 376a70700..c8a2b2e5f 100644 Binary files a/test/operator-source.ref.png and b/test/operator-source.ref.png differ diff --git a/test/operator-source.rgb24.ref.png b/test/operator-source.rgb24.ref.png index 013d8a420..59ad7427a 100644 Binary files a/test/operator-source.rgb24.ref.png and b/test/operator-source.rgb24.ref.png differ diff --git a/test/operator-source.svg12.argb32.xfail.png b/test/operator-source.svg12.argb32.xfail.png deleted file mode 100644 index ccf431567..000000000 Binary files a/test/operator-source.svg12.argb32.xfail.png and /dev/null differ diff --git a/test/operator-source.svg12.rgb24.xfail.png b/test/operator-source.svg12.rgb24.xfail.png deleted file mode 100644 index 827521b8f..000000000 Binary files a/test/operator-source.svg12.rgb24.xfail.png and /dev/null differ diff --git a/test/operator-source.xlib-fallback.ref.png b/test/operator-source.xlib-fallback.ref.png index 79fb2c522..4527ce715 100644 Binary files a/test/operator-source.xlib-fallback.ref.png and b/test/operator-source.xlib-fallback.ref.png differ diff --git a/test/operator-source.xlib.ref.png b/test/operator-source.xlib.ref.png index 8e2f5e61f..4732f52c7 100644 Binary files a/test/operator-source.xlib.ref.png and b/test/operator-source.xlib.ref.png differ diff --git a/test/operator-source.xlib.rgb24.ref.png b/test/operator-source.xlib.rgb24.ref.png index a762d60ab..09209afc4 100644 Binary files a/test/operator-source.xlib.rgb24.ref.png and b/test/operator-source.xlib.rgb24.ref.png differ