gl: Flush context upon evicting a gradient

As the random selection of a gradient can possible destroy the currently
active gradient, we need to flush the context in order to flush any
references to the texture before deletion.
This commit is contained in:
Henry Song 2012-12-01 17:08:56 +00:00 committed by Chris Wilson
parent a0fb139131
commit 9f43f096b2

View file

@ -328,6 +328,8 @@ _cairo_gl_gradient_destroy (cairo_gl_gradient_t *gradient)
return;
if (_cairo_gl_context_acquire (gradient->device, &ctx) == CAIRO_STATUS_SUCCESS) {
/* The gradient my still be active in the last operation, so flush */
_cairo_gl_composite_flush (ctx);
glDeleteTextures (1, &gradient->tex);
ignore = _cairo_gl_context_release (ctx, CAIRO_STATUS_SUCCESS);
}