[cairo-commit] 3 commits - test/ft-text-vertical-layout-type1-ps-argb32-ref.png test/ft-text-vertical-layout-type3-ps-argb32-ref.png test/.gitignore test/Makefile.am test/over-above-source.c test/over-above-source-ps-argb32-ref.png test/over-above-source-ref.png test/over-above-source-rgb24-ref.png test/over-around-source.c test/over-around-source-ps-argb32-ref.png test/over-around-source-ref.png test/over-around-source-rgb24-ref.png test/over-below-source.c test/over-below-source-ps-argb32-ref.png test/over-below-source-ref.png test/over-below-source-rgb24-ref.png test/over-between-source.c test/over-between-source-ref.png test/over-between-source-rgb24-ref.png test/trap-clip-ps-argb32-ref.png
Carl Worth
cworth at kemper.freedesktop.org
Sat Aug 25 19:29:35 PDT 2007
test/.gitignore | 4
test/Makefile.am | 4
test/ft-text-vertical-layout-type1-ps-argb32-ref.png |binary
test/ft-text-vertical-layout-type3-ps-argb32-ref.png |binary
test/over-above-source-ps-argb32-ref.png |binary
test/over-above-source-ref.png |binary
test/over-above-source-rgb24-ref.png |binary
test/over-above-source.c | 80 ++++++++++++++++
test/over-around-source-ps-argb32-ref.png |binary
test/over-around-source-ref.png |binary
test/over-around-source-rgb24-ref.png |binary
test/over-around-source.c | 91 +++++++++++++++++++
test/over-below-source-ps-argb32-ref.png |binary
test/over-below-source-ref.png |binary
test/over-below-source-rgb24-ref.png |binary
test/over-below-source.c | 80 ++++++++++++++++
test/over-between-source-ref.png |binary
test/over-between-source-rgb24-ref.png |binary
test/over-between-source.c | 91 +++++++++++++++++++
test/trap-clip-ps-argb32-ref.png |binary
20 files changed, 350 insertions(+)
New commits:
diff-tree a3c3fe2296a7e8f1fdffc9f922fb647237504818 (from 71cc245d5a99eb6593e104b5e6727a7db13a4503)
Author: Carl Worth <cworth at cworth.org>
Date: Sat Aug 25 19:23:13 2007 -0700
Modify ps-specific reference images for ft-text-vertical tests
I've been seeing failures with the PS backend for these tests
for a while. This is in spite of the face that we've had a PS-
specific reference image for each of these tests. I'm not sure
what the difference is between my current system and the
system used to generate the original ps-specific reference
images.
One thing we definitely need to do is to bundle fonts with the
test suite to avoid problems like this. Another is to start
documenting the systems used to generate reference images.
I get very confused with ghostscript versioning, but I can
at least say that "gs --version" reports 8.15.3 here, (though
the package appears to have an 8.56 version).
diff --git a/test/ft-text-vertical-layout-type1-ps-argb32-ref.png b/test/ft-text-vertical-layout-type1-ps-argb32-ref.png
index bc71bbc..56943e4 100644
Binary files a/test/ft-text-vertical-layout-type1-ps-argb32-ref.png and b/test/ft-text-vertical-layout-type1-ps-argb32-ref.png differ
diff --git a/test/ft-text-vertical-layout-type3-ps-argb32-ref.png b/test/ft-text-vertical-layout-type3-ps-argb32-ref.png
index e5b12bf..08581e5 100644
Binary files a/test/ft-text-vertical-layout-type3-ps-argb32-ref.png and b/test/ft-text-vertical-layout-type3-ps-argb32-ref.png differ
diff-tree 71cc245d5a99eb6593e104b5e6727a7db13a4503 (from ae185f803a95248bcb6a8232cabedbc992b66502)
Author: Carl Worth <cworth at cworth.org>
Date: Sat Aug 25 19:18:44 2007 -0700
Add PS-specific reference images for 4 tests
The following 4 tests recently started drawing with native operations
in the place of image fallbacks, so we need ps-specific reference images
to account for minor rasterization differences: over-above-source,
over-around-source, over-below-source, and trap-clip.
diff --git a/test/over-above-source-ps-argb32-ref.png b/test/over-above-source-ps-argb32-ref.png
new file mode 100644
index 0000000..886faad
Binary files /dev/null and b/test/over-above-source-ps-argb32-ref.png differ
diff --git a/test/over-around-source-ps-argb32-ref.png b/test/over-around-source-ps-argb32-ref.png
new file mode 100644
index 0000000..3ad74cc
Binary files /dev/null and b/test/over-around-source-ps-argb32-ref.png differ
diff --git a/test/over-below-source-ps-argb32-ref.png b/test/over-below-source-ps-argb32-ref.png
new file mode 100644
index 0000000..980ad5f
Binary files /dev/null and b/test/over-below-source-ps-argb32-ref.png differ
diff --git a/test/trap-clip-ps-argb32-ref.png b/test/trap-clip-ps-argb32-ref.png
new file mode 100644
index 0000000..7ed4951
Binary files /dev/null and b/test/trap-clip-ps-argb32-ref.png differ
diff-tree ae185f803a95248bcb6a8232cabedbc992b66502 (from 5929a1defbc9816a6faa6dca94ae6dc3a2dbf3df)
Author: Carl Worth <cworth at cworth.org>
Date: Sat Aug 25 18:57:46 2007 -0700
Add four new test to exercise interactions of native and fallback objects
The new tests are: over-above-source, over-around-source, over-below-source,
and over-between-source
diff --git a/test/.gitignore b/test/.gitignore
index 875c1c9..bc4c41b 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -86,6 +86,10 @@ new-sub-path
nil-surface
operator-clear
operator-source
+over-above-source
+over-around-source
+over-below-source
+over-between-source
paint
paint-repeat
paint-source-alpha
diff --git a/test/Makefile.am b/test/Makefile.am
index 4d9f5f5..ed10352 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -66,6 +66,10 @@ new-sub-path \
nil-surface \
operator-clear \
operator-source \
+over-above-source \
+over-around-source \
+over-below-source \
+over-between-source \
paint \
paint-repeat \
paint-source-alpha \
diff --git a/test/over-above-source-ref.png b/test/over-above-source-ref.png
new file mode 100644
index 0000000..f3a49f6
Binary files /dev/null and b/test/over-above-source-ref.png differ
diff --git a/test/over-above-source-rgb24-ref.png b/test/over-above-source-rgb24-ref.png
new file mode 100644
index 0000000..68c7d98
Binary files /dev/null and b/test/over-above-source-rgb24-ref.png differ
diff --git a/test/over-above-source.c b/test/over-above-source.c
new file mode 100644
index 0000000..8999e4a
--- /dev/null
+++ b/test/over-above-source.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright © 2007 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Author: Carl D. Worth <cworth at cworth.org>
+ */
+
+#include "cairo-test.h"
+
+static cairo_test_draw_function_t draw;
+
+#define SIZE 40
+#define PAD 2
+#define WIDTH (PAD + SIZE + PAD)
+#define HEIGHT WIDTH
+
+/* This test is designed to explore the interactions of "native" and
+ * "fallback" objects. For the ps surface, OVER with non-1.0 opacity
+ * will be a fallback while SOURCE will be native. For the pdf
+ * surface, it's the reverse where OVER is native while SOURCE is a
+ * fallback. */
+
+cairo_test_t test = {
+ "over-above-source",
+ "A simple test drawing a circle with OVER after a triangle drawn with SOURCE",
+ WIDTH, HEIGHT,
+ draw
+};
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+ cairo_translate (cr, PAD, PAD);
+
+ /* A red triangle with SOURCE */
+ cairo_move_to (cr, SIZE / 2, SIZE / 2);
+ cairo_rel_line_to (cr, SIZE / 2, 0);
+ cairo_rel_line_to (cr, -SIZE / 2, SIZE / 2);
+ cairo_close_path (cr);
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_set_source_rgba (cr, 1., 0., 0., 0.5); /* 50% red */
+
+ cairo_fill (cr);
+
+ /* A green circle with OVER */
+ cairo_arc (cr, SIZE / 2, SIZE / 2, SIZE / 4, 0., 2. * M_PI);
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+ cairo_set_source_rgba (cr, 0., 1., 0., 0.5); /* 50% green */
+
+ cairo_fill (cr);
+
+ return CAIRO_TEST_SUCCESS;
+}
+
+int
+main (void)
+{
+ return cairo_test (&test);
+}
diff --git a/test/over-around-source-ref.png b/test/over-around-source-ref.png
new file mode 100644
index 0000000..ccae951
Binary files /dev/null and b/test/over-around-source-ref.png differ
diff --git a/test/over-around-source-rgb24-ref.png b/test/over-around-source-rgb24-ref.png
new file mode 100644
index 0000000..943a28e
Binary files /dev/null and b/test/over-around-source-rgb24-ref.png differ
diff --git a/test/over-around-source.c b/test/over-around-source.c
new file mode 100644
index 0000000..e98c187
--- /dev/null
+++ b/test/over-around-source.c
@@ -0,0 +1,91 @@
+/*
+ * Copyright © 2007 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Author: Carl D. Worth <cworth at cworth.org>
+ */
+
+#include "cairo-test.h"
+
+static cairo_test_draw_function_t draw;
+
+#define SIZE 40
+#define PAD 2
+#define WIDTH (PAD + SIZE + PAD)
+#define HEIGHT WIDTH
+
+/* This test is designed to explore the interactions of "native" and
+ * "fallback" objects. For the ps surface, OVER with non-1.0 opacity
+ * will be a fallback while SOURCE will be native. For the pdf
+ * surface, it's the reverse where OVER is native while SOURCE is a
+ * fallback. */
+
+cairo_test_t test = {
+ "over-around-source",
+ "A simple test drawing a triangle with SOURCE between two circles drawn with OVER",
+ WIDTH, HEIGHT,
+ draw
+};
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+ cairo_translate (cr, PAD, PAD);
+
+ /* A green triangle with OVER */
+ cairo_move_to (cr, SIZE / 5, SIZE / 5);
+ cairo_rel_line_to (cr, SIZE / 2, 0);
+ cairo_rel_line_to (cr, -SIZE / 2, SIZE / 2);
+ cairo_close_path (cr);
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+ cairo_set_source_rgba (cr, 0., 1., 0., 0.5); /* 50% green */
+
+ cairo_fill (cr);
+
+ /* A red circle with SOURCE */
+ cairo_arc (cr, SIZE / 2, SIZE / 2, SIZE / 4, 0., 2. * M_PI);
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_set_source_rgba (cr, 1., 0., 0., 0.5); /* 50% red */
+
+ cairo_fill (cr);
+
+ /* Another green triangle with OVER */
+ cairo_move_to (cr, SIZE / 2, SIZE / 2);
+ cairo_rel_line_to (cr, SIZE / 2, 0);
+ cairo_rel_line_to (cr, -SIZE / 2, SIZE / 2);
+ cairo_close_path (cr);
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+ cairo_set_source_rgba (cr, 0., 1., 0., 0.5); /* 50% green */
+
+ cairo_fill (cr);
+
+ return CAIRO_TEST_SUCCESS;
+}
+
+int
+main (void)
+{
+ return cairo_test (&test);
+}
diff --git a/test/over-below-source-ref.png b/test/over-below-source-ref.png
new file mode 100644
index 0000000..cd7efd6
Binary files /dev/null and b/test/over-below-source-ref.png differ
diff --git a/test/over-below-source-rgb24-ref.png b/test/over-below-source-rgb24-ref.png
new file mode 100644
index 0000000..53041e9
Binary files /dev/null and b/test/over-below-source-rgb24-ref.png differ
diff --git a/test/over-below-source.c b/test/over-below-source.c
new file mode 100644
index 0000000..df7e7d1
--- /dev/null
+++ b/test/over-below-source.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright © 2007 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Author: Carl D. Worth <cworth at cworth.org>
+ */
+
+#include "cairo-test.h"
+
+static cairo_test_draw_function_t draw;
+
+#define SIZE 40
+#define PAD 2
+#define WIDTH (PAD + SIZE + PAD)
+#define HEIGHT WIDTH
+
+/* This test is designed to explore the interactions of "native" and
+ * "fallback" objects. For the ps surface, OVER with non-1.0 opacity
+ * will be a fallback while SOURCE will be native. For the pdf
+ * surface, it's the reverse where OVER is native while SOURCE is a
+ * fallback. */
+
+cairo_test_t test = {
+ "over-below-source",
+ "A simple test drawing a circle with OVER before a triangle drawn with SOURCE",
+ WIDTH, HEIGHT,
+ draw
+};
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+ cairo_translate (cr, PAD, PAD);
+
+ /* A green circle with OVER */
+ cairo_arc (cr, SIZE / 2, SIZE / 2, SIZE / 4, 0., 2. * M_PI);
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+ cairo_set_source_rgba (cr, 0., 1., 0., 0.5); /* 50% green */
+
+ cairo_fill (cr);
+
+ /* A red triangle with SOURCE */
+ cairo_move_to (cr, SIZE / 2, SIZE / 2);
+ cairo_line_to (cr, SIZE, SIZE / 2);
+ cairo_line_to (cr, SIZE / 2, SIZE);
+ cairo_close_path (cr);
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_set_source_rgba (cr, 1., 0., 0., 0.5); /* 50% red */
+
+ cairo_fill (cr);
+
+ return CAIRO_TEST_SUCCESS;
+}
+
+int
+main (void)
+{
+ return cairo_test (&test);
+}
diff --git a/test/over-between-source-ref.png b/test/over-between-source-ref.png
new file mode 100644
index 0000000..79ea75e
Binary files /dev/null and b/test/over-between-source-ref.png differ
diff --git a/test/over-between-source-rgb24-ref.png b/test/over-between-source-rgb24-ref.png
new file mode 100644
index 0000000..602f2d2
Binary files /dev/null and b/test/over-between-source-rgb24-ref.png differ
diff --git a/test/over-between-source.c b/test/over-between-source.c
new file mode 100644
index 0000000..9c60bbd
--- /dev/null
+++ b/test/over-between-source.c
@@ -0,0 +1,91 @@
+/*
+ * Copyright © 2007 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Author: Carl D. Worth <cworth at cworth.org>
+ */
+
+#include "cairo-test.h"
+
+static cairo_test_draw_function_t draw;
+
+#define SIZE 40
+#define PAD 2
+#define WIDTH (PAD + SIZE + PAD)
+#define HEIGHT WIDTH
+
+/* This test is designed to explore the interactions of "native" and
+ * "fallback" objects. For the ps surface, OVER with non-1.0 opacity
+ * will be a fallback while SOURCE will be native. For the pdf
+ * surface, it's the reverse where OVER is native while SOURCE is a
+ * fallback. */
+
+cairo_test_t test = {
+ "over-between-source",
+ "A simple test drawing a circle with OVER between two triangles drawn with SOURCE",
+ WIDTH, HEIGHT,
+ draw
+};
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+ cairo_translate (cr, PAD, PAD);
+
+ /* A red triangle with SOURCE */
+ cairo_move_to (cr, SIZE / 5, SIZE / 5);
+ cairo_rel_line_to (cr, SIZE / 2, 0);
+ cairo_rel_line_to (cr, -SIZE / 2, SIZE / 2);
+ cairo_close_path (cr);
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_set_source_rgba (cr, 1., 0., 0., 0.5); /* 50% red */
+
+ cairo_fill (cr);
+
+ /* A green circle with OVER */
+ cairo_arc (cr, SIZE / 2, SIZE / 2, SIZE / 4, 0., 2. * M_PI);
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+ cairo_set_source_rgba (cr, 0., 1., 0., 0.5); /* 50% green */
+
+ cairo_fill (cr);
+
+ /* Another red triangle with SOURCE */
+ cairo_move_to (cr, SIZE / 2, SIZE / 2);
+ cairo_rel_line_to (cr, SIZE / 2, 0);
+ cairo_rel_line_to (cr, -SIZE / 2, SIZE / 2);
+ cairo_close_path (cr);
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_set_source_rgba (cr, 1., 0., 0., 0.5); /* 50% red */
+
+ cairo_fill (cr);
+
+ return CAIRO_TEST_SUCCESS;
+}
+
+int
+main (void)
+{
+ return cairo_test (&test);
+}
More information about the cairo-commit
mailing list