X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fanimated-vector-image%2Fanimated-vector-image-visual.h;h=72c8e60f6e0319503095d2cb680dab2d44dd9115;hb=HEAD;hp=c809634515825443e2e2464b10401ff9b3303c46;hpb=bed9d1fafb2def9ec59d67277a4935a9f7fcbdd1;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git 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 c809634..874a88a 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) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 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. @@ -53,7 +53,7 @@ using AnimatedVectorImageVisualPtr = IntrusivePtr; * | url | STRING | * */ -class AnimatedVectorImageVisual : public Visual::Base, public ConnectionTracker, public VectorAnimationManager::LifecycleObserver +class AnimatedVectorImageVisual : public Visual::Base, public ConnectionTracker { public: /** @@ -73,9 +73,10 @@ public: * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object * @param[in] shaderFactory The ImageVisualShaderFactory object * @param[in] imageUrl The URL to an animated vector image to use + * @param[in] size The width and height of the rasterized buffer. The visual size will be used if these are 0. * @return A smart-pointer to the newly allocated visual. */ - static AnimatedVectorImageVisualPtr New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl); + static AnimatedVectorImageVisualPtr New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, ImageDimensions size = ImageDimensions()); public: // from Visual /** @@ -93,11 +94,10 @@ public: // from Visual */ void DoCreateInstancePropertyMap(Property::Map& map) const override; -protected: // From VectorAnimationManager::LifecycleObserver: /** - * @copydoc VectorAnimationManager::LifecycleObserver::VectorAnimationManagerDestroyed() + * @copydoc Visual::Base::EnablePreMultipliedAlpha */ - void VectorAnimationManagerDestroyed() override; + void EnablePreMultipliedAlpha(bool preMultiplied) override; protected: /** @@ -106,8 +106,9 @@ protected: * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object * @param[in] shaderFactory The ImageVisualShaderFactory object * @param[in] imageUrl The URL to an animated vector image to use + * @param[in] size The width and height of the rasterized buffer. The visual size will be used if these are 0. */ - AnimatedVectorImageVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl); + AnimatedVectorImageVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, ImageDimensions size); /** * @brief A reference counted object may only be deleted by calling Unreference(). @@ -140,10 +141,25 @@ protected: void OnSetTransform() override; /** + * @copydoc Visual::Base::UpdateShader + */ + void UpdateShader() override; + + /** + * @copydoc Visual::Base::GenerateShader + */ + Shader GenerateShader() const override; + + /** * @copydoc Visual::Base::OnDoAction */ void OnDoAction(const Property::Index actionId, const Property::Value& attributes) override; + /** + * @copydoc Visual::Base::OnDoActionExtension + */ + void OnDoActionExtension(const Property::Index actionId, const Dali::Any& attributes) override; + private: /** * Helper method to set individual values by index key. @@ -153,14 +169,17 @@ private: void DoSetProperty(Property::Index index, const Property::Value& value); /** - * @brief Called when the texture upload is completed. + * @brief Called when the resource is ready. + * @param[in] status The resource status */ - void OnUploadCompleted(); + void OnResourceReady(VectorAnimationTask::ResourceStatus status); /** * @brief Event callback from rasterize thread. This is called after the animation is finished. + * + * @param[in] playStateId The play state id */ - void OnAnimationFinished(); + void OnAnimationFinished(uint32_t playStateId); /** * @brief Send animation data to the rasterize thread. @@ -195,7 +214,7 @@ private: /** * @brief Callback when the visibility of the actor is changed. */ - void OnControlVisibilityChanged(Actor actor, bool visible, DevelActor::VisibilityChange::Type type); + void OnControlInheritedVisibilityChanged(Actor actor, bool visible); /** * @brief Callback when the visibility of the window is changed. @@ -214,7 +233,8 @@ private: AnimatedVectorImageVisual& operator=(const AnimatedVectorImageVisual& visual) = delete; private: - VisualUrl mUrl; + WeakHandle mPlacementWindow; + VisualUrl mImageUrl; VectorAnimationTask::AnimationData mAnimationData; VectorAnimationTaskPtr mVectorAnimationTask; ImageVisualShaderFactory& mImageVisualShaderFactory; @@ -222,13 +242,19 @@ private: PropertyNotification mSizeNotification; Vector2 mVisualSize; Vector2 mVisualScale; + Dali::ImageDimensions mDesiredSize{}; WeakHandle mPlacementActor; DevelImageVisual::PlayState::Type mPlayState; CallbackBase* mEventCallback; // Not owned - bool mLoadFailed; - bool mRendererAdded; - bool mCoreShutdown; - bool mRedrawInScalingDown; + + uint32_t mLastSentPlayStateId; + + bool mLoadFailed : 1; + bool mRendererAdded : 1; + bool mRedrawInScalingDown : 1; + bool mEnableFrameCache : 1; + bool mUseNativeImage : 1; + bool mNotifyAfterRasterization : 1; }; } // namespace Internal