[cairo-commit] 2 commits - src/cairo.c test/inverted-clip.c test/Makefile.sources test/reference
Chris Wilson
ickle at kemper.freedesktop.org
Sun Apr 29 04:42:04 PDT 2012
src/cairo.c | 4 +
test/Makefile.sources | 1
test/inverted-clip.c | 56 +++++++++++++++++++++++++++
test/reference/inverted-clip.base.xfail.png |binary
test/reference/inverted-clip.traps.xfail.png |binary
test/reference/inverted-clip.xfail.png |binary
6 files changed, 61 insertions(+)
New commits:
commit d2f740ccbd9c5416a2590e3cca888eecf046c162
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Apr 29 12:38:37 2012 +0100
test: Exercise clip inversion imperfections
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/test/Makefile.sources b/test/Makefile.sources
index 7b66c94..4d48714 100644
--- a/test/Makefile.sources
+++ b/test/Makefile.sources
@@ -163,6 +163,7 @@ test_sources = \
in-fill-trapezoid.c \
invalid-matrix.c \
inverse-text.c \
+ inverted-clip.c \
joins.c \
joins-loop.c \
joins-star.c \
diff --git a/test/inverted-clip.c b/test/inverted-clip.c
new file mode 100644
index 0000000..b05dd6b
--- /dev/null
+++ b/test/inverted-clip.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * 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: Chris Wilson <chris at chris-wilson.co.uk>
+ */
+
+#include "cairo-test.h"
+
+/* An assertion failure found by Rico Tzschichholz */
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+ cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+ cairo_set_source_rgb (cr, 0, 1, 0);
+
+ cairo_arc (cr, 50, 50, 40, 0, 2 * M_PI);
+ cairo_clip_preserve (cr);
+
+ cairo_paint (cr);
+
+ cairo_rectangle (cr, 0, 0, 100, 100);
+ cairo_reset_clip (cr);
+ cairo_clip (cr);
+
+ cairo_paint (cr);
+
+ return CAIRO_TEST_SUCCESS;
+}
+
+CAIRO_TEST (inverted_clip,
+ "Clip + InvertedClip should be opaque",
+ "clip, paint", /* keywords */
+ "target=raster", /* requirements */
+ 100, 100,
+ NULL, draw)
diff --git a/test/reference/inverted-clip.base.xfail.png b/test/reference/inverted-clip.base.xfail.png
new file mode 100644
index 0000000..080b782
Binary files /dev/null and b/test/reference/inverted-clip.base.xfail.png differ
diff --git a/test/reference/inverted-clip.traps.xfail.png b/test/reference/inverted-clip.traps.xfail.png
new file mode 100644
index 0000000..5962795
Binary files /dev/null and b/test/reference/inverted-clip.traps.xfail.png differ
diff --git a/test/reference/inverted-clip.xfail.png b/test/reference/inverted-clip.xfail.png
new file mode 100644
index 0000000..080b782
Binary files /dev/null and b/test/reference/inverted-clip.xfail.png differ
commit 4a9a6b7efb4abb81b228db8c998a6c9e9f383ba0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Apr 29 12:22:20 2012 +0100
Satisfy check-doc-syntax.awk for unimplemented functions
./cairo.c (634): ERROR: cairo_set_opacity: missing 'Since' field
./cairo.c (3578): ERROR: cairo_get_opacity: missing 'Since' field
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/cairo.c b/src/cairo.c
index 82f02b9..82396d2 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -631,6 +631,8 @@ slim_hidden_def (cairo_set_operator);
* using the alpha value.
*
* The default opacity is 1.
+ *
+ * Since: TBD
**/
void
cairo_set_opacity (cairo_t *cr, double opacity)
@@ -3575,6 +3577,8 @@ cairo_get_operator (cairo_t *cr)
* Gets the current compositing opacity for a cairo context.
*
* Return value: the current compositing opacity.
+ *
+ * Since: TBD
**/
double
cairo_get_opacity (cairo_t *cr)
More information about the cairo-commit
mailing list