X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fcommon%2Fcore-impl.cpp;h=863c7e5b63f340a0e9a0a5da85cff2e7d8d78d34;hb=b43741a90b40ca9dfbd33d6a9d390d3c09230e89;hp=1a099479784ceeb5bef633cd4a0bc09d578533db;hpb=117e63ce5de8e13f1cd932937d6ca19d0e723c88;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/common/core-impl.cpp b/dali/internal/common/core-impl.cpp old mode 100644 new mode 100755 index 1a09947..863c7e5 --- a/dali/internal/common/core-impl.cpp +++ b/dali/internal/common/core-impl.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -75,6 +76,7 @@ using Integration::RenderController; using Integration::PlatformAbstraction; using Integration::GlSyncAbstraction; using Integration::GlAbstraction; +using Integration::GlContextHelperAbstraction; using Integration::Event; using Integration::UpdateStatus; using Integration::RenderStatus; @@ -83,10 +85,12 @@ Core::Core( RenderController& renderController, PlatformAbstraction& platform, GlAbstraction& glAbstraction, GlSyncAbstraction& glSyncAbstraction, + GlContextHelperAbstraction& glContextHelperAbstraction, ResourcePolicy::DataRetention dataRetentionPolicy, Integration::RenderToFrameBuffer renderToFboEnabled, Integration::DepthBufferAvailable depthBufferAvailable, - Integration::StencilBufferAvailable stencilBufferAvailable ) + Integration::StencilBufferAvailable stencilBufferAvailable, + Integration::PartialUpdateAvailable partialUpdateAvailable ) : mRenderController( renderController ), mPlatform(platform), mProcessingEvent(false), @@ -106,7 +110,7 @@ Core::Core( RenderController& renderController, mRenderTaskProcessor = new SceneGraph::RenderTaskProcessor(); - mRenderManager = RenderManager::New( glAbstraction, glSyncAbstraction, depthBufferAvailable, stencilBufferAvailable ); + mRenderManager = RenderManager::New( glAbstraction, glSyncAbstraction, glContextHelperAbstraction, depthBufferAvailable, stencilBufferAvailable, partialUpdateAvailable ); RenderQueue& renderQueue = mRenderManager->GetRenderQueue(); @@ -191,13 +195,14 @@ void Core::ContextDestroyed() mRenderManager->ContextDestroyed(); } -void Core::SurfaceResized( Integration::RenderSurface* surface ) +void Core::SurfaceDeleted( Integration::RenderSurface* surface ) { - for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter ) + for( auto scene : mScenes ) { - if( (*iter)->GetSurface() == surface ) + if( scene->GetSurface() == surface ) { - (*iter)->SetSurface( *surface ); + scene->SurfaceDeleted(); + break; } } } @@ -268,18 +273,22 @@ void Core::ProcessEvents() // Signal that any messages received will be flushed soon mUpdateManager->EventProcessingStarted(); + // Scene could be added or removed while processing the events + // Copy the Scene container locally to avoid possibly invalid iterator + SceneContainer scenes = mScenes; + // process events in all scenes - for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter ) + for( auto scene : scenes ) { - (*iter)->ProcessEvents(); + scene->ProcessEvents(); } mNotificationManager->ProcessMessages(); // Emit signal here to inform listeners that event processing has finished. - for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter ) + for( auto scene : scenes ) { - (*iter)->EmitEventProcessingFinishedSignal(); + scene->EmitEventProcessingFinishedSignal(); } // Run any registered processors @@ -289,9 +298,9 @@ void Core::ProcessEvents() mRelayoutController->Relayout(); // Rebuild depth tree after event processing has finished - for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter ) + for( auto scene : scenes ) { - (*iter)->RebuildDepthTree(); + scene->RebuildDepthTree(); } // Flush any queued messages for the update-thread