Fix feedback style error message.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / visual-base-impl.cpp
index 0d2b050..d483ef5 100644 (file)
@@ -287,6 +287,20 @@ void Visual::Base::CreatePropertyMap( Property::Map& map ) const
   map.Insert( DevelVisual::Property::OPACITY, mImpl->mMixColor.a );
 }
 
+void Visual::Base::CreateInstancePropertyMap( Property::Map& map ) const
+{
+  DoCreateInstancePropertyMap( map );
+
+  if( mImpl->mCustomShader )
+  {
+    mImpl->mCustomShader->CreatePropertyMap( map );
+  }
+
+  //map.Insert( DevelVisual::Property::DEPTH_INDEX, mImpl->mDepthIndex );
+  //map.Insert( DevelVisual::Property::ENABLED, (bool) mImpl->mRenderer );
+}
+
+
 void Visual::Base::EnablePreMultipliedAlpha( bool preMultipled )
 {
   if( preMultipled )
@@ -320,11 +334,6 @@ bool Visual::Base::IsOnStage() const
   return mImpl->mFlags & Impl::IS_ON_STAGE;
 }
 
-bool Visual::Base::IsFromCache() const
-{
-  return mImpl->mFlags & Impl::IS_FROM_CACHE;
-}
-
 void Visual::Base::RegisterMixColor()
 {
   // Only register if not already registered.
@@ -392,6 +401,37 @@ const Vector4& Visual::Base::GetMixColor() const
   return mImpl->mMixColor;
 }
 
+void Visual::Base::AddResourceObserver( Visual::ResourceObserver& observer)
+{
+  mImpl->mResourceObserver = &observer;
+}
+
+void Visual::Base::RemoveResourceObserver( Visual::ResourceObserver& observer )
+{
+  mImpl->mResourceObserver = NULL;
+}
+
+void Visual::Base::ResourceReady()
+{
+  if( mImpl->mResourceReady )
+  {
+    // only inform the observer the first time the resource is ready
+    return;
+  }
+  mImpl->mResourceReady = true;
+
+  if( mImpl->mResourceObserver )
+  {
+    // observer is currently a control impl
+    mImpl->mResourceObserver->ResourceReady( *this );
+  }
+}
+
+bool Visual::Base::IsResourceReady() const
+{
+  return mImpl->mResourceReady;
+}
+
 Renderer Visual::Base::GetRenderer()
 {
   return mImpl->mRenderer;
@@ -481,8 +521,11 @@ void Visual::Base::AnimateProperty(
   Property::Map map;
   DoCreatePropertyMap( map );
   Property::Value* valuePtr = map.Find( Toolkit::DevelVisual::Property::TYPE );
-  int visualType;
-  valuePtr->Get(visualType);
+  int visualType = -1;
+  if( valuePtr )
+  {
+    valuePtr->Get( visualType );
+  }
 
   if( animator.propertyKey == Toolkit::DevelVisual::Property::MIX_COLOR ||
       animator.propertyKey == MIX_COLOR ||
@@ -500,7 +543,7 @@ void Visual::Base::AnimateProperty(
   }
   else if( mImpl->mRenderer )
   {
-    AnimateRendererProperty(transition, animator);
+    AnimateRendererProperty( transition, animator );
   }
 }