From: raster Date: Wed, 6 Apr 2011 10:11:01 +0000 (+0000) Subject: and now REALLY fix that viewport bug... X-Git-Tag: submit/trunk/20120815.174732~1743 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=796208d2edfb03f0523b732dbeb9ed217e1c723f;p=profile%2Fivi%2Fevas.git and now REALLY fix that viewport bug... git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@58386 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/modules/engines/gl_common/evas_gl_context.c b/src/modules/engines/gl_common/evas_gl_context.c index c28d836..8fdbc7a 100644 --- a/src/modules/engines/gl_common/evas_gl_context.c +++ b/src/modules/engines/gl_common/evas_gl_context.c @@ -848,7 +848,7 @@ evas_gl_common_context_use(Evas_Engine_GL_Context *gc) { if (_evas_gl_common_context == gc) return; _evas_gl_common_context = gc; - _evas_gl_common_viewport_set(gc); + if (gc) _evas_gl_common_viewport_set(gc); } void diff --git a/src/modules/engines/gl_x11/evas_engine.c b/src/modules/engines/gl_x11/evas_engine.c index ae4c303..cfd35ae 100644 --- a/src/modules/engines/gl_x11/evas_engine.c +++ b/src/modules/engines/gl_x11/evas_engine.c @@ -423,6 +423,7 @@ eng_setup(Evas *e, void *in) re->info->indirect, re->info->info.destination_alpha, re->info->info.rotation); + eng_window_use(re->win); if (re->win) gl_wins++; if ((re->win) && (inc)) re->win->gl_context->references--; diff --git a/src/modules/engines/gl_x11/evas_x_main.c b/src/modules/engines/gl_x11/evas_x_main.c index acdc26b..24e2fa6 100644 --- a/src/modules/engines/gl_x11/evas_x_main.c +++ b/src/modules/engines/gl_x11/evas_x_main.c @@ -214,7 +214,6 @@ eng_window_new(Display *disp, eng_window_free(gw); return NULL; } - _evas_gl_x11_window = gw; vendor = glGetString(GL_VENDOR); renderer = glGetString(GL_RENDERER); @@ -500,7 +499,6 @@ eng_window_new(Display *disp, } } #endif - _evas_gl_x11_window = gw; gw->gl_context = evas_gl_common_context_new(); if (!gw->gl_context) @@ -511,7 +509,7 @@ eng_window_new(Display *disp, #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) gw->gl_context->egldisp = gw->egl_disp; #endif - evas_gl_common_context_use(gw->gl_context); + eng_window_use(gw); evas_gl_common_context_resize(gw->gl_context, w, h, rot); gw->surf = 1; return gw; @@ -525,13 +523,13 @@ eng_window_free(Evas_GL_X11_Window *gw) eng_window_use(gw); if (gw == _evas_gl_x11_window) _evas_gl_x11_window = NULL; if (gw->gl_context) - { - ref = gw->gl_context->references - 1; - evas_gl_common_context_free(gw->gl_context); - } + { + ref = gw->gl_context->references - 1; + evas_gl_common_context_free(gw->gl_context); + } #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) if (gw->egl_surface[0] != EGL_NO_SURFACE) - eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); + eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); if (ref == 0) { if (context) eglDestroyContext(gw->egl_disp, context); @@ -539,7 +537,6 @@ eng_window_free(Evas_GL_X11_Window *gw) context = EGL_NO_CONTEXT; } eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - evas_gl_common_context_use(NULL); #else if (gw->glxwin) glXDestroyWindow(gw->disp, gw->glxwin); if (ref == 0) @@ -581,7 +578,10 @@ eng_window_use(Evas_GL_X11_Window *gw) if ((_evas_gl_x11_window != gw) || (force_use)) { if (_evas_gl_x11_window) - evas_gl_common_context_flush(_evas_gl_x11_window->gl_context); + { + evas_gl_common_context_use(_evas_gl_x11_window->gl_context); + evas_gl_common_context_flush(_evas_gl_x11_window->gl_context); + } _evas_gl_x11_window = gw; if (gw) { @@ -637,7 +637,6 @@ eng_window_unsurf(Evas_GL_X11_Window *gw) eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); gw->egl_surface[0] = EGL_NO_SURFACE; _evas_gl_x11_window = NULL; - evas_gl_common_context_use(NULL); } #else if (gw->glxwin)