From: Heeyong Song Date: Wed, 29 Jul 2020 06:41:45 +0000 (+0900) Subject: Change the timing of Context::GlContextCreated() X-Git-Tag: dali_1.9.24~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F14%2F239714%2F2;p=platform%2Fcore%2Fuifw%2Fdali-core.git Change the timing of Context::GlContextCreated() It should be called after eglMakeCurrent(). Change-Id: I88e06e443ee50c24dbfdc2a45beea66af7a1c53c --- diff --git a/dali/internal/render/common/render-manager.cpp b/dali/internal/render/common/render-manager.cpp index 504d6b9..3ec8755 100644 --- a/dali/internal/render/common/render-manager.cpp +++ b/dali/internal/render/common/render-manager.cpp @@ -151,10 +151,6 @@ struct RenderManager::Impl Context* CreateSceneContext() { Context* context = new Context( glAbstraction ); - - //TODO: Need eglMakeCurrent first - context->GlContextCreated(); - sceneContextContainer.PushBack( context ); return context; } @@ -174,8 +170,6 @@ struct RenderManager::Impl Context* newContext = new Context( glAbstraction ); oldSceneContext->GlContextDestroyed(); - //TODO: Need eglMakeCurrent first - newContext->GlContextCreated(); std::replace( sceneContextContainer.begin(), sceneContextContainer.end(), oldSceneContext, newContext ); return newContext; @@ -909,7 +903,8 @@ void RenderManager::RenderScene( Integration::RenderStatus& status, Integration: surfaceRect = Rect( 0, 0, static_cast( scene.GetSize().width ), static_cast( scene.GetSize().height ) ); } - DALI_ASSERT_DEBUG( mImpl->currentContext->IsGlContextCreated() ); + // Make sure that GL context must be created + mImpl->currentContext->GlContextCreated(); // reset the program matrices for all programs once per frame // this ensures we will set view and projection matrix once per program per camera diff --git a/dali/internal/render/gl-resources/context.cpp b/dali/internal/render/gl-resources/context.cpp index e045136..0cdc6f0 100644 --- a/dali/internal/render/gl-resources/context.cpp +++ b/dali/internal/render/gl-resources/context.cpp @@ -119,16 +119,17 @@ void Context::GlContextCreated() { DALI_LOG_INFO(gContextLogFilter, Debug::Verbose, "Context::GlContextCreated()\n"); - DALI_ASSERT_DEBUG(!mGlContextCreated); - - mGlContextCreated = true; + if( !mGlContextCreated ) + { + mGlContextCreated = true; - // Set the initial GL state, and check it. - InitializeGlState(); + // Set the initial GL state, and check it. + InitializeGlState(); #ifdef DEBUG_ENABLED - PrintCurrentState(); + PrintCurrentState(); #endif + } } void Context::GlContextDestroyed()