#include <dali/integration-api/debug.h>
#include <dali/integration-api/events/event.h>
#include <dali/integration-api/gl-context-helper-abstraction.h>
-#include <dali/integration-api/gl-sync-abstraction.h>
#include <dali/integration-api/platform-abstraction.h>
#include <dali/integration-api/processor-interface.h>
#include <dali/integration-api/render-controller.h>
using Integration::Event;
using Integration::GlAbstraction;
using Integration::GlContextHelperAbstraction;
-using Integration::GlSyncAbstraction;
using Integration::PlatformAbstraction;
using Integration::RenderController;
using Integration::RenderStatus;
void Core::ContextCreated()
{
- mRenderManager->ContextCreated();
}
void Core::ContextDestroyed()
{
- mRenderManager->ContextDestroyed();
}
void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo)
// 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)
{
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);
+ }
}
}
{
if(processor)
{
- processor->Process();
+ processor->Process(false);
+ }
+ }
+}
+
+void Core::RunPostProcessors()
+{
+ // Copy processor pointers to prevent changes to vector affecting loop iterator.
+ Dali::Vector<Integration::Processor*> processors(mPostProcessors);
+
+ for(auto processor : processors)
+ {
+ if(processor)
+ {
+ processor->Process(true);
}
}
}