*/
// CLASS HEADER
-#include "relayout-controller-impl.h"
+#include <dali/internal/event/size-negotiation/relayout-controller-impl.h>
// EXTERNAL INCLUDES
#if defined(DEBUG_ENABLED)
{
// Make space for 32 controls to avoid having to copy construct a lot in the beginning
mRelayoutStack->Reserve(32);
+ mPotentialRedundantSubRoots.reserve(32);
+ mTopOfSubTreeStack.reserve(32);
}
RelayoutController::~RelayoutController() = default;
return;
}
- std::vector<Dali::Actor> potentialRedundantSubRoots;
- std::vector<Dali::Actor> topOfSubTreeStack;
+ std::vector<Dali::Actor>& potentialRedundantSubRoots = mPotentialRedundantSubRoots;
+ std::vector<Dali::Actor>& topOfSubTreeStack = mTopOfSubTreeStack;
+
+ DALI_ASSERT_ALWAYS(potentialRedundantSubRoots.empty() && "potentialRedundantSubRoots must be empty before RequestRelayout!");
+ DALI_ASSERT_ALWAYS(topOfSubTreeStack.empty() && "topOfSubTreeStack must be empty before RequestRelayout!");
topOfSubTreeStack.push_back(actor);
RemoveRequest(subRoot);
}
+ potentialRedundantSubRoots.clear();
+
if(!mProcessingCoreEvents)
{
mRenderController.RequestProcessEventsOnIdle(false);
std::unique_ptr<MemoryPoolRelayoutContainer> mRelayoutStack; ///< Stack for relayouting
+ std::vector<Dali::Actor> mPotentialRedundantSubRoots; ///< Stack of Actor when RequestLayout comes. Keep it as member to avoid vector size reserving.
+ std::vector<Dali::Actor> mTopOfSubTreeStack;
+
bool mRelayoutConnection : 1; ///< Whether EventProcessingFinishedSignal signal is connected.
bool mRelayoutFlag : 1; ///< Relayout flag to avoid unnecessary calls
bool mEnabled : 1; ///< Initially disabled. Must be enabled at some point.