Merge "Add SetProperty and GetProperty to Visuals." into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / image / batch-image-visual.cpp
index 12bfdad..46244aa 100644 (file)
@@ -27,7 +27,6 @@
 #include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/rendering/texture.h>
 #include <dali/public-api/rendering/texture-set.h>
-#include <dali/public-api/shader-effects/shader-effect.h>
 #include <dali/public-api/rendering/texture-set.h>
 
 // INTERNAL HEADER
@@ -88,9 +87,8 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
 
 } //unnamed namespace
 
-BatchImageVisual::BatchImageVisual( VisualFactoryCache& factoryCache, ImageAtlasManager& atlasManager )
+BatchImageVisual::BatchImageVisual( VisualFactoryCache& factoryCache )
   : Visual::Base( factoryCache ),
-    mAtlasManager( atlasManager ),
     mDesiredSize()
 {
 }
@@ -169,11 +167,6 @@ void BatchImageVisual::GetNaturalSize( Vector2& naturalSize ) const
   naturalSize = Vector2::ZERO;
 }
 
-void BatchImageVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-}
-
 void BatchImageVisual::InitializeRenderer( const std::string& imageUrl )
 {
   if( imageUrl.empty() )
@@ -191,7 +184,7 @@ void BatchImageVisual::InitializeRenderer( const std::string& imageUrl )
   {
     if( !mImpl->mRenderer )
     {
-      TextureSet textureSet = mAtlasManager.Add(
+      TextureSet textureSet = mFactoryCache.GetAtlasManager()->Add(
             mAtlasRect,
             imageUrl,
             mDesiredSize );
@@ -233,6 +226,8 @@ void BatchImageVisual::DoSetOnStage( Actor& actor )
   }
   // Turn batching on, to send message it must be on stage
   mImpl->mRenderer.SetProperty( Dali::Renderer::Property::BATCHING_ENABLED, true );
+
+  actor.AddRenderer( mImpl->mRenderer );
 }
 
 void BatchImageVisual::DoSetOffStage( Actor& actor )
@@ -264,6 +259,17 @@ void BatchImageVisual::DoCreatePropertyMap( Property::Map& map ) const
   }
 }
 
+void BatchImageVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue )
+{
+  // TODO
+}
+
+Dali::Property::Value BatchImageVisual::DoGetProperty( Dali::Property::Index index )
+{
+  // TODO
+  return Dali::Property::Value();
+}
+
 Shader BatchImageVisual::GetBatchShader( VisualFactoryCache& factoryCache )
 {
   Shader shader = factoryCache.GetShader( VisualFactoryCache::BATCH_IMAGE_SHADER );
@@ -281,7 +287,7 @@ void BatchImageVisual::CleanCache(const std::string& url)
   mImpl->mRenderer.Reset();
   if( mFactoryCache.CleanRendererCache( url ) )
   {
-    mAtlasManager.Remove( textureSet, mAtlasRect );
+    mFactoryCache.GetAtlasManager()->Remove( textureSet, mAtlasRect );
   }
 }