Revert "[3.0](SvgVisual)Stop displaying garbage pixels before rasterization getting... 29/97729/1
authordongsug.song <dongsug.song@samsung.com>
Tue, 15 Nov 2016 02:36:57 +0000 (11:36 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Tue, 15 Nov 2016 02:37:02 +0000 (11:37 +0900)
This reverts commit 10576a91d24845a158f4ab2887d6a0bb42813ab4.

Change-Id: Id9d0ccfd904e1928f72b8d68582c3a8380ae777f

22 files changed:
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
dali-toolkit/devel-api/visual-factory/visual-base.h
dali-toolkit/internal/visuals/border/border-visual.cpp
dali-toolkit/internal/visuals/border/border-visual.h
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.h
dali-toolkit/internal/visuals/gradient/gradient-visual.cpp
dali-toolkit/internal/visuals/gradient/gradient-visual.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/image/image-visual.h
dali-toolkit/internal/visuals/mesh/mesh-visual.cpp
dali-toolkit/internal/visuals/mesh/mesh-visual.h
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.h
dali-toolkit/internal/visuals/primitive/primitive-visual.cpp
dali-toolkit/internal/visuals/primitive/primitive-visual.h
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/internal/visuals/svg/svg-visual.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp
dali-toolkit/internal/visuals/wireframe/wireframe-visual.h

index 15058d9..7a6f4c2 100644 (file)
@@ -953,8 +953,7 @@ int UtcDaliVisualFactoryGetSvgVisual(void)
   application.SendNotification();
   application.Render();
 
-  // renderer is not added to actor until the rasterization is completed.
-  DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
 
   EventThreadCallback* eventTrigger = EventThreadCallback::Get();
   CallbackBase* callback = eventTrigger->GetCallback();
@@ -962,7 +961,6 @@ int UtcDaliVisualFactoryGetSvgVisual(void)
   eventTrigger->WaitingForTrigger( 1 );// waiting until the svg image is rasterized.
   CallbackBase::Execute( *callback );
 
-  // renderer is added to actor
   DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
 
   // waiting for the resource uploading
index 74ca640..40864e5 100644 (file)
@@ -116,7 +116,7 @@ public:
   float GetDepthIndex() const;
 
   /**
-   * @brief Visual needs to know when the control is put on to the stage to add the renderer.
+   * @brief Visual needs to know when when the control is put on to the stage to add the renderer.
    *
    * This function should be called when the control is put on to the stage.
    *
@@ -126,7 +126,7 @@ public:
   void SetOnStage( Actor& actor );
 
   /**
-   * @brief Visual needs to know when the control is removed from the stage to remove the renderer.
+   * @brief Visual needs to know when when the control is removed from the stage to remove the renderer.
    *
    * This function should be called when the control is removed from the stage
    *
index 8718bce..a56402f 100644 (file)
@@ -154,8 +154,6 @@ void BorderVisual::DoSetOnStage( Actor& actor )
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
   mBorderSizeIndex = (mImpl->mRenderer).RegisterProperty( SIZE_NAME, mBorderSize );
-
-  actor.AddRenderer( mImpl->mRenderer );
 }
 
 void BorderVisual::DoCreatePropertyMap( Property::Map& map ) const
index 98392f2..6973a79 100644 (file)
@@ -64,24 +64,24 @@ public:
 public:  // from Visual
 
   /**
-   * @copydoc Visual::Base::SetClipRect
+   * @copydoc Visual::SetClipRect
    */
   virtual void SetClipRect( const Rect<int>& clipRect );
 
 protected:
 
   /**
-   * @copydoc Visual::Base::DoInitialize
+   * @copydoc Visual::DoInitialize
    */
   virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
 
   /**
-   * @copydoc Visual::Base::DoSetOnStage
+   * @copydoc Visual::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
 
   /**
-   * @copydoc Visual::Base::CreatePropertyMap
+   * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
index 32a7e93..17cf68a 100644 (file)
@@ -106,8 +106,6 @@ void ColorVisual::SetOffset( const Vector2& offset )
 void ColorVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
-
-  actor.AddRenderer( mImpl->mRenderer );
 }
 
 void ColorVisual::DoCreatePropertyMap( Property::Map& map ) const
index 0e952aa..f458152 100644 (file)
@@ -58,34 +58,34 @@ public:
 public:  // from Visual
 
   /**
-   * @copydoc Visual::Base::SetSize
+   * @copydoc Visual::SetSize
    */
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::Base::SetClipRect
+   * @copydoc Visual::SetClipRect
    */
   virtual void SetClipRect( const Rect<int>& clipRect );
 
   /**
-   * @copydoc Visual::Base::SetOffset
+   * @copydoc Visual::SetOffset
    */
   virtual void SetOffset( const Vector2& offset );
 
   /**
-   * @copydoc Visual::Base::CreatePropertyMap
+   * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
 protected:
 
   /**
-   * @copydoc Visual::Base::DoInitialize
+   * @copydoc Visual::DoInitialize
    */
   virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
 
   /**
-   * @copydoc Visual::Base::DoSetOnStage
+   * @copydoc Visual::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
 
index 8afdb1e..22f9026 100644 (file)
@@ -244,8 +244,6 @@ void GradientVisual::SetOffset( const Vector2& offset )
 void GradientVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
-
-  actor.AddRenderer( mImpl->mRenderer );
 }
 
 void GradientVisual::DoCreatePropertyMap( Property::Map& map ) const
index 714ba7b..be191be 100644 (file)
@@ -94,33 +94,33 @@ public:
 public:  // from Visual
 
   /**
-   * @copydoc Visual::Base::SetSize
+   * @copydoc Visual::SetSize
    */
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::Base::SetClipRect
+   * @copydoc Visual::SetClipRect
    */
   virtual void SetClipRect( const Rect<int>& clipRect );
 
   /**
-   * @copydoc Visual::Base::SetOffset
+   * @copydoc Visual::SetOffset
    */
   virtual void SetOffset( const Vector2& offset );
 
   /**
-   * @copydoc Visual::Base::CreatePropertyMap
+   * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
 protected:
   /**
-   * @copydoc Visual::Base::DoInitialize
+   * @copydoc Visual::DoInitialize
    */
   virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
 
   /**
-   * @copydoc Visual::Base::DoSetOnStage
+   * @copydoc Visual::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
 
index 98f9734..64b0965 100644 (file)
@@ -501,8 +501,6 @@ void ImageVisual::DoSetOnStage( Actor& actor )
   {
     InitializeRenderer( mImage );
   }
-
-  actor.AddRenderer( mImpl->mRenderer );
 }
 
 void ImageVisual::DoSetOffStage( Actor& actor )
index 57c7016..baad92f 100644 (file)
@@ -93,43 +93,43 @@ public:
 public:  // from Visual
 
   /**
-   * @copydoc Visual::Base::SetSize
+   * @copydoc Visual::SetSize
    */
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::Base::GetNaturalSize
+   * @copydoc Visual::GetNaturalSize
    */
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * @copydoc Visual::Base::SetClipRect
+   * @copydoc Visual::SetClipRect
    */
   virtual void SetClipRect( const Rect<int>& clipRect );
 
   /**
-   * @copydoc Visual::Base::SetOffset
+   * @copydoc Visual::SetOffset
    */
   virtual void SetOffset( const Vector2& offset );
 
   /**
-   * @copydoc Visual::Base::CreatePropertyMap
+   * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
 protected:
   /**
-   * @copydoc Visual::Base::DoInitialize
+   * @copydoc Visual::DoInitialize
    */
   virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
 
   /**
-   * @copydoc Visual::Base::DoSetOnStage
+   * @copydoc Visual::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
 
   /**
-   * @copydoc Visual::Base::DoSetOffStage
+   * @copydoc Visual::DoSetOffStage
    */
   virtual void DoSetOffStage( Actor& actor );
 
index d16be55..af8c30d 100644 (file)
@@ -384,8 +384,6 @@ void MeshVisual::SetOffset( const Vector2& offset )
 void MeshVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
-
-  actor.AddRenderer( mImpl->mRenderer );
 }
 
 void MeshVisual::DoCreatePropertyMap( Property::Map& map ) const
