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";
mDepthBufferRequired( depthBufferRequired == Integration::DepthBufferAvailable::TRUE ),
mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE ),
mIsSurfacelessContextSupported( false ),
- mIsKhrCreateContextSupported( false )
+ mIsKhrCreateContextSupported( false ),
+ mSwapBufferCountAfterResume( 0 )
{
}
}
eglBindAPI(EGL_OPENGL_ES_API);
- mGlesInitialized = true;
mIsOwnSurface = isOwnSurface;
}
}
}
+ mGlesInitialized = true;
+
// We want to display this information all the time, so use the LogMessage directly
Integration::Log::LogMessage(Integration::Log::DebugInfo, "EGL Information\n"
" Vendor: %s\n"
if(mIsOwnSurface)
{
- if( mCurrentEglContext != EGL_NO_CONTEXT )
- {
- glFinish();
- }
-
eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, eglContext );
mCurrentEglContext = eglContext;
if(mIsOwnSurface)
{
- if( mCurrentEglContext != EGL_NO_CONTEXT )
- {
- glFinish();
- }
-
eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, mEglContext );
mCurrentEglContext = mEglContext;
{
if ( eglSurface != EGL_NO_SURFACE ) // skip if using surfaceless context
{
+#ifndef DALI_PROFILE_UBUNTU
+ if( mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT )
+ {
+ 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
}
}
return true;
}
- bool isTransparent = ( depth == COLOR_DEPTH_32 );
-
mColorDepth = depth;
mIsWindow = isWindowType;
configAttribs.PushBack( EGL_BLUE_SIZE );
configAttribs.PushBack( 8 );
- if ( isTransparent )
- {
- configAttribs.PushBack( EGL_ALPHA_SIZE );
-#ifdef _ARCH_ARM_
- // For underlay video playback, we also need to set the alpha value of the 24/32bit window.
- configAttribs.PushBack( 8 );
-#else
- // There is a bug in the desktop emulator
- // setting EGL_ALPHA_SIZE to 8 results in eglChooseConfig failing
- configAttribs.PushBack( 8 );
-#endif // _ARCH_ARM_
- }
+// For underlay video playback, we also need to set the alpha value of the 24/32bit window.
+ configAttribs.PushBack( EGL_ALPHA_SIZE );
+ configAttribs.PushBack( 8 );
configAttribs.PushBack( EGL_DEPTH_SIZE );
configAttribs.PushBack( mDepthBufferRequired ? 24 : 0 );
// 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 );
mGlesVersion = glesVersion;
}
+void EglImplementation::SetFirstFrameAfterResume()
+{
+ mSwapBufferCountAfterResume = 0;
+}
+
EGLDisplay EglImplementation::GetDisplay() const
{
return mEglDisplay;
return mIsSurfacelessContextSupported;
}
+void EglImplementation::WaitClient()
+{
+ // Wait for EGL to finish executing all rendering calls for the current context
+ if ( eglWaitClient() != EGL_TRUE )
+ {
+ TEST_EGL_ERROR("eglWaitClient");
+ }
+}
+
} // namespace Adaptor
} // namespace Internal