// EXTERNAL INCLUDES
#include <dali/public-api/object/property-array.h>
#include <dali/integration-api/debug.h>
-#include <dali/integration-api/adaptors/adaptor.h>
#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
#include <dali/devel-api/images/native-image-interface-extension.h>
#include <cstring> // for strlen()
mDefaultHeight( 0 ),
mFrameRate( 60.0f ),
mResourceReady( false ),
- mShaderChanged( false ),
- mResourceReadyTriggered( false )
+ mShaderChanged( false )
{
}
Dali::Mutex::ScopedLock lock( mMutex );
ResetBuffers();
-
- if( Adaptor::IsAvailable() )
- {
- Adaptor::Get().UnregisterProcessor( *this );
- }
}
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;
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 )
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
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 )
return mUploadCompletedSignal;
}
-void TizenVectorAnimationRenderer::Process()
-{
- OnResourceReady();
-}
-
void TizenVectorAnimationRenderer::SetShader()
{
if( mShaderChanged )
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
*/
// EXTERNAL INCLUDES
+#include <dali/public-api/math/uint-16-pair.h>
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/devel-api/threading/mutex.h>
#include <dali/devel-api/adaptor-framework/event-thread-callback.h>
#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
#include <dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h>
-#include <dali/integration-api/processor-interface.h>
#include <memory>
#include <rlottie.h>
#include <tbm_surface.h>
/**
* @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:
/**
* @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:
/**
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