From d83588c0c56b4aa5e642fcd78aa3186203ab37e8 Mon Sep 17 00:00:00 2001 From: YongGeol Jung Date: Wed, 5 Sep 2012 18:34:27 +0900 Subject: [PATCH] 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 --- Source/WebCore/platform/graphics/efl/GraphicsContext3DOffscreen.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.7.4