void _cairo_gl_context_reset (cairo_gl_context_t *ctx)
{
+ cairo_gl_shader_t *shader = ctx->current_shader;
+ /* reset current shader, this is because if cairo shares a same
+ * context other extern libraries or applications, the current
+ * program may well be changed, in this case, we must set cairo
+ * to use cairo program
+ */
+ ctx->current_shader = NULL;
+ if (shader)
+ _cairo_gl_set_shader (ctx, shader);
+
ctx->states_cache.viewport_box.width = 0;
ctx->states_cache.viewport_box.height = 0;
/* FIXME: this is hack to fix mali driver */
ctx->dispatch.Disable (GL_DITHER);
- ctx->current_shader = NULL;
-
ctx->states_cache.bound_vbo = 0;
ctx->states_cache.bound_vao = 0;
ctx->states_cache.bound_ibo = 0;