/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return 0.0f;
}
+/**
+ * @brief Keep a static recursionstack vector to avoid creating temporary vectors every Relayout().
+ */
+static Dali::Internal::ActorSizer::ActorDimensionStack gRecursionStack{};
+
} // namespace
namespace Dali::Internal
if(!recursionFound)
{
// Record the path that we have taken
- recursionStack.push_back(ActorDimensionPair(&mOwner, dimension));
+ recursionStack.emplace_back(&mOwner, dimension);
// Dimension dependency check
for(uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i)
void ActorSizer::NegotiateDimensions(const Vector2& allocatedSize)
{
// Negotiate all dimensions that require it
- ActorDimensionStack recursionStack;
+ gRecursionStack.clear();
for(uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i)
{
const Dimension::Type dimension = static_cast<Dimension::Type>(1 << i);
// Negotiate
- NegotiateDimension(dimension, allocatedSize, recursionStack);
+ NegotiateDimension(dimension, allocatedSize, gRecursionStack);
}
}