X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fimage%2Fbatch-image-visual.cpp;h=2aba159e504bc111506f4dfdb80bb802ae6511c4;hb=8c0b17fb124c735b31c441873da4d7ffc4b15eb5;hp=30eeeda069c90e3384590c845ce38bab4a3870a4;hpb=92a400c3857fbf6c1e63693f22c94dcffe50e522;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/image/batch-image-visual.cpp b/dali-toolkit/internal/visuals/image/batch-image-visual.cpp index 30eeeda..2aba159 100644 --- a/dali-toolkit/internal/visuals/image/batch-image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/batch-image-visual.cpp @@ -27,11 +27,11 @@ #include #include #include -#include #include // INTERNAL HEADER #include +#include #include #include #include @@ -86,11 +86,16 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( }\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() { } @@ -98,7 +103,7 @@ BatchImageVisual::~BatchImageVisual() { } -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 ); @@ -123,25 +128,6 @@ void BatchImageVisual::DoInitialize( Actor& actor, const Property::Map& property 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 ) @@ -227,6 +213,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 ) @@ -247,7 +235,7 @@ void BatchImageVisual::DoSetOffStage( Actor& actor ) void BatchImageVisual::DoCreatePropertyMap( Property::Map& map ) const { map.Clear(); - map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE ); + map.Insert( Toolkit::VisualProperty::TYPE, Toolkit::Visual::IMAGE ); if( !mImageUrl.empty() ) { @@ -258,6 +246,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 );