#include <dali/integration-api/debug.h>
#include <dali/integration-api/events/event.h>
#include <dali/integration-api/gl-sync-abstraction.h>
+#include <dali/integration-api/gl-context-helper-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::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;
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),
mRenderTaskProcessor = new SceneGraph::RenderTaskProcessor();
- mRenderManager = RenderManager::New( glAbstraction, glSyncAbstraction, depthBufferAvailable, stencilBufferAvailable );
+ mRenderManager = RenderManager::New( glAbstraction, glSyncAbstraction, glContextHelperAbstraction, depthBufferAvailable, stencilBufferAvailable, partialUpdateAvailable );
RenderQueue& renderQueue = mRenderManager->GetRenderQueue();
// 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 );
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;
}
}
}
// Any message to update will wake it up anyways
}
-void Core::Render( RenderStatus& status, bool forceClear )
+void Core::Render( RenderStatus& status, bool forceClear, bool uploadOnly )
{
- mRenderManager->Render( status, forceClear );
+ mRenderManager->Render( status, forceClear, uploadOnly );
}
void Core::SceneCreated()
void Core::QueueEvent( const Integration::Event& event )
{
- mEventProcessor->QueueEvent( event );
+ if (mScenes.size() != 0)
+ {
+ mScenes.front()->QueueEvent( event );
+ }
}
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();
// 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