X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fadaptor%2Fcommon%2Fcombined-update-render-controller.cpp;h=5c11f022ccf340450b2df2a8cb66c0ab8ffd4516;hb=6206c977d8ec33445d0fa948886b214bee02214d;hp=ace0a18ea0082cab1544e31bd7de1701becc9fe7;hpb=a9f25d7a780039fc928c0bd0e999285a9072f632;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..5c11f02 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -424,8 +424,6 @@ void CombinedUpdateRenderController::UpdateRenderThread() RenderSurfaceInterface* currentSurface = nullptr; -#if DALI_GLES_VERSION >= 30 - GraphicsInterface& graphics = mAdaptorInterfaces.GetGraphicsInterface(); EglGraphics* eglGraphics = static_cast(&graphics); @@ -433,22 +431,36 @@ 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 // 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 + 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 +594,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;