X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fadaptor%2Fcommon%2Fcombined-update-render-controller.cpp;h=2185ed824d6311fb62f2bddce8eafc69d2bf72ad;hb=02a0b6a8425ee880dcf8e8a4d5dd5b6d79c38fe4;hp=25555a53b7809b69b54ca98785321ddf098231fb;hpb=09e6892adcddf6d2bf7c88dc8442a42da2ac57f5;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 25555a5..2185ed8 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -183,6 +183,8 @@ void CombinedUpdateRenderController::Start() LOG_EVENT( "Startup Complete, starting Update/Render Thread" ); RunUpdateRenderThread( CONTINUOUS, false /* No animation progression */ ); + + DALI_LOG_RELEASE_INFO( "CombinedUpdateRenderController::Start\n" ); } void CombinedUpdateRenderController::Pause() @@ -194,6 +196,8 @@ void CombinedUpdateRenderController::Pause() PauseUpdateRenderThread(); AddPerformanceMarker( PerformanceInterface::PAUSED ); + + DALI_LOG_RELEASE_INFO( "CombinedUpdateRenderController::Pause\n" ); } void CombinedUpdateRenderController::Resume() @@ -210,6 +214,12 @@ void CombinedUpdateRenderController::Resume() mRunning = TRUE; mForceClear = TRUE; + + DALI_LOG_RELEASE_INFO( "CombinedUpdateRenderController::Resume\n" ); + } + else + { + DALI_LOG_RELEASE_INFO( "CombinedUpdateRenderController::Resume: Already resumed [%d, %d, %d]\n", mRunning, mUpdateRenderRunCount, mUpdateRenderThreadCanSleep ); } } @@ -238,6 +248,8 @@ void CombinedUpdateRenderController::Stop() } mRunning = FALSE; + + DALI_LOG_RELEASE_INFO( "CombinedUpdateRenderController::Stop\n" ); } void CombinedUpdateRenderController::RequestUpdate() @@ -416,8 +428,6 @@ void CombinedUpdateRenderController::UpdateRenderThread() RenderSurfaceInterface* currentSurface = nullptr; -#if DALI_GLES_VERSION >= 30 - GraphicsInterface& graphics = mAdaptorInterfaces.GetGraphicsInterface(); EglGraphics* eglGraphics = static_cast(&graphics); @@ -425,22 +435,48 @@ void CombinedUpdateRenderController::UpdateRenderThread() EglInterface* eglInterface = &eglGraphics->GetEglInterface(); Internal::Adaptor::EglImplementation& eglImpl = static_cast( *eglInterface ); - eglImpl.ChooseConfig( true, COLOR_DEPTH_32 ); // Always use this for shared context??? - // Create a surfaceless OpenGL context for shared resources - eglImpl.CreateContext(); - eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() ); + // Try to use OpenGL es 3.0 + // ChooseConfig returns false here when the device only support gles 2.0. + // Because eglChooseConfig with gles 3.0 setting fails when the device only support gles 2.0 and Our default setting is gles 3.0. + if( !eglImpl.ChooseConfig( true, COLOR_DEPTH_32 ) ) + { + // Retry to use OpenGL es 2.0 + eglGraphics->SetGlesVersion( 20 ); + eglImpl.ChooseConfig( true, COLOR_DEPTH_32 ); + } + else + { + if( !eglImpl.CreateContext() ) + { + // Retry to use OpenGL es 2.0 + eglGraphics->SetGlesVersion( 20 ); + eglImpl.ChooseConfig( true, COLOR_DEPTH_32 ); + } + } -#else // DALI_GLES_VERSION >= 30 + // Check whether surfaceless context is supported + bool isSurfacelessContextSupported = eglImpl.IsSurfacelessContextSupported(); + eglGraphics->SetIsSurfacelessContextSupported( isSurfacelessContextSupported ); - currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); - if( currentSurface ) + if ( isSurfacelessContextSupported ) { - currentSurface->InitializeGraphics(); - currentSurface->MakeContextCurrent(); + // Create a surfaceless OpenGL context for shared resources + if( eglImpl.GetContext() == 0 ) + { + eglImpl.CreateContext(); + } + eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() ); + } + else + { + currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); + if( currentSurface ) + { + currentSurface->InitializeGraphics(); + currentSurface->MakeContextCurrent(); + } } - -#endif // Tell core it has a context mCore.ContextCreated(); @@ -574,10 +610,11 @@ void CombinedUpdateRenderController::UpdateRenderThread() } } -#if DALI_GLES_VERSION >= 30 - // Make the shared surfaceless context as current before rendering - eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() ); -#endif + if( eglImpl.IsSurfacelessContextSupported() ) + { + // Make the shared surfaceless context as current before rendering + eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() ); + } Integration::RenderStatus renderStatus;