X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fanimated-vector-image%2Fvector-animation-thread.h;h=86fec43990657972e51f98eeeed0dfe8bea7af3a;hp=964f662040467fbcd7e4bd9b4d37665aee3ed492;hb=7018f61b640b6fcf9cb576b537bafcb6bb8240e8;hpb=43457ca7890cae573787108ced14128fdfba7dbd diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h old mode 100755 new mode 100644 index 964f662..86fec43 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_VECTOR_ANIMATION_THREAD_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -18,11 +18,11 @@ */ // EXTERNAL INCLUDES -#include -#include #include #include #include +#include +#include // INTERNAL INCLUDES #include @@ -31,20 +31,16 @@ namespace Dali { - namespace Toolkit { - namespace Internal { - /** * The main animation thread for vector animations */ class VectorAnimationThread : public Thread { public: - /** * @brief Constructor. */ @@ -53,20 +49,20 @@ public: /** * @brief Destructor. */ - virtual ~VectorAnimationThread(); + ~VectorAnimationThread() override; /** * Add a animation task into the vector animation thread, called by main thread. * * @param[in] task The task added to the thread. */ - void AddTask( VectorAnimationTaskPtr task ); + void AddTask(VectorAnimationTaskPtr task); /** * @brief Called when the rasterization is completed from the rasterize thread. * @param task The completed task */ - void OnTaskCompleted( VectorAnimationTaskPtr task, bool stopped ); + void OnTaskCompleted(VectorAnimationTaskPtr task, bool stopped); /** * @brief Called when the sleep thread is awaken. @@ -74,21 +70,18 @@ public: void OnAwakeFromSleep(); protected: - /** * @brief The entry function of the animation thread. */ void Run() override; private: - /** * Rasterizes the tasks. */ void Rasterize(); private: - /** * @brief Helper class to keep the relation between VectorRasterizeThread and corresponding container */ @@ -100,32 +93,31 @@ private: * * @param[in] animationThread Reference to the VectorAnimationThread */ - RasterizeHelper( VectorAnimationThread& animationThread ); + RasterizeHelper(VectorAnimationThread& animationThread); /** * @brief Rasterizes the task. * * @param[in] task The task to rasterize. */ - void Rasterize( VectorAnimationTaskPtr task ); + void Rasterize(VectorAnimationTaskPtr task); public: - RasterizeHelper( const RasterizeHelper& ) = delete; - RasterizeHelper& operator=( const RasterizeHelper& ) = delete; + RasterizeHelper(const RasterizeHelper&) = delete; + RasterizeHelper& operator=(const RasterizeHelper&) = delete; - RasterizeHelper( RasterizeHelper&& rhs ); - RasterizeHelper& operator=( RasterizeHelper&& rhs ) = delete; + RasterizeHelper(RasterizeHelper&& rhs); + RasterizeHelper& operator=(RasterizeHelper&& rhs) = delete; private: - /** * @brief Main constructor that used by all other constructors */ - RasterizeHelper( std::unique_ptr< VectorRasterizeThread > rasterizer, VectorAnimationThread& animationThread ); + RasterizeHelper(std::unique_ptr rasterizer, VectorAnimationThread& animationThread); private: - std::unique_ptr< VectorRasterizeThread > mRasterizer; - VectorAnimationThread& mAnimationThread; + std::unique_ptr mRasterizer; + VectorAnimationThread& mAnimationThread; }; /** @@ -134,63 +126,57 @@ private: class SleepThread : public Thread { public: - /** * @brief Constructor. */ - SleepThread( CallbackBase* callback ); + SleepThread(CallbackBase* callback); /** * @brief Destructor. */ - virtual ~SleepThread(); + ~SleepThread() override; /** * @brief Sleeps untile the specified time point. */ - void SleepUntil( std::chrono::time_point< std::chrono::system_clock > timeToSleepUntil ); + void SleepUntil(std::chrono::time_point timeToSleepUntil); protected: - /** * @brief The entry function of the animation thread. */ void Run() override; private: - - SleepThread( const SleepThread& thread ) = delete; - SleepThread& operator=( const SleepThread& thread ) = delete; + SleepThread(const SleepThread& thread) = delete; + SleepThread& operator=(const SleepThread& thread) = delete; private: - ConditionalWait mConditionalWait; - std::unique_ptr< CallbackBase > mAwakeCallback; - std::chrono::time_point< std::chrono::system_clock > mSleepTimePoint; - const Dali::LogFactoryInterface& mLogFactory; - bool mNeedToSleep; - bool mDestroyThread; + ConditionalWait mConditionalWait; + std::unique_ptr mAwakeCallback; + std::chrono::time_point mSleepTimePoint; + const Dali::LogFactoryInterface& mLogFactory; + bool mNeedToSleep; + bool mDestroyThread; }; private: - // Undefined - VectorAnimationThread( const VectorAnimationThread& thread ) = delete; + VectorAnimationThread(const VectorAnimationThread& thread) = delete; // Undefined - VectorAnimationThread& operator=( const VectorAnimationThread& thread ) = delete; + VectorAnimationThread& operator=(const VectorAnimationThread& thread) = delete; private: - - std::vector< VectorAnimationTaskPtr > mAnimationTasks; - std::vector< VectorAnimationTaskPtr > mCompletedTasks; - std::vector< VectorAnimationTaskPtr > mWorkingTasks; - RoundRobinContainerView< RasterizeHelper > mRasterizers; - SleepThread mSleepThread; - ConditionalWait mConditionalWait; - bool mNeedToSleep; - bool mDestroyThread; - const Dali::LogFactoryInterface& mLogFactory; - + std::vector mAnimationTasks; + std::vector mCompletedTasks; + std::vector mWorkingTasks; + RoundRobinContainerView mRasterizers; + SleepThread mSleepThread; + ConditionalWait mConditionalWait; + bool mNeedToSleep; + bool mDestroyThread; + const Dali::LogFactoryInterface& mLogFactory; }; } // namespace Internal