mStage = IntrusivePtr<Stage>( Stage::New( *mAnimationPlaylist, *mPropertyNotificationManager, *mUpdateManager, *mNotificationManager ) );
// This must be called after stage is created but before stage initialization
- mRelayoutController = IntrusivePtr< RelayoutController >( new RelayoutController() );
+ mRelayoutController = IntrusivePtr< RelayoutController >( new RelayoutController( mRenderController ) );
mStage->Initialize();
}
mProcessingEvent = true;
+ mRelayoutController->SetProcessingCoreEvents( true );
// Signal that any messages received will be flushed soon
mUpdateManager->EventProcessingStarted();
}
}
+ mRelayoutController->SetProcessingCoreEvents( false );
+
// ProcessEvents() may now be called again
mProcessingEvent = false;
}
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/common/stage.h>
#include <dali/integration-api/debug.h>
+#include <dali/integration-api/render-controller.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/object-registry.h>
#include <dali/internal/event/actors/actor-impl.h>
return &ThreadLocalStorage::Get().GetRelayoutController();
}
-RelayoutController::RelayoutController()
-: mRelayoutInfoAllocator(),
+RelayoutController::RelayoutController( Integration::RenderController& controller )
+: mRenderController( controller ),
+ mRelayoutInfoAllocator(),
mSlotDelegate( this ),
mRelayoutStack( new MemoryPoolRelayoutContainer( mRelayoutInfoAllocator ) ),
mRelayoutConnection( false ),
mRelayoutFlag( false ),
mEnabled( false ),
- mPerformingRelayout( false )
+ mPerformingRelayout( false ),
+ mProcessingCoreEvents( false )
{
// Make space for 32 controls to avoid having to copy construct a lot in the beginning
mRelayoutStack->Reserve( 32 );
RemoveRequest( subRoot );
}
+
+ if ( !mProcessingCoreEvents )
+ {
+ mRenderController.RequestProcessEventsOnIdle();
+ }
}
void RelayoutController::OnApplicationSceneCreated()
return mPerformingRelayout;
}
+void RelayoutController::SetProcessingCoreEvents( bool processingEvents )
+{
+ mProcessingCoreEvents = processingEvents;
+}
+
void RelayoutController::FindAndZero( const RawActorList& list, const Dali::RefObject* object )
{
// Object has been destroyed so clear it from this list
namespace Dali
{
+namespace Integration
+{
+class RenderController;
+}
+
namespace Internal
{
/**
* @brief Constructor.
* We should only create a unique instance.
+ * @param[in] controller to request a render from the RenderController if core is not processing events.
*/
- RelayoutController();
+ RelayoutController( Integration::RenderController& controller );
/**
* Destructor
*/
bool IsPerformingRelayout() const;
+ /**
+ * @brief Sets whether core is processing events.
+ *
+ * @param[in] processingEvents whether core is processing events.
+ */
+ void SetProcessingCoreEvents( bool processingEvents );
+
public: // CALLBACKS
/**
private:
+ Integration::RenderController& mRenderController;
MemoryPoolObjectAllocator< MemoryPoolRelayoutContainer::RelayoutInfo > mRelayoutInfoAllocator;
SlotDelegate< RelayoutController > mSlotDelegate;
bool mRelayoutFlag : 1; ///< Relayout flag to avoid unnecessary calls
bool mEnabled : 1; ///< Initially disabled. Must be enabled at some point.
bool mPerformingRelayout : 1; ///< The relayout controller is currently performing a relayout
+ bool mProcessingCoreEvents : 1; ///< Whether core is processing events.
};