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=ace0a18ea0082cab1544e31bd7de1701becc9fe7;hpb=8999300d7e1382d64455e0089d012521758cf143;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 ace0a18..2185ed8 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -214,9 +214,13 @@ void CombinedUpdateRenderController::Resume() mRunning = TRUE; mForceClear = TRUE; - } - DALI_LOG_RELEASE_INFO( "CombinedUpdateRenderController::Resume\n" ); + DALI_LOG_RELEASE_INFO( "CombinedUpdateRenderController::Resume\n" ); + } + else + { + DALI_LOG_RELEASE_INFO( "CombinedUpdateRenderController::Resume: Already resumed [%d, %d, %d]\n", mRunning, mUpdateRenderRunCount, mUpdateRenderThreadCanSleep ); + } } void CombinedUpdateRenderController::Stop() @@ -424,8 +428,6 @@ void CombinedUpdateRenderController::UpdateRenderThread() RenderSurfaceInterface* currentSurface = nullptr; -#if DALI_GLES_VERSION >= 30 - GraphicsInterface& graphics = mAdaptorInterfaces.GetGraphicsInterface(); EglGraphics* eglGraphics = static_cast(&graphics); @@ -433,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(); @@ -582,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;