(Vector) Add CONTENT_INFO property 02/215602/2
authorHeeyong Song <heeyong.song@samsung.com>
Fri, 11 Oct 2019 08:37:52 +0000 (17:37 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 14 Oct 2019 03:57:33 +0000 (03:57 +0000)
Change-Id: I6eeb4b1a92add77f38e116a4e11b58c7acb5713a

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp
automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp
dali-toolkit/devel-api/visuals/image-visual-properties-devel.h
dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h

index 344280a..f8c0c36 100755 (executable)
@@ -108,6 +108,10 @@ public:
     height = 100;
   }
 
     height = 100;
   }
 
+  void GetLayerInfo( Property::Map& map ) const
+  {
+  }
+
   Dali::VectorAnimationRenderer::UploadCompletedSignalType& UploadCompletedSignal()
   {
     return mUploadCompletedSignal;
   Dali::VectorAnimationRenderer::UploadCompletedSignalType& UploadCompletedSignal()
   {
     return mUploadCompletedSignal;
@@ -212,6 +216,11 @@ void VectorAnimationRenderer::GetDefaultSize( uint32_t& width, uint32_t& height
   Internal::Adaptor::GetImplementation( *this ).GetDefaultSize( width, height );
 }
 
   Internal::Adaptor::GetImplementation( *this ).GetDefaultSize( width, height );
 }
 
+void VectorAnimationRenderer::GetLayerInfo( Property::Map& map ) const
+{
+  Internal::Adaptor::GetImplementation( *this ).GetLayerInfo( map );
+}
+
 VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
 {
   return Internal::Adaptor::GetImplementation( *this ).UploadCompletedSignal();
 VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
 {
   return Internal::Adaptor::GetImplementation( *this ).UploadCompletedSignal();
index 794a0cd..096b960 100644 (file)
@@ -297,6 +297,9 @@ int UtcDaliAnimatedVectorImageVisualGetPropertyMap01(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::LoopingMode::RESTART );
 
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::LoopingMode::RESTART );
 
+  value = resultMap.Find( DevelImageVisual::Property::CONTENT_INFO, Property::MAP );
+  DALI_TEST_CHECK( value );
+
   // request AnimatedVectorImageVisual with an URL
   Visual::Base visual2 = factory.CreateVisual( TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions() );
 
   // request AnimatedVectorImageVisual with an URL
   Visual::Base visual2 = factory.CreateVisual( TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions() );
 
index 306880b..1c54511 100644 (file)
@@ -128,7 +128,16 @@ enum Type
    * @details Name "loopingMode", Type LoopingMode::Type (Property::INTEGER)
    * @note Default value is LoopingMode::RESTART.
    */
    * @details Name "loopingMode", Type LoopingMode::Type (Property::INTEGER)
    * @note Default value is LoopingMode::RESTART.
    */
-  LOOPING_MODE = ORIENTATION_CORRECTION + 9
+  LOOPING_MODE = ORIENTATION_CORRECTION + 9,
+
+  /**
+   * @brief The content information the AnimatedVectorImageVisual will use.
+   * @details Name "contentInfo", Type Property::MAP.
+   * The map contains the layer name as a key and Property::Array as a value.
+   * And the array contains 2 integer values which are the frame numbers, the start frame number and the end frame number of the layer.
+   * @note This property is read-only.
+   */
+  CONTENT_INFO = ORIENTATION_CORRECTION + 10
 };
 
 } //namespace Property
 };
 
 } //namespace Property
index de415df..16203e7 100644 (file)
@@ -161,6 +161,10 @@ void AnimatedVectorImageVisual::DoCreatePropertyMap( Property::Map& map ) const
 
   map.Insert( Toolkit::DevelImageVisual::Property::STOP_BEHAVIOR, mStopBehavior );
   map.Insert( Toolkit::DevelImageVisual::Property::LOOPING_MODE, mLoopingMode );
 
   map.Insert( Toolkit::DevelImageVisual::Property::STOP_BEHAVIOR, mStopBehavior );
   map.Insert( Toolkit::DevelImageVisual::Property::LOOPING_MODE, mLoopingMode );
+
+  Property::Map layerInfo;
+  mVectorAnimationTask->GetLayerInfo( layerInfo );
+  map.Insert( Toolkit::DevelImageVisual::Property::CONTENT_INFO, layerInfo );
 }
 
 void AnimatedVectorImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
 }
 
 void AnimatedVectorImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
index 0445df7..7af08ac 100644 (file)
@@ -317,6 +317,11 @@ void VectorAnimationTask::SetLoopingMode( DevelImageVisual::LoopingMode::Type lo
   DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::SetLoopingMode: looping mode = %d [%p]\n", mLoopingMode, this );
 }
 
   DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::SetLoopingMode: looping mode = %d [%p]\n", mLoopingMode, this );
 }
 
+void VectorAnimationTask::GetLayerInfo( Property::Map& map ) const
+{
+  mVectorRenderer.GetLayerInfo( map );
+}
+
 VectorAnimationTask::UploadCompletedSignalType& VectorAnimationTask::UploadCompletedSignal()
 {
   return mVectorRenderer.UploadCompletedSignal();
 VectorAnimationTask::UploadCompletedSignalType& VectorAnimationTask::UploadCompletedSignal()
 {
   return mVectorRenderer.UploadCompletedSignal();
index c13b4d3..4f6f83a 100644 (file)
@@ -169,6 +169,12 @@ public:
   void SetLoopingMode( DevelImageVisual::LoopingMode::Type loopingMode );
 
   /**
   void SetLoopingMode( DevelImageVisual::LoopingMode::Type loopingMode );
 
   /**
+   * @brief Gets the layer information of all the child layers.
+   * @param[out] map The layer information
+   */
+  void GetLayerInfo( Property::Map& map ) const;
+
+  /**
    * @brief Connect to this signal to be notified when the texture upload is completed.
    * @return The signal to connect to.
    */
    * @brief Connect to this signal to be notified when the texture upload is completed.
    * @return The signal to connect to.
    */