summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-07-05 22:50:44 +0200
committerBenjamin Otte <otte@redhat.com>2010-07-05 22:50:44 +0200
commit702aa19fdae8bd511c4374f580dde6503afd3341 (patch)
tree97ddbabd81a73e2c9afd547fcf72f041ba45e82a /src
parentb87be76bdfcbd329c79a9f11b24d22010ad15dde (diff)
gl: Fail properly when called with finished functions
Caught by api-special-cases test
Diffstat (limited to 'src')
-rw-r--r--src/cairo-gl-surface.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index a36d7b7a..cfc1f449 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -366,11 +366,16 @@ cairo_gl_surface_set_size (cairo_surface_t *abstract_surface,
if (unlikely (abstract_surface->status))
return;
+ if (unlikely (abstract_surface->finished)) {
+ status = _cairo_surface_set_error (abstract_surface,
+ _cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
+ return;
+ }
if (! _cairo_surface_is_gl (abstract_surface) ||
! _cairo_gl_surface_is_texture (surface)) {
status = _cairo_surface_set_error (abstract_surface,
- CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
+ _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));
return;
}
@@ -408,6 +413,11 @@ cairo_gl_surface_swapbuffers (cairo_surface_t *abstract_surface)
if (unlikely (abstract_surface->status))
return;
+ if (unlikely (abstract_surface->finished)) {
+ status = _cairo_surface_set_error (abstract_surface,
+ _cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
+ return;
+ }
if (! _cairo_surface_is_gl (abstract_surface)) {
status = _cairo_surface_set_error (abstract_surface,