From: "Sung W. Park" <sungwoo@gmail.com>
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 21 Apr 2011 09:23:42 +0000 (09:23 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 21 Apr 2011 09:23:42 +0000 (09:23 +0000)
(part of the evas-gl work)

the patch basically checks to see if the current context is evas' gl context
and if it is, it'll call evas_gl_common_context_flush().  I think this
is the proper

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@58786 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/engines/gl_x11/evas_engine.c

index 83dfd19..8fb7adb 100644 (file)
@@ -2457,6 +2457,24 @@ eng_gl_make_current(void *data, void *surface, void *context)
    sfc = (Render_Engine_GL_Surface*)surface;
    ctx = (Render_Engine_GL_Context*)context;
 
+   if (re->win)
+     {
+#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+        if ((eglGetCurrentContext() == re->win->egl_context[0]) ||
+            (eglGetCurrentSurface(EGL_READ) == re->win->egl_surface[0]) ||
+            (eglGetCurrentSurface(EGL_DRAW) == re->win->egl_surface[0]))
+          {
+             evas_gl_common_context_use(re->win->gl_context);
+             evas_gl_common_context_flush(re->win->gl_context);
+          }
+#else
+        if (glXGetCurrentContext() == re->win->context)
+          {
+             evas_gl_common_context_use(re->win->gl_context);
+             evas_gl_common_context_flush(re->win->gl_context);
+          }
+#endif   
+     }
 
    if ((!sfc) || (!ctx))
      {