[cairo-commit] 2 commits - src/cairo-egl-context.c

Benjamin Otte company at kemper.freedesktop.org
Tue Jun 22 11:21:31 PDT 2010


 src/cairo-egl-context.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit faa4e6761c8f74a1acaa7ccc5bc8bb23b2f5cdb1
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jun 21 14:01:34 2010 +0200

    egl: Copy glx code to detect the proper surface in acquire

diff --git a/src/cairo-egl-context.c b/src/cairo-egl-context.c
index 455160c..607e3bf 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);
commit 76a721f7e94fb040f106b200c09c1a7b9ae83d36
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jun 21 13:30:06 2010 +0200

    egl: Remove unused prev_foo usage

diff --git a/src/cairo-egl-context.c b/src/cairo-egl-context.c
index 10db128..455160c 100644
--- a/src/cairo-egl-context.c
+++ b/src/cairo-egl-context.c
@@ -48,9 +48,6 @@ typedef struct _cairo_egl_context {
     EGLDisplay display;
     EGLContext context;
 
-    EGLContext prev_context;
-    EGLSurface prev_draw_surface;
-    EGLSurface prev_read_surface;
     EGLSurface dummy_surface;
 } cairo_egl_context_t;
 
@@ -66,10 +63,6 @@ _egl_acquire (void *abstract_ctx)
 {
     cairo_egl_context_t *ctx = abstract_ctx;
 
-    ctx->prev_context = eglGetCurrentContext ();
-    ctx->prev_draw_surface = eglGetCurrentSurface (EGL_DRAW);
-    ctx->prev_read_surface = eglGetCurrentSurface (EGL_READ);
-
     eglMakeCurrent (ctx->display,
 		    ctx->dummy_surface, ctx->dummy_surface, ctx->context);
 }


More information about the cairo-commit mailing list