summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2011-03-21 18:42:27 +0100
committerUli Schlachter <psychon@znc.in>2011-03-24 18:09:34 +0100
commit532cbcfbc7d1b710daf7b506bfd87048dd8d44db (patch)
tree459a560ec8f91886de5aebac84e4151a0e3fa31e /test
parent90156f6ab7b94e9e576e34f6a2d8cb809242f8d0 (diff)
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')
-rw-r--r--test/operator-source.c25
-rw-r--r--test/operator-source.image16.ref.pngbin2756 -> 3959 bytes
-rw-r--r--test/operator-source.pdf.rgb24.ref.pngbin3645 -> 0 bytes
-rw-r--r--test/operator-source.quartz.argb32.ref.pngbin4936 -> 0 bytes
-rw-r--r--test/operator-source.quartz.rgb24.ref.pngbin3771 -> 0 bytes
-rw-r--r--test/operator-source.ref.pngbin4395 -> 5745 bytes
-rw-r--r--test/operator-source.rgb24.ref.pngbin3231 -> 4639 bytes
-rw-r--r--test/operator-source.svg12.argb32.xfail.pngbin2967 -> 0 bytes
-rw-r--r--test/operator-source.svg12.rgb24.xfail.pngbin2976 -> 0 bytes
-rw-r--r--test/operator-source.xlib-fallback.ref.pngbin3177 -> 4444 bytes
-rw-r--r--test/operator-source.xlib.ref.pngbin4420 -> 5721 bytes
-rw-r--r--test/operator-source.xlib.rgb24.ref.pngbin3201 -> 4447 bytes
12 files changed, 21 insertions, 4 deletions
diff --git a/test/operator-source.c b/test/operator-source.c
index d734167c..3dee5700 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)
diff --git a/test/operator-source.image16.ref.png b/test/operator-source.image16.ref.png
index 09173e0f..45562603 100644
--- a/test/operator-source.image16.ref.png
+++ b/test/operator-source.image16.ref.png
Binary files differ
diff --git a/test/operator-source.pdf.rgb24.ref.png b/test/operator-source.pdf.rgb24.ref.png
deleted file mode 100644
index 9482ed81..00000000
--- a/test/operator-source.pdf.rgb24.ref.png
+++ /dev/null
Binary files differ
diff --git a/test/operator-source.quartz.argb32.ref.png b/test/operator-source.quartz.argb32.ref.png
deleted file mode 100644
index 83d788c5..00000000
--- a/test/operator-source.quartz.argb32.ref.png
+++ /dev/null
Binary files differ
diff --git a/test/operator-source.quartz.rgb24.ref.png b/test/operator-source.quartz.rgb24.ref.png
deleted file mode 100644
index 038662f6..00000000
--- a/test/operator-source.quartz.rgb24.ref.png
+++ /dev/null
Binary files differ
diff --git a/test/operator-source.ref.png b/test/operator-source.ref.png
index 376a7070..c8a2b2e5 100644
--- a/test/operator-source.ref.png
+++ b/test/operator-source.ref.png
Binary files differ
diff --git a/test/operator-source.rgb24.ref.png b/test/operator-source.rgb24.ref.png
index 013d8a42..59ad7427 100644
--- a/test/operator-source.rgb24.ref.png
+++ b/test/operator-source.rgb24.ref.png
Binary files differ
diff --git a/test/operator-source.svg12.argb32.xfail.png b/test/operator-source.svg12.argb32.xfail.png
deleted file mode 100644
index ccf43156..00000000
--- a/test/operator-source.svg12.argb32.xfail.png
+++ /dev/null
Binary files differ
diff --git a/test/operator-source.svg12.rgb24.xfail.png b/test/operator-source.svg12.rgb24.xfail.png
deleted file mode 100644
index 827521b8..00000000
--- a/test/operator-source.svg12.rgb24.xfail.png
+++ /dev/null
Binary files differ
diff --git a/test/operator-source.xlib-fallback.ref.png b/test/operator-source.xlib-fallback.ref.png
index 79fb2c52..4527ce71 100644
--- a/test/operator-source.xlib-fallback.ref.png
+++ b/test/operator-source.xlib-fallback.ref.png
Binary files differ
diff --git a/test/operator-source.xlib.ref.png b/test/operator-source.xlib.ref.png
index 8e2f5e61..4732f52c 100644
--- a/test/operator-source.xlib.ref.png
+++ b/test/operator-source.xlib.ref.png
Binary files differ
diff --git a/test/operator-source.xlib.rgb24.ref.png b/test/operator-source.xlib.rgb24.ref.png
index a762d60a..09209afc 100644
--- a/test/operator-source.xlib.rgb24.ref.png
+++ b/test/operator-source.xlib.rgb24.ref.png
Binary files differ