From 5f8606227530fe06c27a85a01357ed85ebca52cd Mon Sep 17 00:00:00 2001 From: seungho baek Date: Thu, 26 Oct 2023 18:16:32 +0900 Subject: [PATCH] Fixed Cache for AnimatedVectorImageVisual Change-Id: I75e21fae0ca9e2561dd08f66e05ff590d2c898fc Signed-off-by: seungho baek --- .../adaptor-framework/vector-animation-renderer-plugin.h | 2 ++ dali/devel-api/adaptor-framework/vector-animation-renderer.cpp | 5 +++++ dali/devel-api/adaptor-framework/vector-animation-renderer.h | 9 +++++++++ .../vector-animation/common/vector-animation-renderer-impl.cpp | 5 +++++ .../vector-animation/common/vector-animation-renderer-impl.h | 5 +++++ .../common/vector-animation-renderer-plugin-proxy.cpp | 8 ++++++++ .../common/vector-animation-renderer-plugin-proxy.h | 5 +++++ 7 files changed, 39 insertions(+) diff --git a/dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h b/dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h index bbefdab..1b561c5 100644 --- a/dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h +++ b/dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h @@ -182,6 +182,8 @@ public: */ virtual void AddPropertyValueCallback(const std::string& keyPath, VectorProperty property, CallbackBase* callback, int32_t id) = 0; + virtual void KeepRasterizedBuffer() = 0; + /** * @brief Connect to this signal to be notified when the texture upload is completed. * diff --git a/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp b/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp index b31ff19..ee26514 100644 --- a/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp +++ b/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp @@ -128,6 +128,11 @@ void VectorAnimationRenderer::AddPropertyValueCallback(const std::string& keyPat GetImplementation(*this).AddPropertyValueCallback(keyPath, property, callback, id); } +void VectorAnimationRenderer::KeepRasterizedBuffer() +{ + GetImplementation(*this).KeepRasterizedBuffer(); +} + VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal() { return GetImplementation(*this).UploadCompletedSignal(); diff --git a/dali/devel-api/adaptor-framework/vector-animation-renderer.h b/dali/devel-api/adaptor-framework/vector-animation-renderer.h index f345780..cec206f 100644 --- a/dali/devel-api/adaptor-framework/vector-animation-renderer.h +++ b/dali/devel-api/adaptor-framework/vector-animation-renderer.h @@ -227,6 +227,15 @@ public: */ void AddPropertyValueCallback(const std::string& keyPath, VectorProperty property, CallbackBase* callback, int32_t id); + /** + * @brief Keep the rasterized buffer to use the frame cache. + * + * By default, only as much as needed is kept in the rasterized buffer and not kept after use. + * tis API is efficient in terms of memory, but has the disadvantage of having to load the necessary buffer each time. + * therefore, if there are cases in which you want to improve the performance even if the app sacrifices a lot of memory, this API is useful. + */ + void KeepRasterizedBuffer(); + public: // Signals /** * @brief Connect to this signal to be notified when the texture upload is completed. diff --git a/dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp b/dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp index 1d4eb34..e1b13c0 100644 --- a/dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp +++ b/dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp @@ -131,6 +131,11 @@ void VectorAnimationRenderer::AddPropertyValueCallback(const std::string& keyPat mPlugin.AddPropertyValueCallback(keyPath, property, callback, id); } +void VectorAnimationRenderer::KeepRasterizedBuffer() +{ + mPlugin.KeepRasterizedBuffer(); +} + Dali::VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal() { return mPlugin.UploadCompletedSignal(); diff --git a/dali/internal/vector-animation/common/vector-animation-renderer-impl.h b/dali/internal/vector-animation/common/vector-animation-renderer-impl.h index 84d4230..089577f 100644 --- a/dali/internal/vector-animation/common/vector-animation-renderer-impl.h +++ b/dali/internal/vector-animation/common/vector-animation-renderer-impl.h @@ -123,6 +123,11 @@ public: void AddPropertyValueCallback(const std::string& keyPath, Dali::VectorAnimationRenderer::VectorProperty property, CallbackBase* callback, int32_t id); /** + * @copydoc Dali::VectorAnimationRenderer::KeepRasterizedBuffer() + */ + void KeepRasterizedBuffer(); + + /** * @copydoc Dali::VectorAnimationRenderer::UploadCompletedSignal() */ Dali::VectorAnimationRenderer::UploadCompletedSignalType& UploadCompletedSignal(); diff --git a/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp b/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp index eec7646..6f0fac1 100644 --- a/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp +++ b/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp @@ -228,6 +228,14 @@ void VectorAnimationRendererPluginProxy::AddPropertyValueCallback(const std::str } } +void VectorAnimationRendererPluginProxy::KeepRasterizedBuffer() +{ + if(mPlugin) + { + mPlugin->KeepRasterizedBuffer(); + } +} + VectorAnimationRendererPlugin::UploadCompletedSignalType& VectorAnimationRendererPluginProxy::UploadCompletedSignal() { if(mPlugin) diff --git a/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h b/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h index 47ddf69..76b134a 100644 --- a/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h +++ b/dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h @@ -119,6 +119,11 @@ public: void AddPropertyValueCallback(const std::string& keyPath, Dali::VectorAnimationRenderer::VectorProperty property, CallbackBase* callback, int32_t id); /** + * @copydoc Dali::VectorAnimationRendererPlugin::KeepRasterizedBuffer() + */ + void KeepRasterizedBuffer(); + + /** * @copydoc Dali::VectorAnimationRendererPlugin::UploadCompletedSignal() */ VectorAnimationRendererPlugin::UploadCompletedSignalType& UploadCompletedSignal(); -- 2.7.4