(AnimatedVectorImageVisual) Render frames based on content's fps
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-vector-animation-renderer.cpp
index 003b8ea..869bbc2 100755 (executable)
@@ -32,14 +32,19 @@ class VectorAnimationRenderer: public Dali::BaseObject
 {
 public:
 
-  VectorAnimationRenderer( const std::string& url, Dali::Renderer renderer, uint32_t width, uint32_t height )
+  VectorAnimationRenderer( const std::string& url )
   : mUrl( url ),
-    mRenderer( renderer ),
-    mWidth( width ),
-    mHeight( height )
+    mRenderer(),
+    mWidth( 0 ),
+    mHeight( 0 )
   {
   }
 
+  void SetRenderer( Dali::Renderer renderer )
+  {
+    mRenderer = renderer;
+  }
+
   void SetSize( uint32_t width, uint32_t height )
   {
     mWidth = width;
@@ -59,11 +64,16 @@ public:
   {
   }
 
-  uint32_t GetTotalFrameNumber()
+  uint32_t GetTotalFrameNumber() const
   {
     return 5;
   }
 
+  float GetFrameRate() const
+  {
+    return 60.0f;
+  }
+
 public:
 
   std::string mUrl;
@@ -96,9 +106,9 @@ inline const VectorAnimationRenderer& GetImplementation( const Dali::VectorAnima
 /*********************************  PUBLIC CLASS  *******************************/
 /********************************************************************************/
 
-VectorAnimationRenderer VectorAnimationRenderer::New( const std::string& url, Renderer renderer, uint32_t width, uint32_t height )
+VectorAnimationRenderer VectorAnimationRenderer::New( const std::string& url )
 {
-  Internal::Adaptor::VectorAnimationRenderer* animationRenderer = new Internal::Adaptor::VectorAnimationRenderer( url, renderer, width, height );
+  Internal::Adaptor::VectorAnimationRenderer* animationRenderer = new Internal::Adaptor::VectorAnimationRenderer( url );
 
   return VectorAnimationRenderer( animationRenderer );
 }
@@ -127,6 +137,11 @@ VectorAnimationRenderer& VectorAnimationRenderer::operator=( const VectorAnimati
   return *this;
 }
 
+void VectorAnimationRenderer::SetRenderer( Renderer renderer )
+{
+  Internal::Adaptor::GetImplementation( *this ).SetRenderer( renderer );
+}
+
 void VectorAnimationRenderer::SetSize( uint32_t width, uint32_t height )
 {
   Internal::Adaptor::GetImplementation( *this ).SetSize( width, height );
@@ -147,10 +162,15 @@ void VectorAnimationRenderer::Render( uint32_t frameNumber )
   Internal::Adaptor::GetImplementation( *this ).Render( frameNumber );
 }
 
-uint32_t VectorAnimationRenderer::GetTotalFrameNumber()
+uint32_t VectorAnimationRenderer::GetTotalFrameNumber() const
 {
   return Internal::Adaptor::GetImplementation( *this ).GetTotalFrameNumber();
 }
 
+float VectorAnimationRenderer::GetFrameRate() const
+{
+  return Internal::Adaptor::GetImplementation( *this ).GetFrameRate();
+}
+
 } // namespace Dali;