summaryrefslogtreecommitdiff
path: root/test/clip-nesting.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-12-10 08:54:03 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-12-12 11:11:49 +0000
commitf13f63e3d85d28a17a3cb60b7d1a7b552f2b6872 (patch)
tree90b68d22d9f9bb954ddb51e6c3af8d4f6f103142 /test/clip-nesting.c
parente6e33b036f9de5087a72cf1de9c0a4ce97c75812 (diff)
downloadcairo-f13f63e3d85d28a17a3cb60b7d1a7b552f2b6872.tar.gz
[test/clip-nesting] Propagate status from sub-context.
Use cairo_path_append() to propagate an error status from a child context to it parent so that it is properly reported under memfault.
Diffstat (limited to 'test/clip-nesting.c')
-rw-r--r--test/clip-nesting.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/clip-nesting.c b/test/clip-nesting.c
index a73ac99c8..ce03b4b18 100644
--- a/test/clip-nesting.c
+++ b/test/clip-nesting.c
@@ -31,6 +31,19 @@
#define BORDER 10
#define LINE_WIDTH 20
+static void
+_propagate_status (cairo_t *dst, cairo_t *src)
+{
+ cairo_path_t path;
+
+ path.status = cairo_status (src);
+ if (path.status) {
+ path.num_data = 0;
+ path.data = NULL;
+ cairo_append_path (dst, &path);
+ }
+}
+
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
@@ -70,7 +83,10 @@ draw (cairo_t *cr, int width, int height)
LINE_WIDTH, SIZE - 2 * BORDER);
cairo_fill (cr3);
+ _propagate_status (cr, cr3);
cairo_destroy (cr3);
+
+ _propagate_status (cr, cr2);
cairo_destroy (cr2);
/* And doesn't affect anything after this cairo_t is destroyed */