From faa4e6761c8f74a1acaa7ccc5bc8bb23b2f5cdb1 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 21 Jun 2010 14:01:34 +0200 Subject: [PATCH] egl: Copy glx code to detect the proper surface in acquire --- src/cairo-egl-context.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cairo-egl-context.c b/src/cairo-egl-context.c index 455160c35..607e3bf47 100644 --- a/src/cairo-egl-context.c +++ b/src/cairo-egl-context.c @@ -62,6 +62,15 @@ static void _egl_acquire (void *abstract_ctx) { cairo_egl_context_t *ctx = abstract_ctx; + EGLSurface current_surface; + + if (ctx->base.current_target == NULL || + _cairo_gl_surface_is_texture (ctx->base.current_target)) { + current_surface = ctx->dummy_surface; + } else { + cairo_egl_surface_t *surface = (cairo_egl_surface_t *) ctx->base.current_target; + current_surface = surface->egl ; + } eglMakeCurrent (ctx->display, ctx->dummy_surface, ctx->dummy_surface, ctx->context);