From f13f63e3d85d28a17a3cb60b7d1a7b552f2b6872 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 10 Dec 2008 08:54:03 +0000 Subject: [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. --- test/clip-nesting.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/clip-nesting.c b/test/clip-nesting.c index a73ac99c..ce03b4b1 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 */ -- cgit v1.2.3