summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-05-08 15:09:39 +0200
committerBenjamin Otte <otte@redhat.com>2010-05-08 15:09:39 +0200
commit59b31aeed9b3ec2a1ac6da188ef5e86d20626662 (patch)
treef436e4f6f46373d814d30435155743e13694080e
parent81f4dd65a32efae645b826b84e8382f7bf7a9b2d (diff)
gl: Make check_span_renderer() call not require a device lock
Note that we didn't lock the device previously, so the function was broken.
-rw-r--r--src/cairo-gl-device.c1
-rw-r--r--src/cairo-gl-private.h7
-rw-r--r--src/cairo-gl-surface.c5
3 files changed, 11 insertions, 2 deletions
diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c
index 3d121e98..0a8a74fd 100644
--- a/src/cairo-gl-device.c
+++ b/src/cairo-gl-device.c
@@ -139,6 +139,7 @@ _cairo_gl_context_init (cairo_gl_context_t *ctx)
else
ctx->tex_target = GL_TEXTURE_2D;
+ ctx->has_span_renderer = GLEW_ARB_vertex_buffer_object;
if (GLEW_VERSION_2_0 ||
(GLEW_ARB_fragment_shader &&
diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h
index c0d9c62c..b3085988 100644
--- a/src/cairo-gl-private.h
+++ b/src/cairo-gl-private.h
@@ -124,6 +124,7 @@ typedef struct _cairo_gl_context {
GLint max_texture_size;
GLenum tex_target;
cairo_bool_t using_glsl;
+ cairo_bool_t has_span_renderer;
cairo_gl_shader_program_t fill_rectangles_shader;
cairo_gl_shader_program_t shaders[CAIRO_GL_SHADER_SOURCE_COUNT]
@@ -230,6 +231,12 @@ _cairo_gl_device_has_glsl (cairo_device_t *device)
return ((cairo_gl_context_t *) device)->using_glsl;
}
+static cairo_always_inline cairo_bool_t
+cairo_gl_device_check_span_renderer (cairo_device_t *device)
+{
+ return ((cairo_gl_context_t *) device)->has_span_renderer;
+}
+
static cairo_always_inline cairo_status_t cairo_warn
_cairo_gl_context_acquire (cairo_device_t *device,
cairo_gl_context_t **ctx)
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index f4bae565..5e71b2fd 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -2770,16 +2770,17 @@ _cairo_gl_surface_check_span_renderer (cairo_operator_t op,
void *abstract_dst,
cairo_antialias_t antialias)
{
+ cairo_surface_t *surface = abstract_dst;
+
if (! _cairo_gl_operator_is_supported (op))
return FALSE;
- if (! GLEW_ARB_vertex_buffer_object)
+ if (! cairo_gl_device_check_span_renderer (surface->device))
return FALSE;
return TRUE;
(void) pattern;
- (void) abstract_dst;
(void) antialias;
}