From: YongGeol Jung Date: Wed, 5 Sep 2012 09:34:27 +0000 (+0900) Subject: Do not call eglMakeCurrent multiple times. X-Git-Tag: 2.0_alpha~41^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d83588c0c56b4aa5e642fcd78aa3186203ab37e8;p=framework%2Fweb%2Fwebkit-efl.git Do not call eglMakeCurrent multiple times. [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 --- diff --git a/Source/WebCore/platform/graphics/efl/GraphicsContext3DOffscreen.cpp b/Source/WebCore/platform/graphics/efl/GraphicsContext3DOffscreen.cpp index 9c20962..3e0a631 100755 --- a/Source/WebCore/platform/graphics/efl/GraphicsContext3DOffscreen.cpp +++ b/Source/WebCore/platform/graphics/efl/GraphicsContext3DOffscreen.cpp @@ -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