[4.0] (VectorAnimation) Add a function to change a Renderer 17/196517/1
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 2 Jan 2019 02:41:10 +0000 (11:41 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 2 Jan 2019 02:46:25 +0000 (11:46 +0900)
Change-Id: Ib446d1144ba78951be4961115c55800bf69d4ff5

adaptors/common/vector-animation-renderer-impl.cpp
adaptors/common/vector-animation-renderer-impl.h
adaptors/common/vector-animation-renderer-plugin-proxy.cpp
adaptors/common/vector-animation-renderer-plugin-proxy.h
adaptors/devel-api/adaptor-framework/vector-animation-renderer-plugin.h
adaptors/devel-api/adaptor-framework/vector-animation-renderer.cpp
adaptors/devel-api/adaptor-framework/vector-animation-renderer.h

index a4661be..14dedc3 100644 (file)
@@ -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 )
index 32243f6..45eecc0 100755 (executable)
@@ -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()
index 848fb23..9a8666c 100644 (file)
@@ -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 )
index c0e7dbd..694cb6a 100644 (file)
@@ -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()
index bb4ef85..61544ca 100644 (file)
@@ -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.
index acec34b..160f2b2 100755 (executable)
 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 );
index 97bff19..6d1a2bb 100755 (executable)
@@ -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