#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
}\n
);
-} //unnamed namespace
+} // unnamed namespace
+
+BatchImageVisualPtr BatchImageVisual::New( VisualFactoryCache& factoryCache )
+{
+ return new BatchImageVisual( factoryCache );
+}
BatchImageVisual::BatchImageVisual( VisualFactoryCache& factoryCache )
- : Visual::Base( factoryCache ),
- mDesiredSize()
+: Visual::Base( factoryCache ),
+ mDesiredSize()
{
}
{
}
-void BatchImageVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void BatchImageVisual::DoSetProperties( const Property::Map& propertyMap )
{
std::string oldImageUrl = mImageUrl;
Property::Value* imageURLValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::URL, Dali::Toolkit::Internal::IMAGE_URL_NAME );
mDesiredSize = ImageDimensions( desiredWidth, desiredHeight );
}
-
- // Remove old renderer if exit.
- if( mImpl->mRenderer )
- {
- if( actor ) // Remove old renderer from actor.
- {
- actor.RemoveRenderer( mImpl->mRenderer );
- }
- if( !oldImageUrl.empty() ) // Clean old renderer from cache.
- {
- CleanCache( oldImageUrl );
- }
- }
-
- // If actor is on stage, create new renderer and apply to actor.
- if( actor && actor.OnStage() )
- {
- SetOnStage( actor );
- }
}
void BatchImageVisual::SetSize( const Vector2& size )
naturalSize = Vector2::ZERO;
}
-void BatchImageVisual::SetClipRect( const Rect<int>& clipRect )
-{
- Visual::Base::SetClipRect( clipRect );
-}
-
void BatchImageVisual::InitializeRenderer( const std::string& imageUrl )
{
if( imageUrl.empty() )
}
// 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 )
}
}
+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 );