[cogl] egl: pass EGL_NO_CONTEXT to eglCreateImage for tfp
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl] egl: pass EGL_NO_CONTEXT to eglCreateImage for tfp
- Date: Thu, 28 Jul 2011 19:50:00 +0000 (UTC)
commit 6e6620e089fdb4f0a09f645c8789f7726c22eedf
Author: Robert Bragg <robert linux intel com>
Date: Thu Jul 21 00:52:07 2011 +0100
egl: pass EGL_NO_CONTEXT to eglCreateImage for tfp
When passing the EGL_NATIVE_PIXMAP_KHR target to eglCreateImage the
EGL_KHR_image_pixmap extension explicitly states that EGL_NO_CONTEXT
must also be passed so we are now careful to do this.
Reviewed-by: Neil Roberts <neil linux intel com>
cogl/winsys/cogl-winsys-egl.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index 14de1e3..2c84ff6 100644
--- a/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/winsys/cogl-winsys-egl.c
@@ -1809,11 +1809,21 @@ _cogl_egl_create_image (CoglContext *ctx,
{
CoglDisplayEGL *egl_display = ctx->display->winsys;
CoglRendererEGL *egl_renderer = ctx->display->renderer->winsys;
+ EGLContext egl_ctx;
g_return_val_if_fail (egl_renderer->pf_eglCreateImage, EGL_NO_IMAGE_KHR);
+ /* The EGL_KHR_image_pixmap spec explicitly states that EGL_NO_CONTEXT must
+ * always be used in conjunction with the EGL_NATIVE_PIXMAP_KHR target */
+#ifdef EGL_KHR_image_pixmap
+ if (target == EGL_NATIVE_PIXMAP_KHR)
+ egl_ctx = EGL_NO_CONTEXT;
+ else
+#endif
+ egl_ctx = egl_display->egl_context;
+
return egl_renderer->pf_eglCreateImage (egl_renderer->edpy,
- egl_display->egl_context,
+ egl_ctx,
target,
buffer,
attribs);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]