Set mParsedImage of svg-visual 63/223463/2
authorhuiyu.eun <huiyu.eun@samsung.com>
Thu, 30 Jan 2020 03:13:50 +0000 (12:13 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Thu, 30 Jan 2020 05:59:04 +0000 (14:59 +0900)
Change-Id: I76eb44ee5862968ddb6cb4049c62b8cb78a0bedd
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
dali-toolkit/internal/visuals/svg/svg-visual.cpp

index 5b58193..0124b73 100644 (file)
@@ -2406,21 +2406,28 @@ int UtcDaliImageViewLoadRemoteSVG(void)
   tet_infoline("Test reloading failed image from within signal handler.");
 
   ToolkitTestApplication application;
   tet_infoline("Test reloading failed image from within signal handler.");
 
   ToolkitTestApplication application;
-  Toolkit::ImageView mImageView;
-  mImageView = Toolkit::ImageView::New(  );
-  mImageView.SetImage("http://bar.org/foobar.svg");
-  mImageView.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  mImageView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  mImageView.SetSize(300, 300);
-  mImageView.SetPosition( Vector3( 150.0f , 150.0f , 0.0f ) );
+  Toolkit::ImageView imageView;
+  imageView = Toolkit::ImageView::New(  );
+  imageView.SetImage("https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/check.svg");
+  imageView.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  imageView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  imageView.SetSize(300, 300);
+  imageView.SetPosition( Vector3( 150.0f , 150.0f , 0.0f ) );
+
+  Stage::GetCurrent().Add( imageView );
+
+  DALI_TEST_CHECK( imageView );
 
 
-  Stage::GetCurrent().Add( mImageView );
+  DALI_TEST_EQUALS( imageView.GetRendererCount(), 0u, TEST_LOCATION );
 
   application.SendNotification();
 
   application.SendNotification();
-  application.Render();
+
   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
 
   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
 
-  DALI_TEST_CHECK( mImageView );
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( imageView.GetRendererCount(), 1u, TEST_LOCATION );
 
   END_TEST;
 }
 
   END_TEST;
 }
index 051affe..7a03e72 100644 (file)
@@ -224,6 +224,11 @@ void SvgVisual::AddRasterizationTask( const Vector2& size )
 
 void SvgVisual::ApplyRasterizedImage( NSVGimage* parsedSvg, PixelData rasterizedPixelData )
 {
 
 void SvgVisual::ApplyRasterizedImage( NSVGimage* parsedSvg, PixelData rasterizedPixelData )
 {
+  if( mParsedImage == NULL)
+  {
+    mParsedImage = parsedSvg;
+  }
+
   if( mParsedImage && IsOnStage() )
   {
     TextureSet currentTextureSet = mImpl->mRenderer.GetTextures();
   if( mParsedImage && IsOnStage() )
   {
     TextureSet currentTextureSet = mImpl->mRenderer.GetTextures();