Evas GL: Restore viewport and scissor test for GLESv1
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 24 Feb 2015 13:18:53 +0000 (22:18 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 24 Feb 2015 13:18:53 +0000 (22:18 +0900)
This is necessary when switching back to direct rendering.
But I suspect there are other corner cases that we didn't spot.

src/modules/evas/engines/gl_common/evas_gl_api_gles1.c
src/modules/evas/engines/gl_common/evas_gl_core.c
src/modules/evas/engines/gl_common/evas_gl_core_private.h

index fbc5449..82eff93 100644 (file)
@@ -1744,6 +1744,11 @@ _evgl_gles1_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
                   _gles1_api.glViewport(nc[0], nc[1], nc[2], nc[3]);
                }
 
+             ctx->viewport_direct[0] = nc[0];
+             ctx->viewport_direct[1] = nc[1];
+             ctx->viewport_direct[2] = nc[2];
+             ctx->viewport_direct[3] = nc[3];
+
              // Keep a copy of the original coordinates
              ctx->viewport_coord[0] = x;
              ctx->viewport_coord[1] = y;
index e974f1f..d79e38f 100644 (file)
@@ -2235,8 +2235,6 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
         if (_evgl_direct_renderable(rsc, sfc))
           {
              // Transition from pixmap surface rendering to direct rendering
-             /*
-              * TODO:
              if (!rsc->direct.rendered)
                {
                   // Restore viewport and scissor test to direct rendering mode
@@ -2244,7 +2242,6 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
                   if ((ctx->direct_scissor) && (!ctx->scissor_enabled))
                     glEnable(GL_SCISSOR_TEST);
                }
-              */
              if (dbg) DBG("sfc %p is direct renderable.", sfc);
              rsc->direct.rendered = 1;
           }
index abb83ab..9cdefc4 100644 (file)
@@ -172,6 +172,7 @@ struct _EVGL_Context
 
    int          scissor_coord[4];
    int          viewport_coord[4];
+   int          viewport_direct[4];
 
    // For GLES1 with indirect rendering
    EVGLNative_Context gles1_context;