namespace
{
+ const uint32_t THRESHOLD_SWAPBUFFER_COUNT = 5;
const uint32_t CHECK_EXTENSION_NUMBER = 2;
const std::string EGL_KHR_SURFACELESS_CONTEXT = "EGL_KHR_surfaceless_context";
const std::string EGL_KHR_CREATE_CONTEXT = "EGL_KHR_create_context";
mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE ),
mIsSurfacelessContextSupported( false ),
mIsKhrCreateContextSupported( false ),
- mIsFirstFrameAfterResume( false )
+ mSwapBufferCountAfterResume( 0 )
{
}
{
if ( eglSurface != EGL_NO_SURFACE ) // skip if using surfaceless context
{
- if( mIsFirstFrameAfterResume )
+#ifndef DALI_PROFILE_UBUNTU
+ if( mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT )
{
- DALI_LOG_RELEASE_INFO( "EglImplementation::SwapBuffers: First SwapBuffers call.\n" );
- mIsFirstFrameAfterResume = false;
+ DALI_LOG_RELEASE_INFO( "EglImplementation::SwapBuffers started.\n" );
}
+#endif //DALI_PROFILE_UBUNTU
+
eglSwapBuffers( mEglDisplay, eglSurface );
+
+#ifndef DALI_PROFILE_UBUNTU
+ if( mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT )
+ {
+ DALI_LOG_RELEASE_INFO( "EglImplementation::SwapBuffers finished.\n" );
+ mSwapBufferCountAfterResume++;
+ }
+#endif //DALI_PROFILE_UBUNTU
}
}
// the surface is bound to the context, so set the context to null
MakeContextNull();
- // destroy the surface
- DestroySurface( eglSurface );
+ if( eglSurface )
+ {
+ // destroy the surface
+ DestroySurface( eglSurface );
+ }
// create the EGL surface
EGLSurface newEglSurface = CreateSurfaceWindow( window, mColorDepth );
void EglImplementation::SetFirstFrameAfterResume()
{
- mIsFirstFrameAfterResume = true;
+ mSwapBufferCountAfterResume = 0;
}
EGLDisplay EglImplementation::GetDisplay() const