From: Heeyong Song Date: Wed, 2 Jan 2019 02:41:10 +0000 (+0900) Subject: [4.0] (VectorAnimation) Add a function to change a Renderer X-Git-Tag: accepted/tizen/4.0/unified/20190112.120432^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F17%2F196517%2F1;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [4.0] (VectorAnimation) Add a function to change a Renderer Change-Id: Ib446d1144ba78951be4961115c55800bf69d4ff5 --- diff --git a/adaptors/common/vector-animation-renderer-impl.cpp b/adaptors/common/vector-animation-renderer-impl.cpp index a4661be..14dedc3 100644 --- a/adaptors/common/vector-animation-renderer-impl.cpp +++ b/adaptors/common/vector-animation-renderer-impl.cpp @@ -60,9 +60,14 @@ VectorAnimationRenderer::~VectorAnimationRenderer() { } -void VectorAnimationRenderer::Initialize( const std::string& url, Dali::Renderer renderer, uint32_t width, uint32_t height ) +void VectorAnimationRenderer::Initialize( const std::string& url ) { - mPlugin.CreateRenderer( url, renderer, width, height ); + mPlugin.SetUrl( url ); +} + +void VectorAnimationRenderer::SetRenderer( Dali::Renderer renderer ) +{ + mPlugin.SetRenderer( renderer ); } void VectorAnimationRenderer::SetSize( uint32_t width, uint32_t height ) diff --git a/adaptors/common/vector-animation-renderer-impl.h b/adaptors/common/vector-animation-renderer-impl.h index 32243f6..45eecc0 100755 --- a/adaptors/common/vector-animation-renderer-impl.h +++ b/adaptors/common/vector-animation-renderer-impl.h @@ -54,7 +54,12 @@ public: /** * @brief Initializes member data. */ - void Initialize( const std::string& url, Dali::Renderer renderer, uint32_t width, uint32_t height ); + void Initialize( const std::string& url ); + + /** + * @copydoc Dali::VectorAnimationRenderer::SetRenderer() + */ + void SetRenderer( Dali::Renderer renderer ); /** * @copydoc Dali::VectorAnimationRenderer::SetSize() diff --git a/adaptors/common/vector-animation-renderer-plugin-proxy.cpp b/adaptors/common/vector-animation-renderer-plugin-proxy.cpp index 848fb23..9a8666c 100644 --- a/adaptors/common/vector-animation-renderer-plugin-proxy.cpp +++ b/adaptors/common/vector-animation-renderer-plugin-proxy.cpp @@ -100,13 +100,20 @@ void VectorAnimationRendererPluginProxy::Initialize() } } -bool VectorAnimationRendererPluginProxy::CreateRenderer( const std::string& url, Dali::Renderer renderer, uint32_t width, uint32_t height ) +void VectorAnimationRendererPluginProxy::SetUrl( const std::string& url ) { if( mPlugin ) { - return mPlugin->CreateRenderer( url, renderer, width, height ); + mPlugin->SetUrl( url ); + } +} + +void VectorAnimationRendererPluginProxy::SetRenderer( Dali::Renderer renderer ) +{ + if( mPlugin ) + { + mPlugin->SetRenderer( renderer ); } - return false; } void VectorAnimationRendererPluginProxy::SetSize( uint32_t width, uint32_t height ) diff --git a/adaptors/common/vector-animation-renderer-plugin-proxy.h b/adaptors/common/vector-animation-renderer-plugin-proxy.h index c0e7dbd..694cb6a 100644 --- a/adaptors/common/vector-animation-renderer-plugin-proxy.h +++ b/adaptors/common/vector-animation-renderer-plugin-proxy.h @@ -48,9 +48,14 @@ public: ~VectorAnimationRendererPluginProxy(); /** - * @copydoc Dali::VectorAnimationRendererPlugin::CreateRenderer() + * @copydoc Dali::VectorAnimationRendererPlugin::SetUrl() */ - bool CreateRenderer( const std::string& url, Dali::Renderer renderer, uint32_t width, uint32_t height ); + void SetUrl( const std::string& url ); + + /** + * @copydoc Dali::VectorAnimationRendererPlugin::SetRenderer() + */ + void SetRenderer( Dali::Renderer renderer ); /** * @copydoc Dali::VectorAnimationRendererPlugin::SetSize() diff --git a/adaptors/devel-api/adaptor-framework/vector-animation-renderer-plugin.h b/adaptors/devel-api/adaptor-framework/vector-animation-renderer-plugin.h index bb4ef85..61544ca 100644 --- a/adaptors/devel-api/adaptor-framework/vector-animation-renderer-plugin.h +++ b/adaptors/devel-api/adaptor-framework/vector-animation-renderer-plugin.h @@ -45,15 +45,18 @@ public: virtual ~VectorAnimationRendererPlugin() {} /** - * @brief Creates a renderer to render an vector animation file. + * @brief Sets the url of the animation file. * - * @param[in] url The url of an animation file - * @param[in] renderer The renderer used to render the image - * @param[in] width The target image width - * @param[in] height The target image height - * @return True if the renderer is successfully created, false otherwise + * @param[in] url The url of the animation file + */ + virtual void SetUrl( const std::string& url ) = 0; + + /** + * @brief Sets the renderer used to display the result image. + * + * @param[in] renderer The renderer used to display the result image */ - virtual bool CreateRenderer( const std::string& url, Renderer renderer, uint32_t width, uint32_t height ) = 0; + virtual void SetRenderer( Renderer renderer ) = 0; /** * @brief Sets the target image size. diff --git a/adaptors/devel-api/adaptor-framework/vector-animation-renderer.cpp b/adaptors/devel-api/adaptor-framework/vector-animation-renderer.cpp index acec34b..160f2b2 100755 --- a/adaptors/devel-api/adaptor-framework/vector-animation-renderer.cpp +++ b/adaptors/devel-api/adaptor-framework/vector-animation-renderer.cpp @@ -24,12 +24,12 @@ namespace Dali { -VectorAnimationRenderer VectorAnimationRenderer::New( const std::string& url, Renderer renderer, uint32_t width, uint32_t height ) +VectorAnimationRenderer VectorAnimationRenderer::New( const std::string& url ) { Internal::Adaptor::VectorAnimationRendererPtr animationRenderer = Internal::Adaptor::VectorAnimationRenderer::New(); if( animationRenderer ) { - animationRenderer->Initialize( url, renderer, width, height ); + animationRenderer->Initialize( url ); } return VectorAnimationRenderer( animationRenderer.Get() ); @@ -59,6 +59,11 @@ VectorAnimationRenderer& VectorAnimationRenderer::operator=( const VectorAnimati return *this; } +void VectorAnimationRenderer::SetRenderer( Renderer renderer ) +{ + GetImplementation( *this ).SetRenderer( renderer ); +} + void VectorAnimationRenderer::SetSize( uint32_t width, uint32_t height ) { GetImplementation( *this ).SetSize( width, height ); diff --git a/adaptors/devel-api/adaptor-framework/vector-animation-renderer.h b/adaptors/devel-api/adaptor-framework/vector-animation-renderer.h index 97bff19..6d1a2bb 100755 --- a/adaptors/devel-api/adaptor-framework/vector-animation-renderer.h +++ b/adaptors/devel-api/adaptor-framework/vector-animation-renderer.h @@ -48,12 +48,9 @@ public: * @brief Creates an initialized handle to a new VectorAnimationRenderer. * * @param[in] url The url of the vector animation file - * @param[in] renderer The renderer used to render the image - * @param[in] width The width of the content - * @param[in] height The height of the content * @return A handle to a newly allocated VectorAnimationRenderer */ - static VectorAnimationRenderer New( const std::string& url, Renderer renderer, uint32_t width, uint32_t height ); + static VectorAnimationRenderer New( const std::string& url ); /** * @brief Creates an empty handle. @@ -82,6 +79,13 @@ public: VectorAnimationRenderer& operator=( const VectorAnimationRenderer& rhs ); /** + * @brief Sets the renderer used to display the result image. + * + * @param[in] renderer The renderer used to display the result image + */ + void SetRenderer( Renderer renderer ); + + /** * @brief Sets the target image size. * * @param[in] width The target image width