X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fgraphics%2Fgles%2Fegl-implementation.cpp;h=c653ab609adee5a057f3b5e9b99467d1628bb596;hb=ba73d31ff2edf8662acfcc9a44f145af07bbadb3;hp=3885134d5cd7d3ab3db00fc7881113a2bc06b39b;hpb=1f5c66d0dc2af7a70e44a92ffa1b2965ead59e57;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 3885134..c653ab6 100755 --- a/dali/internal/graphics/gles/egl-implementation.cpp +++ b/dali/internal/graphics/gles/egl-implementation.cpp @@ -35,6 +35,7 @@ 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"; @@ -81,7 +82,8 @@ EglImplementation::EglImplementation( int multiSamplingLevel, mDepthBufferRequired( depthBufferRequired == Integration::DepthBufferAvailable::TRUE ), mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE ), mIsSurfacelessContextSupported( false ), - mIsKhrCreateContextSupported( false ) + mIsKhrCreateContextSupported( false ), + mSwapBufferCountAfterResume( 0 ) { } @@ -113,7 +115,6 @@ bool EglImplementation::InitializeGles( EGLNativeDisplayType display, bool isOwn } eglBindAPI(EGL_OPENGL_ES_API); - mGlesInitialized = true; mIsOwnSurface = isOwnSurface; } @@ -136,6 +137,8 @@ bool EglImplementation::InitializeGles( EGLNativeDisplayType display, bool isOwn } } + 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" @@ -310,7 +313,22 @@ void EglImplementation::SwapBuffers( EGLSurface& eglSurface ) { 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 } } @@ -505,8 +523,11 @@ bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window, EGLSur // 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 ); @@ -536,6 +557,11 @@ void EglImplementation::SetGlesVersion( const int32_t glesVersion ) mGlesVersion = glesVersion; } +void EglImplementation::SetFirstFrameAfterResume() +{ + mSwapBufferCountAfterResume = 0; +} + EGLDisplay EglImplementation::GetDisplay() const { return mEglDisplay;