X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fcommon%2Fcore-impl.cpp;h=863c7e5b63f340a0e9a0a5da85cff2e7d8d78d34;hb=b43741a90b40ca9dfbd33d6a9d390d3c09230e89;hp=4ddbc042c51860c730f85c7ac1049353f31472cb;hpb=6d4b6de12867b318f41562184baba1022c487d4b;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 4ddbc04..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 @@ -74,8 +75,8 @@ namespace Internal using Integration::RenderController; using Integration::PlatformAbstraction; using Integration::GlSyncAbstraction; -using Integration::GestureManager; using Integration::GlAbstraction; +using Integration::GlContextHelperAbstraction; using Integration::Event; using Integration::UpdateStatus; using Integration::RenderStatus; @@ -84,11 +85,12 @@ Core::Core( RenderController& renderController, PlatformAbstraction& platform, GlAbstraction& glAbstraction, GlSyncAbstraction& glSyncAbstraction, - GestureManager& gestureManager, + 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), @@ -108,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(); @@ -132,8 +134,7 @@ Core::Core( RenderController& renderController, // This must be called after stage is created but before stage initialization mRelayoutController = IntrusivePtr< RelayoutController >( new RelayoutController( mRenderController ) ); - mGestureEventProcessor = new GestureEventProcessor( *mStage, *mUpdateManager, gestureManager, mRenderController ); - mEventProcessor = new EventProcessor( *mStage, *mNotificationManager, *mGestureEventProcessor ); + mGestureEventProcessor = new GestureEventProcessor( *mUpdateManager, mRenderController ); mShaderFactory = new ShaderFactory(); mUpdateManager->SetShaderSaver( *mShaderFactory ); @@ -194,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; } } } @@ -249,7 +251,10 @@ void Core::SceneCreated() void Core::QueueEvent( const Integration::Event& event ) { - mEventProcessor->QueueEvent( event ); + if (mScenes.size() != 0) + { + mScenes.front()->QueueEvent( event ); + } } void Core::ProcessEvents() @@ -268,12 +273,23 @@ void Core::ProcessEvents() // Signal that any messages received will be flushed soon mUpdateManager->EventProcessingStarted(); - mEventProcessor->ProcessEvents(); + // 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 scene : scenes ) + { + scene->ProcessEvents(); + } mNotificationManager->ProcessMessages(); // Emit signal here to inform listeners that event processing has finished. - mStage->EmitEventProcessingFinishedSignal(); + for( auto scene : scenes ) + { + scene->EmitEventProcessingFinishedSignal(); + } // Run any registered processors RunProcessors(); @@ -281,11 +297,10 @@ void Core::ProcessEvents() // Run the size negotiation after event processing finished signal 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