mEglConfig( 0 ),
mEglContext( 0 ),
mCurrentEglSurface( 0 ),
+ mCurrentEglContext( EGL_NO_CONTEXT ),
mMultiSamplingLevel( multiSamplingLevel ),
mColorDepth( COLOR_DEPTH_24 ),
mGlesInitialized( false ),
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();
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();
{
// clear the current context
eglMakeCurrent( mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );
+ mCurrentEglContext = EGL_NO_CONTEXT;
}
void EglImplementation::TerminateGles()
mEglConfig = NULL;
mEglContext = NULL;
mCurrentEglSurface = NULL;
+ mCurrentEglContext = EGL_NO_CONTEXT;
mGlesInitialized = false;
}