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%2Fanimated-vector-image-visual.h;h=5bf0f4e2d642183ceae79faad0f5e8ce9f117a68;hp=032bea2ae4386f5ca553381007abb9e595182c58;hb=55e5ea8082729deca6f0f43f01aeae8dd51a4bdb;hpb=87a9019904ab49c42f1e32e7ebb6a1512b0dc28c diff --git a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h index 032bea2..5bf0f4e 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h +++ b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_ANIMATED_VECTOR_IMAGE_VISUAL_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -21,13 +21,16 @@ // EXTERNAL INCLUDES #include #include -#include +#include +#include +#include // INTERNAL INCLUDES #include #include #include -#include +#include +#include namespace Dali { @@ -39,7 +42,6 @@ namespace Internal { class ImageVisualShaderFactory; -class VectorRasterizeThread; class AnimatedVectorImageVisual; using AnimatedVectorImageVisualPtr = IntrusivePtr< AnimatedVectorImageVisual >; @@ -54,7 +56,7 @@ using AnimatedVectorImageVisualPtr = IntrusivePtr< AnimatedVectorImageVisual >; * | url | STRING | * */ -class AnimatedVectorImageVisual: public Visual::Base +class AnimatedVectorImageVisual: public Visual::Base, public ConnectionTracker, public VectorAnimationManager::LifecycleObserver { public: @@ -96,6 +98,12 @@ public: // from Visual */ void DoCreateInstancePropertyMap( Property::Map& map ) const override; +protected: // From VectorAnimationManager::LifecycleObserver: + /** + * @copydoc VectorAnimationManager::LifecycleObserver::VectorAnimationManagerDestroyed() + */ + void VectorAnimationManagerDestroyed() override; + protected: /** @@ -110,7 +118,7 @@ protected: /** * @brief A reference counted object may only be deleted by calling Unreference(). */ - virtual ~AnimatedVectorImageVisual(); + ~AnimatedVectorImageVisual() override; /** * @copydoc Visual::Base::DoSetProperties @@ -118,14 +126,14 @@ protected: void DoSetProperties( const Property::Map& propertyMap ) override; /** - * @copydoc Visual::Base::DoSetOnStage + * @copydoc Visual::Base::DoSetOnScene */ - void DoSetOnStage( Actor& actor ) override; + void DoSetOnScene( Actor& actor ) override; /** - * @copydoc Visual::Base::DoSetOffStage + * @copydoc Visual::Base::DoSetOffScene */ - void DoSetOffStage( Actor& actor ) override; + void DoSetOffScene( Actor& actor ) override; /** * @copydoc Visual::Base::OnSetTransform @@ -147,9 +155,9 @@ private: void DoSetProperty( Property::Index index, const Property::Value& value ); /** - * @brief Event callback from rasterize thread. This is called after the first frame is ready. + * @brief Called when the texture upload is completed. */ - void OnResourceReady(); + void OnUploadCompleted(); /** * @brief Event callback from rasterize thread. This is called after the animation is finished. @@ -161,6 +169,46 @@ private: */ void SendAnimationData(); + /** + * @brief Set the vector image size. + */ + void SetVectorImageSize(); + + /** + * @brief Stop the animation. + */ + void StopAnimation(); + + /** + * @brief Trigger rasterization of the vector content. + */ + void TriggerVectorRasterization(); + + /** + * @brief Callback when the world scale factor changes. + */ + void OnScaleNotification( PropertyNotification& source ); + + /** + * @brief Callback when the size changes. + */ + void OnSizeNotification( PropertyNotification& source ); + + /** + * @brief Callback when the visibility of the actor is changed. + */ + void OnControlVisibilityChanged( Actor actor, bool visible, DevelActor::VisibilityChange::Type type ); + + /** + * @brief Callback when the visibility of the window is changed. + */ + void OnWindowVisibilityChanged( Window window, bool visible ); + + /** + * @brief Callback when the event is processed. + */ + void OnProcessEvents(); + // Undefined AnimatedVectorImageVisual( const AnimatedVectorImageVisual& visual ) = delete; @@ -168,15 +216,20 @@ private: AnimatedVectorImageVisual& operator=( const AnimatedVectorImageVisual& visual ) = delete; private: - ImageVisualShaderFactory& mImageVisualShaderFactory; VisualUrl mUrl; - VectorRasterizeThread mVectorRasterizeThread; + VectorAnimationTask::AnimationData mAnimationData; + VectorAnimationTaskPtr mVectorAnimationTask; + ImageVisualShaderFactory& mImageVisualShaderFactory; + PropertyNotification mScaleNotification; + PropertyNotification mSizeNotification; Vector2 mVisualSize; - Vector2 mPlayRange; + Vector2 mVisualScale; WeakHandle< Actor > mPlacementActor; - int32_t mLoopCount; - uint32_t mResendFlag; - DevelAnimatedVectorImageVisual::Action::Type mActionStatus; + DevelImageVisual::PlayState::Type mPlayState; + CallbackBase* mEventCallback; // Not owned + bool mRendererAdded; + bool mCoreShutdown; + bool mRedrawInScalingDown; }; } // namespace Internal