X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftoolkit-vector-animation-renderer.cpp;h=fbc24bf8cd401d0c4391231017d74f10e217c941;hb=6b084af87d9a85428fd657c013ec29a8345fb161;hp=003b8eafd23d59021f24575420c708a46a413906;hpb=3ca7994488b0b5e21bbb0d262c5fa2e4c731308b;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp index 003b8ea..fbc24bf 100755 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp @@ -32,23 +32,37 @@ 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; + + if( mWidth != 0 && mHeight != 0 ) + { + Dali::TextureSet textureSet = mRenderer.GetTextures(); + Dali::Texture texture = Dali::Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, mWidth, mHeight ); + textureSet.SetTexture( 0, texture ); + } + } + void SetSize( uint32_t width, uint32_t height ) { mWidth = width; mHeight = height; - } - bool StartRender() - { - return true; + if( mRenderer ) + { + Dali::TextureSet textureSet = mRenderer.GetTextures(); + Dali::Texture texture = Dali::Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, mWidth, mHeight ); + textureSet.SetTexture( 0, texture ); + } } void StopRender() @@ -59,18 +73,28 @@ public: { } - uint32_t GetTotalFrameNumber() + uint32_t GetTotalFrameNumber() const { return 5; } + float GetFrameRate() const + { + return 60.0f; + } + + void GetDefaultSize( uint32_t& width, uint32_t& height ) const + { + width = 100; + height = 100; + } + public: std::string mUrl; Dali::Renderer mRenderer; uint32_t mWidth; uint32_t mHeight; - }; inline VectorAnimationRenderer& GetImplementation( Dali::VectorAnimationRenderer& renderer ) @@ -96,9 +120,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,14 +151,14 @@ VectorAnimationRenderer& VectorAnimationRenderer::operator=( const VectorAnimati return *this; } -void VectorAnimationRenderer::SetSize( uint32_t width, uint32_t height ) +void VectorAnimationRenderer::SetRenderer( Renderer renderer ) { - Internal::Adaptor::GetImplementation( *this ).SetSize( width, height ); + Internal::Adaptor::GetImplementation( *this ).SetRenderer( renderer ); } -bool VectorAnimationRenderer::StartRender() +void VectorAnimationRenderer::SetSize( uint32_t width, uint32_t height ) { - return Internal::Adaptor::GetImplementation( *this ).StartRender(); + Internal::Adaptor::GetImplementation( *this ).SetSize( width, height ); } void VectorAnimationRenderer::StopRender() @@ -147,10 +171,20 @@ 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(); +} + +void VectorAnimationRenderer::GetDefaultSize( uint32_t& width, uint32_t& height ) const +{ + Internal::Adaptor::GetImplementation( *this ).GetDefaultSize( width, height ); +} + } // namespace Dali;