From 45d666eb30e44b193fed75edd7907cb95d43a20c Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Tue, 26 Feb 2019 16:31:30 +0900 Subject: [PATCH] (VectorAnimationRenderer) Add GetFrameRate method Change-Id: I48e45c17dc98c8f5e6e69e9b9a2a65be36b2b589 --- .../adaptor-framework/vector-animation-renderer-plugin.h | 11 +++++++++-- .../devel-api/adaptor-framework/vector-animation-renderer.cpp | 7 ++++++- dali/devel-api/adaptor-framework/vector-animation-renderer.h | 9 ++++++++- .../common/vector-animation-renderer-impl.cpp | 7 ++++++- .../vector-animation/common/vector-animation-renderer-impl.h | 7 ++++++- .../common/vector-animation-renderer-plugin-proxy.cpp | 11 ++++++++++- .../common/vector-animation-renderer-plugin-proxy.h | 7 ++++++- 7 files changed, 51 insertions(+), 8 deletions(-) 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 61544ca..b371733 100644 --- a/dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h +++ b/dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h @@ -86,11 +86,18 @@ public: virtual void Render( uint32_t frameNumber ) = 0; /** - * @brief Gets the total number of frames of the file + * @brief Gets the total number of frames of the file. * * @return The total number of frames */ - virtual uint32_t GetTotalFrameNumber() = 0; + virtual uint32_t GetTotalFrameNumber() const = 0; + + /** + * @brief Gets the frame rate of the file. + * + * @return The frame rate of the file + */ + virtual float GetFrameRate() const = 0; /** * @brief Function pointer called in adaptor to create a plugin instance. diff --git a/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp b/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp index b1b9e74..c02bc16 100755 --- a/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp +++ b/dali/devel-api/adaptor-framework/vector-animation-renderer.cpp @@ -84,9 +84,14 @@ void VectorAnimationRenderer::Render( uint32_t frameNumber ) GetImplementation( *this ).Render( frameNumber ); } -uint32_t VectorAnimationRenderer::GetTotalFrameNumber() +uint32_t VectorAnimationRenderer::GetTotalFrameNumber() const { return GetImplementation( *this ).GetTotalFrameNumber(); } +float VectorAnimationRenderer::GetFrameRate() const +{ + return GetImplementation( *this ).GetFrameRate(); +} + } // namespace Dali diff --git a/dali/devel-api/adaptor-framework/vector-animation-renderer.h b/dali/devel-api/adaptor-framework/vector-animation-renderer.h index 64603a5..f7faf21 100755 --- a/dali/devel-api/adaptor-framework/vector-animation-renderer.h +++ b/dali/devel-api/adaptor-framework/vector-animation-renderer.h @@ -120,7 +120,14 @@ public: * * @return The total number of frames */ - uint32_t GetTotalFrameNumber(); + uint32_t GetTotalFrameNumber() const; + + /** + * @brief Gets the frame rate of the file. + * + * @return The frame rate of the file + */ + float GetFrameRate() const; public: // Signals 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 de8140d..0ff6586 100644 --- a/dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp +++ b/dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp @@ -90,11 +90,16 @@ void VectorAnimationRenderer::Render( uint32_t frameNumber ) mPlugin.Render( frameNumber ); } -uint32_t VectorAnimationRenderer::GetTotalFrameNumber() +uint32_t VectorAnimationRenderer::GetTotalFrameNumber() const { return mPlugin.GetTotalFrameNumber(); } +float VectorAnimationRenderer::GetFrameRate() const +{ + return mPlugin.GetFrameRate(); +} + } // namespace Adaptor } // namespace internal 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 a21cf7f..d3e53b4 100755 --- a/dali/internal/vector-animation/common/vector-animation-renderer-impl.h +++ b/dali/internal/vector-animation/common/vector-animation-renderer-impl.h @@ -84,7 +84,12 @@ public: /** * @copydoc Dali::VectorAnimationRenderer::GetTotalFrameNumber() */ - uint32_t GetTotalFrameNumber(); + uint32_t GetTotalFrameNumber() const; + + /** + * @copydoc Dali::VectorAnimationRenderer::GetFrameRate() + */ + float GetFrameRate() const; private: 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 2860f42..6217e1d 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 @@ -149,7 +149,7 @@ void VectorAnimationRendererPluginProxy::Render( uint32_t frameNumber ) } } -uint32_t VectorAnimationRendererPluginProxy::GetTotalFrameNumber() +uint32_t VectorAnimationRendererPluginProxy::GetTotalFrameNumber() const { if( mPlugin ) { @@ -158,6 +158,15 @@ uint32_t VectorAnimationRendererPluginProxy::GetTotalFrameNumber() return 0; } +float VectorAnimationRendererPluginProxy::GetFrameRate() const +{ + if( mPlugin ) + { + return mPlugin->GetFrameRate(); + } + return 0.0f; +} + } // namespace Adaptor } // namespace Internal 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 fe2f636..30e0da3 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 @@ -80,7 +80,12 @@ public: /** * @copydoc Dali::VectorAnimationRendererPlugin::GetTotalFrameNumber() */ - uint32_t GetTotalFrameNumber(); + uint32_t GetTotalFrameNumber() const; + + /** + * @copydoc Dali::VectorAnimationRendererPlugin::GetFrameRate() + */ + float GetFrameRate() const; // Not copyable or movable VectorAnimationRendererPluginProxy( const VectorAnimationRendererPluginProxy& ) = delete; ///< Deleted copy constructor -- 2.7.4