Merge "Removing TextureUploadObserver from symbol table" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / visual-base-impl.cpp
index 8a6f24b..7add024 100644 (file)
@@ -221,7 +221,7 @@ void Visual::Base::GetNaturalSize( Vector2& naturalSize )
   naturalSize = Vector2::ZERO;
 }
 
-void Visual::Base::SetDepthIndex( float index )
+void Visual::Base::SetDepthIndex( int index )
 {
   mImpl->mDepthIndex = index;
   if( mImpl->mRenderer )
@@ -230,7 +230,7 @@ void Visual::Base::SetDepthIndex( float index )
   }
 }
 
-float Visual::Base::GetDepthIndex() const
+int Visual::Base::GetDepthIndex() const
 {
   return mImpl->mDepthIndex;
 }
@@ -401,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;