diff options
-rw-r--r-- | src/cairo-gl-composite.c | 2 | ||||
-rw-r--r-- | src/cairo-gl-private.h | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c index 8e3d32e3..76b6da04 100644 --- a/src/cairo-gl-composite.c +++ b/src/cairo-gl-composite.c @@ -1072,6 +1072,8 @@ _cairo_gl_composite_begin (cairo_gl_context_t *ctx, unsigned int dst_size, src_size, mask_size; cairo_status_t status; + assert (! _cairo_gl_context_is_in_progress (ctx)); + /* Do various magic for component alpha */ if (setup->has_component_alpha) { status = _cairo_gl_composite_begin_component_alpha (ctx, setup); diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h index b88751d6..0cdbe732 100644 --- a/src/cairo-gl-private.h +++ b/src/cairo-gl-private.h @@ -221,6 +221,13 @@ _cairo_gl_context_create_in_error (cairo_status_t status) cairo_private cairo_status_t _cairo_gl_context_init (cairo_gl_context_t *ctx); +static cairo_always_inline cairo_bool_t cairo_warn +_cairo_gl_context_is_in_progress (cairo_gl_context_t *ctx) +{ + /* This variable gets set when _begin() is called */ + return ctx->vertex_size != 0; +} + cairo_private void _cairo_gl_surface_init (cairo_device_t *device, cairo_gl_surface_t *surface, |