From f5e4308bb09982397e5e88053392fc531247bbe6 Mon Sep 17 00:00:00 2001 From: Sukwon Suh Date: Mon, 27 May 2013 15:19:34 +0900 Subject: [PATCH] modify eglSwapBuffer behavior and fix crash when launching EffectsApp Change-Id: I4119612f066b952be1439b149cf8a4265ef586e4 Signed-off-by: Sukwon Suh --- src/graphics/opengl/FGrpEgl.cpp | 40 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/src/graphics/opengl/FGrpEgl.cpp b/src/graphics/opengl/FGrpEgl.cpp index b41b9b0..855eed8 100644 --- a/src/graphics/opengl/FGrpEgl.cpp +++ b/src/graphics/opengl/FGrpEgl.cpp @@ -170,7 +170,6 @@ public: , height(0) #endif , isBackbuffer(true) - , wasShown(false) , swapDone(false) , isFirstSwap(true) , pSecondSglInfo(null) @@ -241,7 +240,6 @@ public: height = 0; #endif isBackbuffer = true; - wasShown = false; swapDone = false; isFirstSwap = true; pSecondSglInfo = null; @@ -266,7 +264,6 @@ public: int height; #endif bool isBackbuffer; - bool wasShown; bool swapDone; bool isFirstSwap; _SglInfo* pSecondSglInfo; @@ -393,7 +390,6 @@ _OnBoundsChanged(void* pData) pSglInfo->nativePixmap = nativePixmap; pSglInfo->surface = eglSurface; pSglInfo->isBackbuffer = true; - pSglInfo->wasShown = false; pSglInfo->swapDone = false; pSglInfo->isFirstSwap = true; @@ -425,7 +421,6 @@ _OnBoundsChanged(void* pData) pSglInfoSecond->surface = eglSurface; pSglInfoSecond->pBitmap = bitmapSecond.release(); pSglInfoSecond->isBackbuffer = true; - pSglInfoSecond->wasShown = false; pSglInfoSecond->swapDone = true; pSglInfo->isFirstSwap = true; @@ -722,23 +717,9 @@ _GetEvasEngineType(Evas_Object* pObject) { return ENGINE_TYPE_OPENGL_X11; } - else if (engineName.Contains(String("software_x11"))) - { - return ENGINE_TYPE_SOFEWARE_X11; - } else { - pString = elm_config_engine_get(); - String engineName(pString); - SysLog(NID_GRP, "system evas backend : %s", pString); - if (engineName.Contains(String("opengl_x11"))) - { - return ENGINE_TYPE_OPENGL_X11; - } - else - { - return ENGINE_TYPE_SOFEWARE_X11; - } + return ENGINE_TYPE_SOFEWARE_X11; } } else @@ -830,17 +811,18 @@ _PostRenderCallback(Ecore_Evas* ee) pFrontSglInfo = __pPreviousSglInfo; } - if (!pBackSglInfo->wasShown && __pPreviousSglInfo->pVisualElement != null) + if (!pFrontSglInfo->swapDone && __pPreviousSglInfo->pVisualElement != null) { - __pPreviousSglInfo->pVisualElement->SetSurface(pFrontSglInfo->pVisualElementSurface); - evas_object_image_pixels_dirty_set(pFrontSglInfo->pObject, EINA_TRUE); - evas_object_hide(pBackSglInfo->pObject); - - pBackSglInfo->wasShown = true; + pBackSglInfo->isBackbuffer = false; + pFrontSglInfo->isBackbuffer = true; pFrontSglInfo->swapDone = true; + + __pPreviousSglInfo->pVisualElement->SetSurface(pBackSglInfo->pVisualElementSurface); + evas_object_image_pixels_dirty_set(pBackSglInfo->pObject, EINA_TRUE); + evas_object_hide(pFrontSglInfo->pObject); } - surface = pBackSglInfo->surface; + surface = pFrontSglInfo->surface; } EGLBoolean ret = eglMakeCurrent(display, surface, surface, context); @@ -2037,11 +2019,9 @@ _SglSwapBuffers(EGLDisplay dpy, EGLSurface surface) pBackSglInfo = pSglInfo->pSecondSglInfo; pFrontSglInfo = pSglInfo; } - pBackSglInfo->isBackbuffer = false; - pFrontSglInfo->isBackbuffer = true; - pFrontSglInfo->wasShown = false; pFrontSglInfo->swapDone = false; + if (pSglInfo->pVisualElement != null) { pSglInfo->pVisualElement->SetSurface(pFrontSglInfo->pVisualElementSurface); -- 2.7.4