X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fanimation%2Fscene-graph-animation.cpp;h=659547f643441302c82218a659310fc3217baa6e;hb=73a52536910edf1cbb6ec462217e09a9cbd0449d;hp=d75199a601b9ea1eab4cd93b484ec0b9186b5074;hpb=5de727a5d6b9ef995c93eff4d4e47a086784a332;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/animation/scene-graph-animation.cpp b/dali/internal/update/animation/scene-graph-animation.cpp index d75199a..659547f 100644 --- a/dali/internal/update/animation/scene-graph-animation.cpp +++ b/dali/internal/update/animation/scene-graph-animation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -28,7 +28,11 @@ namespace //Unnamed namespace { //Memory pool used to allocate new animations. Memory used by this pool will be released when shutting down DALi -Dali::Internal::MemoryPoolObjectAllocator gAnimationMemoryPool; +Dali::Internal::MemoryPoolObjectAllocator& GetAnimationMemoryPool() +{ + static Dali::Internal::MemoryPoolObjectAllocator gAnimationMemoryPool; + return gAnimationMemoryPool; +} inline void WrapInPlayRange(float& elapsed, const float& playRangeStartSeconds, const float& playRangeEndSeconds) { @@ -58,7 +62,7 @@ namespace SceneGraph { Animation* Animation::New(float durationSeconds, float speedFactor, const Vector2& playRange, int32_t loopCount, EndAction endAction, EndAction disconnectAction) { - return new(gAnimationMemoryPool.AllocateRawThreadSafe()) Animation(durationSeconds, speedFactor, playRange, loopCount, endAction, disconnectAction); + return new(GetAnimationMemoryPool().AllocateRawThreadSafe()) Animation(durationSeconds, speedFactor, playRange, loopCount, endAction, disconnectAction); } Animation::Animation(float durationSeconds, float speedFactor, const Vector2& playRange, int32_t loopCount, Dali::Animation::EndAction endAction, Dali::Animation::EndAction disconnectAction) @@ -84,7 +88,7 @@ Animation::~Animation() = default; void Animation::operator delete(void* ptr) { - gAnimationMemoryPool.FreeThreadSafe(static_cast(ptr)); + GetAnimationMemoryPool().FreeThreadSafe(static_cast(ptr)); } void Animation::SetDuration(float durationSeconds) @@ -486,7 +490,7 @@ void Animation::UpdateAnimators(BufferIndex bufferIndex, bool bake, bool animati uint32_t Animation::GetMemoryPoolCapacity() { - return gAnimationMemoryPool.GetCapacity(); + return GetAnimationMemoryPool().GetCapacity(); } } // namespace SceneGraph