index d1852e9..b801ce8 100644 (file)
@@ -70,34 +70,34 @@ public:
 public:  // from Visual
 
   /**
-   * @copydoc Visual::Base::SetSize
+   * @copydoc Visual::SetSize
    */
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::Base::SetClipRect
+   * @copydoc Visual::SetClipRect
    */
   virtual void SetClipRect( const Rect<int>& clipRect );
 
   /**
-   * @copydoc Visual::Base::SetOffset
+   * @copydoc Visual::SetOffset
    */
   virtual void SetOffset( const Vector2& offset );
 
   /**
-   * @copydoc Visual::Base::CreatePropertyMap
+   * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
 protected:
 
   /**
-   * @copydoc Visual::Base::DoInitialize
+   * @copydoc Visual::DoInitialize
    */
   virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
 
   /**
-   * @copydoc Visual::Base::DoSetOnStage
+   * @copydoc Visual::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
 
index 56a75e5..fb13383 100644 (file)
@@ -390,8 +390,6 @@ void NPatchVisual::DoSetOnStage( Actor& actor )
   {
     ApplyImageToSampler();
   }
-
-  actor.AddRenderer( mImpl->mRenderer );
 }
 
 void NPatchVisual::DoSetOffStage( Actor& actor )
index c4dcbc3..b51bf7f 100644 (file)
@@ -68,39 +68,39 @@ public:
 public:  // from Visual
 
   /**
-   * @copydoc Visual::Base::GetNaturalSize
+   * @copydoc Visual::GetNaturalSize
    */
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * @copydoc Visual::Base::SetClipRect
+   * @copydoc Visual::SetClipRect
    */
   virtual void SetClipRect( const Rect<int>& clipRect );
 
   /**
-   * @copydoc Visual::Base::SetOffset
+   * @copydoc Visual::SetOffset
    */
   virtual void SetOffset( const Vector2& offset );
 
   /**
-   * @copydoc Visual::Base::CreatePropertyMap
+   * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
 protected:
 
   /**
-   * @copydoc Visual::Base::DoInitialize
+   * @copydoc Visual::DoInitialize
    */
   virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
 
   /**
-   * @copydoc Visual::Base::DoSetOnStage
+   * @copydoc Visual::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
 
   /**
-   * @copydoc Visual::Base::DoSetOffStage
+   * @copydoc Visual::DoSetOffStage
    */
   virtual void DoSetOffStage( Actor& actor );
 
