mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-24 23:00:09 +01:00
[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.
This commit is contained in:
parent
e6e33b036f
commit
f13f63e3d8
1 changed files with 16 additions and 0 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue