projects
/
platform
/
core
/
uifw
/
dali-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure that global variables are initialized lazily.
[platform/core/uifw/dali-core.git]
/
dali
/
internal
/
event
/
actors
/
actor-sizer.cpp
diff --git
a/dali/internal/event/actors/actor-sizer.cpp
b/dali/internal/event/actors/actor-sizer.cpp
index
93c5216
..
d3bbfa4
100644
(file)
--- a/
dali/internal/event/actors/actor-sizer.cpp
+++ b/
dali/internal/event/actors/actor-sizer.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 202
2
Samsung Electronics Co., Ltd.
+ * Copyright (c) 202
3
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-66,8
+66,11
@@
constexpr float GetDimensionValue(const Dali::Vector2& values, const Dali::Dimen
/**
* @brief Keep a static recursionstack vector to avoid creating temporary vectors every Relayout().
*/
/**
* @brief Keep a static recursionstack vector to avoid creating temporary vectors every Relayout().
*/
-static Dali::Internal::ActorSizer::ActorDimensionStack gRecursionStack{};
-
+Dali::Internal::ActorSizer::ActorDimensionStack& GetRecursionStack()
+{
+ static Dali::Internal::ActorSizer::ActorDimensionStack gRecursionStack{};
+ return gRecursionStack;
+}
} // namespace
namespace Dali::Internal
} // namespace
namespace Dali::Internal
@@
-121,7
+124,7
@@
void ActorSizer::SetSizeInternal(const Vector3& size)
if(mTargetSize != size || mTargetSizeDirtyFlag)
{
mTargetSizeDirtyFlag = false;
if(mTargetSize != size || mTargetSizeDirtyFlag)
{
mTargetSizeDirtyFlag = false;
- mTargetSize = size;
+ mTargetSize
= size;
// Update the preferred size after relayoutting
// It should be used in the next relayoutting
// Update the preferred size after relayoutting
// It should be used in the next relayoutting
@@
-837,14
+840,14
@@
void ActorSizer::NegotiateDimension(Dimension::Type dimension, const Vector2& al
void ActorSizer::NegotiateDimensions(const Vector2& allocatedSize)
{
// Negotiate all dimensions that require it
void ActorSizer::NegotiateDimensions(const Vector2& allocatedSize)
{
// Negotiate all dimensions that require it
-
gRecursionStack
.clear();
+
GetRecursionStack()
.clear();
for(uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i)
{
const Dimension::Type dimension = static_cast<Dimension::Type>(1 << i);
// Negotiate
for(uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i)
{
const Dimension::Type dimension = static_cast<Dimension::Type>(1 << i);
// Negotiate
- NegotiateDimension(dimension, allocatedSize,
gRecursionStack
);
+ NegotiateDimension(dimension, allocatedSize,
GetRecursionStack()
);
}
}
}
}