index 841f507..212b43b 100644 (file)
@@ -395,8 +395,6 @@ void PrimitiveVisual::SetOffset( const Vector2& offset )
 void PrimitiveVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
-
-  actor.AddRenderer( mImpl->mRenderer );
 }
 
 void PrimitiveVisual::DoCreatePropertyMap( Property::Map& map ) const
index dd440fc..01b5885 100644 (file)
@@ -111,39 +111,39 @@ public:
 public:  // from Visual
 
   /**
-   * @copydoc Visual::Base::SetSize
+   * @copydoc Visual::SetSize
    */
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::Base::GetNaturalSize
+   * @copydoc Visual::GetNaturalSize
    */
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * @copydoc Visual::Base::SetClipRect
+   * @copydoc Visual::SetClipRect
    */
   virtual void SetClipRect( const Rect<int>& clipRect );
 
   /**
-   * @copydoc Visual::Base::SetOffset
+   * @copydoc Visual::SetOffset
    */
   virtual void SetOffset( const Vector2& offset );
 
   /**
-   * @copydoc Visual::Base::CreatePropertyMap
+   * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
 protected:
 
   /**
-   * @copydoc Visual::Base::DoInitialize
+   * @copydoc Visual::DoInitialize
    */
   virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
 
   /**
-   * @copydoc Visual::Base::DoSetOnStage
+   * @copydoc Visual::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
 
index 2d6a263..f73df9f 100644 (file)
@@ -109,9 +109,6 @@ void SvgVisual::DoSetOnStage( Actor& actor )
   {
     AddRasterizationTask( mImpl->mSize );
   }
-
-  // Hold the weak handle of the placement actor and delay the adding of renderer until the svg rasterization is finished.
-  mPlacementActor = actor;
 }
 
 void SvgVisual::DoSetOffStage( Actor& actor )
@@ -120,7 +117,6 @@ void SvgVisual::DoSetOffStage( Actor& actor )
 
   actor.RemoveRenderer( mImpl->mRenderer );
   mImpl->mRenderer.Reset();
-  mPlacementActor.Reset();
 }
 
 void SvgVisual::GetNaturalSize( Vector2& naturalSize ) const
@@ -239,15 +235,6 @@ void SvgVisual::ApplyRasterizedImage( PixelData rasterizedPixelData )
         TextureSetImage( textureSet, 0u, texture );
       }
     }
-
-    // Rasterized pixels are uploaded to texture. If weak handle is holding a placement actor, it is the time to add the renderer to actor.
-    Actor actor = mPlacementActor.GetHandle();
-    if( actor )
-    {
-      actor.AddRenderer( mImpl->mRenderer );
-      // reset the weak handle so that the renderer only get added to actor once
-      mPlacementActor.Reset();
-    }
   }
 }
 
index 70d4bd4..e4e97da 100644 (file)
@@ -18,9 +18,6 @@
  *
  */
 
