(Vector) Add a method to load a file 96/253096/2
authorHeeyong Song <heeyong.song@samsung.com>
Thu, 4 Feb 2021 10:34:20 +0000 (19:34 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Tue, 9 Feb 2021 06:10:04 +0000 (15:10 +0900)
Change-Id: Ie5bdf576339e934fa70e523632fc604a084ce5dd

dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.cpp
dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.h

index 771af63..80371de 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -82,7 +82,25 @@ TizenVectorAnimationRenderer::~TizenVectorAnimationRenderer()
   DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::~TizenVectorAnimationRenderer: this = %p\n", this );
 }
 
-bool TizenVectorAnimationRenderer::Initialize( const std::string& url )
+void TizenVectorAnimationRenderer::Finalize()
+{
+  Dali::Mutex::ScopedLock lock( mMutex );
+
+  TizenVectorAnimationManager::Get().RemoveEventHandler( *this );
+
+  mRenderer.Reset();
+  mTexture.Reset();
+  mRenderedTexture.Reset();
+  mPreviousTexture.Reset();
+  mVectorRenderer.reset();
+
+  mTargetSurface = nullptr;
+  mTbmQueue = NULL;
+
+  DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::Finalize: [%p]\n", this );
+}
+
+bool TizenVectorAnimationRenderer::Load(const std::string &url)
 {
   mUrl = url;
 
@@ -103,29 +121,11 @@ bool TizenVectorAnimationRenderer::Initialize( const std::string& url )
 
   TizenVectorAnimationManager::Get().AddEventHandler( *this );
 
-  DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::Initialize: file [%s] [%p]\n", url.c_str(), this );
+  DALI_LOG_RELEASE_INFO("TizenVectorAnimationRenderer::Load: file [%s] [%p]\n", url.c_str(), this);
 
   return true;
 }
 
-void TizenVectorAnimationRenderer::Finalize()
-{
-  Dali::Mutex::ScopedLock lock( mMutex );
-
-  TizenVectorAnimationManager::Get().RemoveEventHandler( *this );
-
-  mRenderer.Reset();
-  mTexture.Reset();
-  mRenderedTexture.Reset();
-  mPreviousTexture.Reset();
-  mVectorRenderer.reset();
-
-  mTargetSurface = nullptr;
-  mTbmQueue = NULL;
-
-  DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::Finalize: [%p]\n", this );
-}
-
 void TizenVectorAnimationRenderer::SetRenderer( Renderer renderer )
 {
   mRenderer = renderer;
index 1a8778c..21d6c3c 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_TIZEN_VECTOR_ANIMATION_RENDERER_PLUGIN_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,14 +55,14 @@ public:
   virtual ~TizenVectorAnimationRenderer();
 
   /**
-   * @copydoc Dali::VectorAnimationRendererPlugin::Initialize()
+   * @copydoc Dali::VectorAnimationRendererPlugin::Finalize()
    */
-  bool Initialize( const std::string& url ) override;
+  void Finalize() override;
 
   /**
-   * @copydoc Dali::VectorAnimationRendererPlugin::Finalize()
+   * @copydoc Dali::VectorAnimationRendererPlugin::Load()
    */
-  void Finalize() override;
+  bool Load(const std::string &url) override;
 
   /**
    * @copydoc Dali::VectorAnimationRendererPlugin::SetRenderer()