summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-10-01 12:05:06 +0100
committerNeil Roberts <neil@linux.intel.com>2012-10-01 15:05:22 +0100
commit0edb8488503bf8bb9e22e3f4096b2697680c46e8 (patch)
tree149993ec02d2b9965805daf672e67bc8fc7b278f
parent5e730568d4d36144cc5daa0b9cdbcc4e9b42abc4 (diff)
downloadcogl-0edb8488503bf8bb9e22e3f4096b2697680c46e8.tar.gz
Use the right context when pushing the GLES2 context to an onscreen
Previously when pushing the GLES2 context with an onscreen framebuffer it would just call bind_onscreen. This actually binds it with Cogl's context so presumably the context isolation wasn't working properly. This patch splits out bind_onscreen to have a second function called bind_onscreen_with_context that explicitly takes the EGL context to use. Cogl now uses this when pushing the GLES2 context. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit 3653c5b10058a3f79900eb2644cb30f4cf1ca47e)
-rw-r--r--cogl/winsys/cogl-winsys-egl.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index b87cdf99..5257a631 100644
--- a/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/winsys/cogl-winsys-egl.c
@@ -645,17 +645,17 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen)
}
static CoglBool
-bind_onscreen (CoglOnscreen *onscreen)
+bind_onscreen_with_context (CoglOnscreen *onscreen,
+ EGLContext egl_context)
{
CoglFramebuffer *fb = COGL_FRAMEBUFFER (onscreen);
CoglContext *context = fb->context;
- CoglDisplayEGL *egl_display = context->display->winsys;
CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
CoglBool status = _cogl_winsys_egl_make_current (context->display,
egl_onscreen->egl_surface,
egl_onscreen->egl_surface,
- egl_display->egl_context);
+ egl_context);
if (status)
{
CoglRenderer *renderer = context->display->renderer;
@@ -670,6 +670,16 @@ bind_onscreen (CoglOnscreen *onscreen)
return status;
}
+static CoglBool
+bind_onscreen (CoglOnscreen *onscreen)
+{
+ CoglFramebuffer *fb = COGL_FRAMEBUFFER (onscreen);
+ CoglContext *context = fb->context;
+ CoglDisplayEGL *egl_display = context->display->winsys;
+
+ return bind_onscreen_with_context (onscreen, egl_display->egl_context);
+}
+
static void
_cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
{
@@ -777,9 +787,9 @@ _cogl_winsys_set_gles2_context (CoglGLES2Context *gles2_ctx, GError **error)
if (gles2_ctx->write_buffer &&
cogl_is_onscreen (gles2_ctx->write_buffer))
- {
- status = bind_onscreen (COGL_ONSCREEN (gles2_ctx->write_buffer));
- }
+ status =
+ bind_onscreen_with_context (COGL_ONSCREEN (gles2_ctx->write_buffer),
+ gles2_ctx->winsys);
else
status = _cogl_winsys_egl_make_current (ctx->display,
egl_display->dummy_surface,