[cairo] [PATCH 1/3] gl: Fail if GL implementation doesn't support shaders

Alexandros Frantzis alexandros.frantzis at linaro.org
Fri Jan 28 05:02:52 PST 2011


---
 src/cairo-gl-shaders.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c
index 2b31bfc..6a42fd1 100644
--- a/src/cairo-gl-shaders.c
+++ b/src/cairo-gl-shaders.c
@@ -359,9 +359,15 @@ _cairo_gl_context_init_shaders (cairo_gl_context_t *ctx)
 	(_cairo_gl_has_extension ("GL_ARB_shader_objects") &&
 	 _cairo_gl_has_extension ("GL_ARB_fragment_shader") &&
 	 _cairo_gl_has_extension ("GL_ARB_vertex_shader")))
+    {
 	ctx->shader_impl = &shader_impl_core_2_0;
+    }
     else
+    {
 	ctx->shader_impl = NULL;
+	fprintf (stderr, "Error: The cairo gl backend requires shader support!\n");
+	return CAIRO_STATUS_DEVICE_ERROR;
+    }
 
     memset (ctx->vertex_shaders, 0, sizeof (ctx->vertex_shaders));
 
-- 
1.7.2.3



More information about the cairo mailing list