[gl] Move check for vertex buffer support to individual operations.

As we can fallback instead of using vertex buffers, do so rather than
preventing any use of GL acceleration.
This commit is contained in:
Chris Wilson 2009-07-28 13:44:19 +01:00
parent 90657bacc3
commit a251e34dbb
2 changed files with 12 additions and 8 deletions

View file

@ -343,6 +343,9 @@ _cairo_gl_surface_show_glyphs (void *abstract_dst,
cairo_gl_composite_setup_t composite_setup;
GLuint vbo = 0;
if (! GLEW_ARB_vertex_buffer_object)
return CAIRO_INT_STATUS_UNSUPPORTED;
if (! _cairo_gl_operator_is_supported (op))
return CAIRO_INT_STATUS_UNSUPPORTED;

View file

@ -93,15 +93,12 @@ _cairo_gl_context_init (cairo_gl_context_t *ctx)
if (glewInit () != GLEW_OK)
return _cairo_error (CAIRO_STATUS_INVALID_FORMAT); /* XXX */
if (! GLEW_ARB_vertex_buffer_object ||
! GLEW_EXT_framebuffer_object ||
if (! GLEW_EXT_framebuffer_object ||
! GLEW_ARB_texture_env_combine ||
! GLEW_ARB_texture_non_power_of_two)
{
fprintf (stderr,
"Required GL extensions not available:\n");
if (! GLEW_ARB_vertex_buffer_object)
fprintf (stderr, " GL_ARB_vertex_buffer_object\n");
if (! GLEW_EXT_framebuffer_object)
fprintf (stderr, " GL_EXT_framebuffer_object\n");
if (! GLEW_ARB_texture_env_combine)
@ -1775,7 +1772,14 @@ _cairo_gl_surface_check_span_renderer (cairo_operator_t op,
cairo_antialias_t antialias,
const cairo_composite_rectangles_t *rects)
{
return _cairo_gl_operator_is_supported (op);
if (! _cairo_gl_operator_is_supported (op))
return FALSE;
if (! GLEW_ARB_vertex_buffer_object)
return FALSE;
return TRUE;
(void) pattern;
(void) abstract_dst;
(void) antialias;
@ -1881,9 +1885,6 @@ _cairo_gl_surface_create_span_renderer (cairo_operator_t op,
cairo_surface_attributes_t *src_attributes;
GLenum err;
if (!GLEW_ARB_vertex_buffer_object)
return _cairo_span_renderer_create_in_error (CAIRO_INT_STATUS_UNSUPPORTED);
renderer = calloc (1, sizeof (*renderer));
if (unlikely (renderer == NULL))
return _cairo_span_renderer_create_in_error (CAIRO_STATUS_NO_MEMORY);