Do not call eglMakeCurrent multiple times.
authorYongGeol Jung <yg48.jung@samsung.com>
Wed, 5 Sep 2012 09:34:27 +0000 (18:34 +0900)
committerYongGeol Jung <yg48.jung@samsung.com>
Thu, 6 Sep 2012 03:05:55 +0000 (12:05 +0900)
[Title] Do not call eglMakeCurrent multiple times.
[Issue#] N/A
[Problem] WebGL performance is very poor on emulator.
[Cause] eglMakeCurrent function was called every time for gl commands.
[Solution] Do not call eglMakeCurrent multiple times.

Change-Id: I5bf02a78ea672d76d2dce5ce5584a003aea3d6f2

Source/WebCore/platform/graphics/efl/GraphicsContext3DOffscreen.cpp

index 9c20962..3e0a631 100755 (executable)
@@ -288,8 +288,10 @@ bool GraphicsContext3DOffscreen::createSurface(Evas_Object* view)
 #if ENABLE(TIZEN_WEBKIT2)
 bool GraphicsContext3DOffscreen::makeContextCurrent() {
 
-    return eglMakeCurrent(m_display, m_surface, m_surface, m_context);
+    if (eglGetCurrentSurface(EGL_READ) == m_surface && eglGetCurrentContext() == m_context)
+        return true;
 
+    return eglMakeCurrent(m_display, m_surface, m_surface, m_context);
 }
 #endif