X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fcommon%2Fcore-impl.cpp;h=5e02c3648a88ec516d41cf2acadca521691227a3;hb=refs%2Fchanges%2F30%2F273930%2F3;hp=19121d0cb872967e07c370b6c7071b00b3c8378c;hpb=32f4a41e7c6bb956ae61e99ba4468192bdd33026;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/common/core-impl.cpp b/dali/internal/common/core-impl.cpp index 19121d0..5e02c36 100644 --- a/dali/internal/common/core-impl.cpp +++ b/dali/internal/common/core-impl.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -72,7 +71,6 @@ namespace Internal using Integration::Event; using Integration::GlAbstraction; using Integration::GlContextHelperAbstraction; -using Integration::GlSyncAbstraction; using Integration::PlatformAbstraction; using Integration::RenderController; using Integration::RenderStatus; @@ -187,7 +185,7 @@ void Core::ContextDestroyed() { } -void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo) +void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly) { // set the time delta so adaptor can easily print FPS with a release build with 0 as // it is cached by frametime @@ -199,7 +197,8 @@ void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, renderToFboEnabled, - isRenderingToFbo); + isRenderingToFbo, + uploadOnly); // Check the Notification Manager message queue to set needsNotification status.needsNotification = mNotificationManager->MessagesToProcess(); @@ -208,9 +207,9 @@ void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint // Any message to update will wake it up anyways } -void Core::PreRender(RenderStatus& status, bool forceClear, bool uploadOnly) +void Core::PreRender(RenderStatus& status, bool forceClear) { - mRenderManager->PreRender(status, forceClear, uploadOnly); + mRenderManager->PreRender(status, forceClear); } void Core::PreRender(Integration::Scene& scene, std::vector>& damagedRects) @@ -228,9 +227,9 @@ void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool ren mRenderManager->RenderScene(status, scene, renderToFbo, clippingRect); } -void Core::PostRender(bool uploadOnly) +void Core::PostRender() { - mRenderManager->PostRender(uploadOnly); + mRenderManager->PostRender(); } void Core::SceneCreated() @@ -294,6 +293,9 @@ void Core::ProcessEvents() // Run the size negotiation after event processing finished signal mRelayoutController->Relayout(); + // Run any registered post processors + RunPostProcessors(); + // Rebuild depth tree after event processing has finished for(auto scene : scenes) { @@ -325,17 +327,35 @@ uint32_t Core::GetMaximumUpdateCount() const return MAXIMUM_UPDATE_COUNT; } -void Core::RegisterProcessor(Integration::Processor& processor) +void Core::RegisterProcessor(Integration::Processor& processor, bool postProcessor) { - mProcessors.PushBack(&processor); + if(postProcessor) + { + mPostProcessors.PushBack(&processor); + } + else + { + mProcessors.PushBack(&processor); + } } -void Core::UnregisterProcessor(Integration::Processor& processor) +void Core::UnregisterProcessor(Integration::Processor& processor, bool postProcessor) { - auto iter = std::find(mProcessors.Begin(), mProcessors.End(), &processor); - if(iter != mProcessors.End()) + if(postProcessor) { - mProcessors.Erase(iter); + auto iter = std::find(mPostProcessors.Begin(), mPostProcessors.End(), &processor); + if(iter != mPostProcessors.End()) + { + mPostProcessors.Erase(iter); + } + } + else + { + auto iter = std::find(mProcessors.Begin(), mProcessors.End(), &processor); + if(iter != mProcessors.End()) + { + mProcessors.Erase(iter); + } } } @@ -348,7 +368,21 @@ void Core::RunProcessors() { if(processor) { - processor->Process(); + processor->Process(false); + } + } +} + +void Core::RunPostProcessors() +{ + // Copy processor pointers to prevent changes to vector affecting loop iterator. + Dali::Vector processors(mPostProcessors); + + for(auto processor : processors) + { + if(processor) + { + processor->Process(true); } } }