X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fanimated-vector-image%2Fvector-animation-task.h;h=3c0b8e3f8e6a218d01dc0257769b5653ed96dc5f;hb=3a1be394aa3551032f262fc329bf3b1b95c8bd24;hp=702a7183d120eb005f5df0ad14ab414937f72b92;hpb=9ddd5fea6278d06b8874988498c7c4c6508750ba;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h index 702a718..3c0b8e3 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h @@ -47,6 +47,8 @@ class VectorAnimationTask : public RefObject public: using UploadCompletedSignalType = Dali::VectorAnimationRenderer::UploadCompletedSignalType; + using TimePoint = std::chrono::time_point; + /** * Flags for re-sending data to the vector animation thread */ @@ -108,9 +110,8 @@ public: * @brief Constructor. * * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object - * @param[in] url The url of the vector animation file */ - VectorAnimationTask(VisualFactoryCache& factoryCache, const std::string& url); + VectorAnimationTask(VisualFactoryCache& factoryCache); /** * @brief Destructor. @@ -123,6 +124,14 @@ public: void Finalize(); /** + * @brief Loads the animation file. + * + * @param[in] url The url of the vector animation file + * @return True if loading success, false otherwise. + */ + bool Load(const std::string& url); + + /** * @brief Sets the renderer used to display the result image. * * @param[in] renderer The renderer used to display the result image @@ -188,21 +197,16 @@ public: * @brief Calculates the time for the next frame rasterization. * @return The time for the next frame rasterization. */ - std::chrono::time_point CalculateNextFrameTime(bool renderNow); + TimePoint CalculateNextFrameTime(bool renderNow); /** * @brief Gets the time for the next frame rasterization. * @return The time for the next frame rasterization. */ - std::chrono::time_point GetNextFrameTime(); + TimePoint GetNextFrameTime(); private: /** - * @brief Initializes the vector renderer. - */ - void Initialize(); - - /** * @brief Play the vector animation. */ void PlayAnimation(); @@ -282,32 +286,33 @@ private: PAUSED ///< The animation is paused }; - std::string mUrl; - VectorAnimationRenderer mVectorRenderer; - AnimationData mAnimationData[2]; - VectorAnimationThread& mVectorAnimationThread; - ConditionalWait mConditionalWait; - std::unique_ptr mAnimationFinishedTrigger; - PlayState mPlayState; - DevelImageVisual::StopBehavior::Type mStopBehavior; - DevelImageVisual::LoopingMode::Type mLoopingMode; - std::chrono::time_point mNextFrameStartTime; - int64_t mFrameDurationNanoSeconds; - float mFrameRate; - uint32_t mCurrentFrame; - uint32_t mTotalFrame; - uint32_t mStartFrame; - uint32_t mEndFrame; - uint32_t mWidth; - uint32_t mHeight; - uint32_t mAnimationDataIndex; - int32_t mLoopCount; - int32_t mCurrentLoop; - bool mForward; - bool mUpdateFrameNumber; - bool mNeedAnimationFinishedTrigger; - bool mAnimationDataUpdated; - bool mDestroyTask; + std::string mUrl; + VectorAnimationRenderer mVectorRenderer; + AnimationData mAnimationData[2]; + VectorAnimationThread& mVectorAnimationThread; + ConditionalWait mConditionalWait; + std::unique_ptr mAnimationFinishedTrigger; + PlayState mPlayState; + DevelImageVisual::StopBehavior::Type mStopBehavior; + DevelImageVisual::LoopingMode::Type mLoopingMode; + TimePoint mNextFrameStartTime; + int64_t mFrameDurationMicroSeconds; + float mFrameRate; + uint32_t mCurrentFrame; + uint32_t mTotalFrame; + uint32_t mStartFrame; + uint32_t mEndFrame; + uint32_t mDroppedFrames; + uint32_t mWidth; + uint32_t mHeight; + uint32_t mAnimationDataIndex; + int32_t mLoopCount; + int32_t mCurrentLoop; + bool mForward; + bool mUpdateFrameNumber; + bool mNeedAnimationFinishedTrigger; + bool mAnimationDataUpdated; + bool mDestroyTask; }; } // namespace Internal