-//EXTERNAL INCLUDES
-#include <dali/devel-api/object/weak-handle.h>
-
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
 #include <dali-toolkit/internal/visuals/image-atlas-manager.h>
@@ -65,34 +62,34 @@ public:
 public:  // from Visual
 
   /**
-   * @copydoc Visual::Base::GetNaturalSize
+   * @copydoc Visual::GetNaturalSize
    */
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * @copydoc Visual::Base::SetSize
+   * @copydoc Visual::SetSize
    */
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::Base::CreatePropertyMap
+   * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
 protected:
 
   /**
-   * @copydoc Visual::Base::DoInitialize
+   * @copydoc Visual::DoInitialize
    */
   virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
 
   /**
-   * @copydoc Visual::Base::DoSetOnStage
+   * @copydoc Visual::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
 
   /**
-   * @copydoc Visual::Base::DoSetOffStage
+   * @copydoc Visual::DoSetOffStage
    */
   virtual void DoSetOffStage( Actor& actor );
 
@@ -142,7 +139,6 @@ private:
   ImageAtlasManager&   mAtlasManager;
   std::string          mImageUrl;
   NSVGimage*           mParsedImage;
-  WeakHandle<Actor>    mPlacementActor;
 
 };
 
index 5681016..10bce2b 100644 (file)
@@ -117,12 +117,11 @@ float Base::GetDepthIndex() const
 
 void Base::SetOnStage( Actor& actor )
 {
-  // To display the actor correctly, renderer should not be added to actor until all required resources are ready.
-  // Thus the calling of actor.AddRenderer() should happen inside derived class as base class does not know the exact timing.
   DoSetOnStage( actor );
 
   mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled());
   mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex );
+  actor.AddRenderer( mImpl->mRenderer );
   mImpl->mFlags |= Impl::IS_ON_STAGE;
 }
 
@@ -158,6 +157,10 @@ bool Base::IsPreMultipliedAlphaEnabled() const
   return mImpl->mFlags & Impl::IS_PREMULTIPLIED_ALPHA;
 }
 
+void Base::DoSetOnStage( Actor& actor )
+{
+}
+
 void Base::DoSetOffStage( Actor& actor )
 {
   actor.RemoveRenderer( mImpl->mRenderer );
index aa80c03..2622a82 100644 (file)
@@ -189,10 +189,9 @@ protected:
   /**
    * @brief Called by SetOnStage() allowing sub classes to respond to the SetOnStage event
    *
-   * @note The derived class is required to create the renderer, and add it to the actor when all the resources are in place.
    * @param[in] actor The actor applying this visual.
    */
-  virtual void DoSetOnStage( Actor& actor ) = 0;
+  virtual void DoSetOnStage( Actor& actor );
 
   /**
    * @brief Called by SetOffStage() allowing sub classes to respond to the SetOffStage event
index 4299eb6..47474a6 100644 (file)
@@ -76,8 +76,6 @@ WireframeVisual::~WireframeVisual()
 void WireframeVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
-
-  actor.AddRenderer( mImpl->mRenderer );
 }
 
 void WireframeVisual::DoCreatePropertyMap( Property::Map& map ) const
index c0d8682..b14452a 100644 (file)
@@ -53,12 +53,12 @@ public:
 protected:
 
   /**
-   * @copydoc Visual::Base::DoSetOnStage
+   * @copydoc Visual::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
 
   /**
-   * @copydoc Visual::Base::CreatePropertyMap
+   * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;