diff options
author | Benjamin Otte <otte@redhat.com> | 2010-05-17 13:56:22 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-05-17 18:53:22 +0200 |
commit | e7c5b4f79fa24b75026c93bc9244115d2ee23930 (patch) | |
tree | 0bae1608180dc5e811ddc799d0e28c90b649a5bf | |
parent | 145db7a427e594f1d68a6c0f4afe5e365e219cf0 (diff) |
gl: make _set_mask() accept NULL
That way, it can be used to unset the mask.
-rw-r--r-- | src/cairo-gl-composite.c | 3 | ||||
-rw-r--r-- | src/cairo-gl-surface.c | 14 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c index 98e52f9e..8491821b 100644 --- a/src/cairo-gl-composite.c +++ b/src/cairo-gl-composite.c @@ -511,6 +511,9 @@ _cairo_gl_composite_set_mask (cairo_gl_context_t *ctx, { _cairo_gl_operand_destroy (&setup->mask); setup->has_component_alpha = pattern && pattern->has_component_alpha; + if (pattern == NULL) + return CAIRO_STATUS_SUCCESS; + return _cairo_gl_operand_init (ctx, &setup->mask, pattern, setup->dst, src_x, src_y, diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c index b5f33e33..9592534c 100644 --- a/src/cairo-gl-surface.c +++ b/src/cairo-gl-surface.c @@ -984,14 +984,12 @@ _cairo_gl_surface_composite (cairo_operator_t op, if (unlikely (status)) goto CLEANUP; - if (mask != NULL) { - status = _cairo_gl_composite_set_mask (ctx, &setup, mask, - mask_x, mask_y, - dst_x, dst_y, - width, height); - if (unlikely (status)) - goto CLEANUP; - } + status = _cairo_gl_composite_set_mask (ctx, &setup, mask, + mask_x, mask_y, + dst_x, dst_y, + width, height); + if (unlikely (status)) + goto CLEANUP; status = _cairo_gl_composite_begin (ctx, &setup); if (unlikely (status)) |