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=7e7b04d8e48bf37b89671eb44d62de1bdef96b74;hb=5e0fb26403041c3865e5ac2b5d56a5b479a9015d;hp=221cf23cf58241251b03c078402cee6bdb2f1b03;hpb=27d173933230d0cdb85da537a2c818fb85afed59;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 221cf23..7e7b04d 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) 2022 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. @@ -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 /** @@ -111,8 +112,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(). @@ -159,6 +161,11 @@ protected: */ void OnDoAction(const Property::Index actionId, const Property::Value& attributes) override; + /** + * @copydoc Visual::Base::OnDoActionExtension + */ + void OnDoActionExtension(const Property::Index actionId, Dali::Any attributes) override; + private: /** * Helper method to set individual values by index key. @@ -175,8 +182,17 @@ private: /** * @brief Event callback from rasterize thread. This is called after the animation is finished. + * + * @param[in] playStateId The play state id + */ + void OnAnimationFinished(uint32_t playStateId); + + /** + * @brief Event callback from rasterize thread. This is called when we want to ensure rendering next frame. + * + * @param[in] argument Not using arguments */ - void OnAnimationFinished(); + void OnForceRendering(uint32_t argument); /** * @brief Send animation data to the rasterize thread. @@ -230,7 +246,7 @@ private: AnimatedVectorImageVisual& operator=(const AnimatedVectorImageVisual& visual) = delete; private: - VisualUrl mUrl; + VisualUrl mImageUrl; VectorAnimationTask::AnimationData mAnimationData; VectorAnimationTaskPtr mVectorAnimationTask; ImageVisualShaderFactory& mImageVisualShaderFactory; @@ -238,13 +254,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 mCoreShutdown : 1; + bool mRedrawInScalingDown : 1; + bool mEnableFrameCache : 1; + bool mUseNativeImage : 1; }; } // namespace Internal