X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fgraphics%2Fgles%2Fegl-implementation.cpp;h=be463f7fab2f0768a05f2669e4bc90f05c7fcd36;hb=cbc41a9b327649c3289cf312dbf39f6160762615;hp=dca3bd01ac484a91141bb6b4d8d265cb95c91cb1;hpb=8999300d7e1382d64455e0089d012521758cf143;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/graphics/gles/egl-implementation.cpp b/dali/internal/graphics/gles/egl-implementation.cpp index dca3bd0..be463f7 100755 --- a/dali/internal/graphics/gles/egl-implementation.cpp +++ b/dali/internal/graphics/gles/egl-implementation.cpp @@ -64,6 +64,7 @@ EglImplementation::EglImplementation( int multiSamplingLevel, mEglConfig( 0 ), mEglContext( 0 ), mCurrentEglSurface( 0 ), + mCurrentEglContext( EGL_NO_CONTEXT ), mMultiSamplingLevel( multiSamplingLevel ), mColorDepth( COLOR_DEPTH_24 ), mGlesInitialized( false ), @@ -201,11 +202,20 @@ void EglImplementation::DestroySurface( EGLSurface& eglSurface ) void EglImplementation::MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext ) { + if (mCurrentEglContext == eglContext) + { + return; + } + mCurrentEglSurface = eglSurface; if(mIsOwnSurface) { + glFinish(); + eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, eglContext ); + + mCurrentEglContext = eglContext; } EGLint error = eglGetError(); @@ -220,12 +230,21 @@ void EglImplementation::MakeContextCurrent( EGLSurface eglSurface, EGLContext eg void EglImplementation::MakeCurrent( EGLNativePixmapType pixmap, EGLSurface eglSurface ) { + if (mCurrentEglContext == mEglContext) + { + return; + } + mCurrentEglNativePixmap = pixmap; mCurrentEglSurface = eglSurface; if(mIsOwnSurface) { + glFinish(); + eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, mEglContext ); + + mCurrentEglContext = mEglContext; } EGLint error = eglGetError(); @@ -242,6 +261,7 @@ void EglImplementation::MakeContextNull() { // clear the current context eglMakeCurrent( mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT ); + mCurrentEglContext = EGL_NO_CONTEXT; } void EglImplementation::TerminateGles() @@ -270,6 +290,7 @@ void EglImplementation::TerminateGles() mEglConfig = NULL; mEglContext = NULL; mCurrentEglSurface = NULL; + mCurrentEglContext = EGL_NO_CONTEXT; mGlesInitialized = false; }