From 273caef33139ed32833d98938a032f9204e20857 Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Mon, 4 Nov 2019 19:03:36 +0900 Subject: [PATCH] Revert "[Tizen] (Vector) Use Processor to reduce delay" This reverts commit 7445d20727fb9614e6472355a8e49d5426588e51. Change-Id: I47d322124c9fb5277fd4b72f889104c6c1e894c1 --- .../tizen-vector-animation-renderer.cpp | 54 +++++++--------------- .../tizen-vector-animation-renderer.h | 14 ++---- 2 files changed, 19 insertions(+), 49 deletions(-) diff --git a/dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.cpp b/dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.cpp index c57f9f1..416041d 100755 --- a/dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.cpp +++ b/dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.cpp @@ -21,7 +21,6 @@ // EXTERNAL INCLUDES #include #include -#include #include #include #include // for strlen() @@ -68,8 +67,7 @@ TizenVectorAnimationRenderer::TizenVectorAnimationRenderer() mDefaultHeight( 0 ), mFrameRate( 60.0f ), mResourceReady( false ), - mShaderChanged( false ), - mResourceReadyTriggered( false ) + mShaderChanged( false ) { } @@ -78,11 +76,6 @@ TizenVectorAnimationRenderer::~TizenVectorAnimationRenderer() Dali::Mutex::ScopedLock lock( mMutex ); ResetBuffers(); - - if( Adaptor::IsAvailable() ) - { - Adaptor::Get().UnregisterProcessor( *this ); - } } bool TizenVectorAnimationRenderer::Initialize( const std::string& url ) @@ -104,8 +97,6 @@ bool TizenVectorAnimationRenderer::Initialize( const std::string& url ) mDefaultWidth = static_cast< uint32_t >( w ); mDefaultHeight = static_cast< uint32_t >( h ); - Adaptor::Get().RegisterProcessor( *this ); - DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::Initialize: file [%s] [%p]\n", url.c_str(), this ); return true; @@ -166,10 +157,10 @@ void TizenVectorAnimationRenderer::SetSize( uint32_t width, uint32_t height ) bool TizenVectorAnimationRenderer::Render( uint32_t frameNumber ) { - Dali::Mutex::ScopedLock lock( mMutex ); - if( tbm_surface_queue_can_dequeue( mTbmQueue, 0 ) ) { + Dali::Mutex::ScopedLock lock( mMutex ); + tbm_surface_h tbmSurface; if( tbm_surface_queue_dequeue( mTbmQueue, &tbmSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE ) @@ -228,16 +219,17 @@ bool TizenVectorAnimationRenderer::Render( uint32_t frameNumber ) mRenderedTexture = mTexture; mResourceReady = true; - mResourceReadyTriggered = true; mResourceReadyTrigger->Trigger(); DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::Render: Resource ready [current = %d] [%p]\n", frameNumber, this ); } - - return true; + } + else + { + return false; } - return false; + return true; } uint32_t TizenVectorAnimationRenderer::GetTotalFrameNumber() const @@ -258,10 +250,8 @@ void TizenVectorAnimationRenderer::GetDefaultSize( uint32_t& width, uint32_t& he DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::GetDefaultSize: width = %d, height = %d [%p]\n", width, height, this ); } -void TizenVectorAnimationRenderer::GetLayerInfo( Property::Map& map ) +void TizenVectorAnimationRenderer::GetLayerInfo( Property::Map& map ) const { - Dali::Mutex::ScopedLock lock( mMutex ); - auto layerInfo = mVectorRenderer->layers(); for( auto&& iter : layerInfo ) @@ -278,11 +268,6 @@ VectorAnimationRendererPlugin::UploadCompletedSignalType& TizenVectorAnimationRe return mUploadCompletedSignal; } -void TizenVectorAnimationRenderer::Process() -{ - OnResourceReady(); -} - void TizenVectorAnimationRenderer::SetShader() { if( mShaderChanged ) @@ -356,23 +341,16 @@ void TizenVectorAnimationRenderer::ResetBuffers() void TizenVectorAnimationRenderer::OnResourceReady() { - Dali::Mutex::ScopedLock lock( mMutex ); + DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::OnResourceReady: Set Texture [%p]\n", this ); - if( mResourceReadyTriggered ) + // Set texture + if( mRenderer ) { - DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::OnResourceReady: Set Texture [%p]\n", this ); - - // Set texture - if( mRenderer ) - { - TextureSet textureSet = mRenderer.GetTextures(); - textureSet.SetTexture( 0, mRenderedTexture ); - } - - mResourceReadyTriggered = false; - - mUploadCompletedSignal.Emit(); + TextureSet textureSet = mRenderer.GetTextures(); + textureSet.SetTexture( 0, mRenderedTexture ); } + + mUploadCompletedSignal.Emit(); } } // namespace Plugin diff --git a/dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.h b/dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.h index e9f6213..9b61e01 100755 --- a/dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.h +++ b/dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.h @@ -19,12 +19,12 @@ */ // EXTERNAL INCLUDES +#include #include #include #include #include #include -#include #include #include #include @@ -39,7 +39,7 @@ namespace Plugin /** * @brief Implementation of the Tizen vector animation renderer class which has Tizen platform dependency. */ -class TizenVectorAnimationRenderer : public Dali::VectorAnimationRendererPlugin, public Integration::Processor +class TizenVectorAnimationRenderer : public Dali::VectorAnimationRendererPlugin { public: @@ -91,20 +91,13 @@ public: /** * @copydoc Dali::VectorAnimationRendererPlugin::GetLayerInfo() */ - void GetLayerInfo( Property::Map& map ) override; + void GetLayerInfo( Property::Map& map ) const override; /** * @copydoc Dali::VectorAnimationRendererPlugin::UploadCompletedSignal() */ UploadCompletedSignalType& UploadCompletedSignal() override; -protected: // Implementation of Processor - - /** - * @copydoc Dali::Integration::Processor::Process() - */ - void Process() override; - private: /** @@ -145,7 +138,6 @@ private: float mFrameRate; ///< The frame rate of the content bool mResourceReady; ///< Whether the resource is ready bool mShaderChanged; ///< Whether the shader is changed to support native image - bool mResourceReadyTriggered;///< Whether the resource ready is triggered }; } // namespace Plugin -- 2.7.4