Change Visual depth index API from float to int 07/132507/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 6 Jun 2017 09:59:17 +0000 (10:59 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 6 Jun 2017 09:59:48 +0000 (10:59 +0100)
Change-Id: I08faedcf31235b3d5a62e5e6e44fcddd1c38e98e

21 files changed:
automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
dali-toolkit/devel-api/controls/control-devel.cpp
dali-toolkit/devel-api/controls/control-devel.h
dali-toolkit/devel-api/controls/control-wrapper-impl.cpp
dali-toolkit/devel-api/controls/control-wrapper-impl.h
dali-toolkit/devel-api/visual-factory/visual-base.cpp
dali-toolkit/devel-api/visual-factory/visual-base.h
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.h
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.cpp
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/public-api/controls/control-impl.cpp

index 93e47ff..3ea0786 100644 (file)
@@ -430,11 +430,11 @@ int UtcDaliControlWrapperRegisterVisualWithDepthIndexToSelf(void)
     DALI_TEST_CHECK( visual );
 
     // Register to self
-    controlWrapperImpl->RegisterVisual( index, visual, 4.0f );
+    controlWrapperImpl->RegisterVisual( index, visual, 4 );
 
     DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
     DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( index ), visual, TEST_LOCATION );
-    DALI_TEST_EQUALS( visual.GetDepthIndex(), 4.0f, TEST_LOCATION );
+    DALI_TEST_EQUALS( visual.GetDepthIndex(), 4, TEST_LOCATION );
   }
 
   DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
@@ -504,11 +504,11 @@ int UtcDaliControlWrapperRegisterDisabledVisualWithDepthIndex(void)
   DALI_TEST_CHECK(visual);
 
   // Register index with a color visual
-  controlWrapperImpl->RegisterVisual( TEST_PROPERTY, visual, false, 10.0f );
+  controlWrapperImpl->RegisterVisual( TEST_PROPERTY, visual, false, 10 );
 
   DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( TEST_PROPERTY ), visual, TEST_LOCATION );
   DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
-  DALI_TEST_EQUALS( visual.GetDepthIndex(), 10.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( visual.GetDepthIndex(), 10, TEST_LOCATION );
 
   Stage::GetCurrent().Add( controlWrapper );
 
index c121a53..bec918e 100644 (file)
@@ -203,7 +203,7 @@ int UtcDaliVisualSetGetDepthIndex(void)
   propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
   Visual::Base visual = factory.CreateVisual( propertyMap );
 
-  visual.SetDepthIndex( 1.f );
+  visual.SetDepthIndex( 1 );
 
   DummyControl dummyControl = DummyControl::New(true);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
@@ -215,12 +215,12 @@ int UtcDaliVisualSetGetDepthIndex(void)
 
   int depthIndex = dummyControl.GetRendererAt(0u).GetProperty<int>( Renderer::Property::DEPTH_INDEX );
   DALI_TEST_EQUALS( depthIndex, 1, TEST_LOCATION );
-  DALI_TEST_EQUALS( visual.GetDepthIndex(), 1.f, TEST_LOCATION );
+  DALI_TEST_EQUALS( visual.GetDepthIndex(), 1, TEST_LOCATION );
 
-  visual.SetDepthIndex( -1.f );
+  visual.SetDepthIndex( -1 );
   depthIndex = dummyControl.GetRendererAt(0u).GetProperty<int>( Renderer::Property::DEPTH_INDEX );
   DALI_TEST_EQUALS( depthIndex, -1, TEST_LOCATION );
-  DALI_TEST_EQUALS( visual.GetDepthIndex(), -1.f, TEST_LOCATION );
+  DALI_TEST_EQUALS( visual.GetDepthIndex(), -1, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1865,7 +1865,7 @@ int UtcDaliVisualRendererRemovalAndReAddition(void)
   propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
   Visual::Base visual = factory.CreateVisual( propertyMap );
 
-  visual.SetDepthIndex( 1.f );
+  visual.SetDepthIndex( 1 );
 
   DummyControl dummyControl = DummyControl::New(true);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
@@ -1927,7 +1927,7 @@ int UtcDaliVisualTextVisualRender(void)
   propertyMap.Insert( "verticalAlignment", "CENTER" );
   propertyMap.Insert( "textColor", Color::RED );
   Visual::Base textVisual = factory.CreateVisual( propertyMap );
-  textVisual.SetDepthIndex( 1.f );
+  textVisual.SetDepthIndex( 1 );
 
   DummyControl dummyControl = DummyControl::New(true);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
@@ -1954,7 +1954,7 @@ int UtcDaliVisualTextVisualRender(void)
   propertyMap.Insert( DevelVisual::Property::TRANSFORM, transformMap );
 
   textVisual = factory.CreateVisual( propertyMap );
-  textVisual.SetDepthIndex( 1.f );
+  textVisual.SetDepthIndex( 1 );
 
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, textVisual );
   dummyControl.SetSize( 720.f, 640.f );
@@ -1996,7 +1996,7 @@ int UtcDaliVisualTextVisualDisableEnable(void)
   propertyMap.Insert( "verticalAlignment", "CENTER" );
   propertyMap.Insert( "textColor", Color::RED );
   Visual::Base textVisual = factory.CreateVisual( propertyMap );
-  textVisual.SetDepthIndex( 1.f );
+  textVisual.SetDepthIndex( 1 );
 
   DummyControl dummyControl = DummyControl::New(true);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
@@ -2098,7 +2098,7 @@ int UtcDaliRegisterVisualOrder(void)
   tet_infoline( "Register visual, should have depth index of 0.0f" );
   Visual::Base testVisual = factory.CreateVisual( propertyMap );
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, testVisual );
-  DALI_TEST_EQUALS( testVisual.GetDepthIndex(), 0.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( testVisual.GetDepthIndex(), 0, TEST_LOCATION );
 
   tet_infoline( "Register more visuals, each added one should have a depth index greater than previous" );
 
@@ -2116,12 +2116,12 @@ int UtcDaliRegisterVisualOrder(void)
 
   tet_infoline( "Set depth index on a new visual before registering, the depth index should not have been changed" );
   Visual::Base labelVisual = factory.CreateVisual( propertyMap );
-  labelVisual.SetDepthIndex( -2000.0f );
+  labelVisual.SetDepthIndex( -2000 );
   dummyImpl.RegisterVisual( DummyControl::Property::LABEL_VISUAL, labelVisual );
-  DALI_TEST_EQUALS( labelVisual.GetDepthIndex(), -2000.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( labelVisual.GetDepthIndex(), -2000, TEST_LOCATION );
 
   tet_infoline( "Replace visual, the depth index should be the same as what was previously set" );
-  const float testVisual2DepthIndex = testVisual2.GetDepthIndex();
+  const int testVisual2DepthIndex = testVisual2.GetDepthIndex();
   Visual::Base testVisual2Replacement = factory.CreateVisual( propertyMap );
   DALI_TEST_CHECK( testVisual2Replacement.GetDepthIndex() != testVisual2DepthIndex );
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, testVisual2Replacement );
@@ -2129,9 +2129,9 @@ int UtcDaliRegisterVisualOrder(void)
 
   tet_infoline( "Replace visual and set a depth index on the replacement, the depth index of the replacement should be honoured" );
   Visual::Base anotherTestVisual2Replacement = factory.CreateVisual( propertyMap );
-  anotherTestVisual2Replacement.SetDepthIndex( 2000.0f );
+  anotherTestVisual2Replacement.SetDepthIndex( 2000 );
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, anotherTestVisual2Replacement );
-  DALI_TEST_EQUALS( anotherTestVisual2Replacement.GetDepthIndex(), 2000.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( anotherTestVisual2Replacement.GetDepthIndex(), 2000, TEST_LOCATION );
 
   dummyControl.SetSize(200.f, 200.f);
   Stage::GetCurrent().Add( dummyControl );
@@ -2154,20 +2154,20 @@ int UtcDaliRegisterVisualWithDepthIndex(void)
 
   tet_infoline( "Register a visual with a depth index, it should be enabled by default too" );
   Visual::Base testVisual = factory.CreateVisual( propertyMap );
-  DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, testVisual, 203.0f );
-  DALI_TEST_EQUALS( testVisual.GetDepthIndex(), 203.0f, TEST_LOCATION );
+  DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, testVisual, 203 );
+  DALI_TEST_EQUALS( testVisual.GetDepthIndex(), 203, TEST_LOCATION );
   DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL ), true, TEST_LOCATION );
 
   tet_infoline( "Register another visual with a depth index and it disabled" );
   Visual::Base testVisual2 = factory.CreateVisual( propertyMap );
-  DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, testVisual2, false, 450.0f );
-  DALI_TEST_EQUALS( testVisual2.GetDepthIndex(), 450.0f, TEST_LOCATION );
+  DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, testVisual2, false, 450 );
+  DALI_TEST_EQUALS( testVisual2.GetDepthIndex(), 450, TEST_LOCATION );
   DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL2 ), false, TEST_LOCATION );
 
   tet_infoline( "Register another visual with a depth index and it enabled using the enabled API" );
   Visual::Base testVisual3 = factory.CreateVisual( propertyMap );
-  DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, testVisual3, true, 300.0f );
-  DALI_TEST_EQUALS( testVisual3.GetDepthIndex(), 300.0f, TEST_LOCATION );
+  DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, testVisual3, true, 300 );
+  DALI_TEST_EQUALS( testVisual3.GetDepthIndex(), 300, TEST_LOCATION );
   DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL2 ), true, TEST_LOCATION );
 
   dummyControl.SetSize(200.f, 200.f);
index ba249a9..59fd144 100644 (file)
@@ -57,7 +57,7 @@ void RegisterVisual( Internal::Control& control, Dali::Property::Index index, To
   controlImpl.RegisterVisual( index, visual );
 }
 
-void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, float depthIndex )
+void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
 {
   Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
   controlImpl.RegisterVisual( index, visual, depthIndex );
@@ -69,7 +69,7 @@ void RegisterVisual( Internal::Control& control, Dali::Property::Index index, To
   controlImpl.RegisterVisual( index, visual, enabled );
 }
 
-void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex )
+void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
 {
   Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
   controlImpl.RegisterVisual( index, visual, enabled, depthIndex );
index f6d5b38..233ef12 100644 (file)
@@ -166,7 +166,7 @@ DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property:
  * @see Visual::Base::GetDepthIndex()
  * @see Visual::Base::SetDepthIndex()
  */
-DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, float depthIndex );
+DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, int depthIndex );
 
 /**
  * @brief Register a visual by Property Index with the option of enabling/disabling it.
@@ -196,7 +196,7 @@ DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property:
  * @see Visual::Base::GetDepthIndex()
  * @see Visual::Base::SetDepthIndex()
  */
-DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex );
+DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex );
 
 /**
  * @brief Erase the entry matching the given index from the list of registered visuals
index 8c7a76e..8028707 100755 (executable)
@@ -125,7 +125,7 @@ void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Bas
   DevelControl::RegisterVisual( *this, index, visual );
 }
 
-void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex )
+void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
 {
   DevelControl::RegisterVisual( *this, index, visual, depthIndex );
 }
@@ -135,7 +135,7 @@ void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Bas
   DevelControl::RegisterVisual( *this, index, visual, enabled );
 }
 
-void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex )
+void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
 {
   DevelControl::RegisterVisual( *this, index, visual, enabled, depthIndex );
 }
index 8a35ee9..899a575 100755 (executable)
@@ -118,7 +118,7 @@ public: // From Control
   /**
    * @ref Dali::Toolkit::DevelControl::RegisterVisual()
    */
-  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex );
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex );
 
   /**
    * @ref Dali::Toolkit::DevelControl::RegisterVisual()
@@ -128,7 +128,7 @@ public: // From Control
   /**
    * @ref Dali::Toolkit::DevelControl::RegisterVisual()
    */
-  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex );
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex );
 
   /**
    * @ref Dali::Toolkit::DevelControl::UnregisterVisual()
index 6a19c9b..b6a51fb 100644 (file)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -81,12 +81,12 @@ void Visual::Base::GetNaturalSize(Vector2& naturalSize )
   GetImplementation( *this ).GetNaturalSize( naturalSize );
 }
 
-void Visual::Base::SetDepthIndex( float index )
+void Visual::Base::SetDepthIndex( int index )
 {
   GetImplementation( *this ).SetDepthIndex( index );
 }
 
-float Visual::Base::GetDepthIndex() const
+int Visual::Base::GetDepthIndex() const
 {
   return GetImplementation( *this ).GetDepthIndex();
 }
index 4e2e0f5..65fb275 100644 (file)
@@ -170,14 +170,14 @@ public:
    *
    * @param[in] index The depth index of this visual.
    */
-  void SetDepthIndex( float index );
+  void SetDepthIndex( int index );
 
   /**
    * @brief Get the depth index of this visual
    *
    * @return The depth index of this visual.
    */
-  float GetDepthIndex() const;
+  int GetDepthIndex() const;
 
   /**
    * @brief Create the property map representing this visual.
index e8378cb..149cb4a 100644 (file)
@@ -422,7 +422,7 @@ Button::Align Button::GetLabelAlignment()
  * 4) Unregister visual if empty map was provided. This is the method to remove a visual
  */
 
-void Button::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const float visualDepth )
+void Button::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth )
 {
   DALI_LOG_INFO( gLogButtonFilter, Debug::Verbose, "CreateVisualsForComponent index(%d)\n", index );
   Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
index 210246e..8b1417c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_BUTTON_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -588,7 +588,7 @@ protected:
    * @param[in] value the value to set on the component
    * @param[in] visualDepth the depth of the visual if overlapping another
    */
-  void CreateVisualsForComponent( Property::Index index ,const Property::Value& value, const float visualDepth );
+  void CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth );
 
   /**
    * @brief Get the Property map for the given Visual
index b04aa2a..304ba78 100644 (file)
@@ -387,7 +387,7 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
   RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::NOT_SET );
 }
 
-void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex )
+void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
 {
   RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::SET, depthIndex );
 }
@@ -397,12 +397,12 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
   RegisterVisual( index, visual, ( enabled ? VisualState::ENABLED : VisualState::DISABLED ), DepthIndexValue::NOT_SET );
 }
 
-void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex )
+void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
 {
   RegisterVisual( index, visual, ( enabled ? VisualState::ENABLED : VisualState::DISABLED ), DepthIndexValue::SET, depthIndex );
 }
 
-void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, float depthIndex )
+void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex )
 {
   bool visualReplaced ( false );
   Actor self = mControlImpl.Self();
@@ -420,9 +420,9 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
 
       // If we've not set the depth-index value and the new visual does not have a depth index applied to it, then use the previously set depth-index for this index
       if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
-          EqualsZero( visual.GetDepthIndex() ) )
+          ( visual.GetDepthIndex() == 0 ) )
       {
-        const float currentDepthIndex = (*iter)->visual.GetDepthIndex();
+        const int currentDepthIndex = (*iter)->visual.GetDepthIndex();
         visual.SetDepthIndex( currentDepthIndex );
       }
 
@@ -466,15 +466,15 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
     // If we've not set the depth-index value, we have more than one visual and the visual does not have a depth index, then set it to be the highest
     if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
         ( mVisuals.Size() > 1 ) &&
-        EqualsZero( visual.GetDepthIndex() ) )
+        ( visual.GetDepthIndex() == 0 ) )
     {
-      float maxDepthIndex = std::numeric_limits< float >::min();
+      int maxDepthIndex = std::numeric_limits< int >::min();
 
       RegisteredVisualContainer::ConstIterator iter;
       const RegisteredVisualContainer::ConstIterator endIter = mVisuals.End();
       for ( iter = mVisuals.Begin(); iter != endIter; iter++ )
       {
-        const float visualDepthIndex = (*iter)->visual.GetDepthIndex();
+        const int visualDepthIndex = (*iter)->visual.GetDepthIndex();
         if ( visualDepthIndex > maxDepthIndex )
         {
           maxDepthIndex = visualDepthIndex;
@@ -793,7 +793,7 @@ void Control::Impl::SetProperty( BaseObject* object, Property::Index index, cons
           Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( url, ImageDimensions() );
           if( visual )
           {
-            controlImpl.mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, float( DepthIndex::BACKGROUND ) );
+            controlImpl.mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
           }
         }
         else if( value.Get( color ) )
index 5a0a351..eceaa31 100644 (file)
@@ -133,7 +133,7 @@ public:
   /**
    * @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
    */
-  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex );
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex );
 
   /**
    * @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
@@ -143,7 +143,7 @@ public:
   /**
    * @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
    */
-  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex );
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex );
 
   /**
    * @copydoc Dali::Toolkit::DevelControl::UnregisterVisual()
@@ -293,7 +293,7 @@ private:
    * @param[in] depthIndexValueSet Set to true if the depthIndex has actually been set manually
    * @param[in] depthIndex The visual's depth-index is set to this
    */
-  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, float depthIndex = 0.0f );
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex = 0 );
 
 public:
 
index 4285524..8adc19d 100644 (file)
@@ -428,7 +428,7 @@ void EffectsView::AllocateResources()
 
     mImageForChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
     Internal::InitializeVisual( self, mVisualForChildren, mImageForChildren );
-    DevelControl::RegisterVisual( *this, CHILD_VISUAL, mVisualForChildren, float( DepthIndex::CONTENT + 1 ) );
+    DevelControl::RegisterVisual( *this, CHILD_VISUAL, mVisualForChildren, DepthIndex::CONTENT + 1 );
 
     mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
     TextureSet textureSet = TextureSet::New();
index d591c5a..a537621 100755 (executable)
@@ -350,7 +350,7 @@ Toolkit::TransitionData ProgressBar::ConvertPropertyToTransition( const Property
  * 4) Unregister visual if empty map was provided. This is the method to remove a visual
  */
 
-void ProgressBar::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const float visualDepth )
+void ProgressBar::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth )
 {
   Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
   Toolkit::Visual::Base progressVisual;
index b59c8b3..5c98cb0 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_PROGRESS_BAR_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -225,7 +225,7 @@ private:
   /**
    * Update progress bar label when progress value is changed
    */
-  void CreateVisualsForComponent( Property::Index index, const Property::Value& value, const float visualDepth );
+  void CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth );
 
   /**
    * Update progress bar label when progress value is changed
index 7aa46b8..9721dcf 100644 (file)
@@ -174,7 +174,7 @@ void SuperBlurView::SetImage(Image inputImage)
   Actor self( Self() );
 
   mVisuals[0] = Toolkit::VisualFactory::Get().CreateVisual( mInputImage );
-  DevelControl::RegisterVisual( *this, 0, mVisuals[0], 0.0f ); // Will clean up previously registered visuals for this index.
+  DevelControl::RegisterVisual( *this, 0, mVisuals[0], 0 ); // Will clean up previously registered visuals for this index.
   // custom shader is not applied on the original image.
 
   BlurImage( 0,  inputImage);
@@ -282,7 +282,7 @@ void SuperBlurView::OnSizeSet( const Vector3& targetSize )
                                                 GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT );
 
       mVisuals[i] = Toolkit::VisualFactory::Get().CreateVisual( mBlurredImage[i - 1] );
-      DevelControl::RegisterVisual( *this, i, mVisuals[i], float( i ) ); // Will clean up existing visual with same index.
+      DevelControl::RegisterVisual( *this, i, mVisuals[i], int( i ) ); // Will clean up existing visual with same index.
       SetShaderEffect( mVisuals[i] );
     }
 
index 3486aab..c167f81 100644 (file)
@@ -850,7 +850,7 @@ void TextSelectionPopup::CreateBackgroundBorder( Property::Map& propertyMap )
 
     if( visual )
     {
-      DevelControl::RegisterVisual( *this, Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER, visual, float( DepthIndex::CONTENT ) );
+      DevelControl::RegisterVisual( *this, Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER, visual, DepthIndex::CONTENT );
     }
   }
 }
index c31037f..ca311e1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_VISUAL_BASE_DATA_IMPL_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -121,7 +121,7 @@ struct Base::Impl
   Transform       mTransform;
   Vector4         mMixColor;
   Size            mControlSize;
-  float           mDepthIndex;
+  int             mDepthIndex;
   Property::Index mMixColorIndex;
   Property::Index mOpacityIndex;
   int             mFlags;
index d483ef5..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;
 }
index b671c15..d580d8f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_VISUAL_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -109,12 +109,12 @@ public:
   /**
    * @copydoc Toolkit::Visual::Base::SetDepthIndex
    */
-  void SetDepthIndex( float index );
+  void SetDepthIndex( int index );
 
   /**
    * @copydoc Toolkit::Visual::Base::GetDepthIndex
    */
-  float GetDepthIndex() const;
+  int GetDepthIndex() const;
 
   /**
    * @copydoc Toolkit::Visual::Base::SetOnStage
index aa0ef0b..0dfc002 100644 (file)
@@ -124,7 +124,7 @@ void Control::SetBackground( const Property::Map& map )
   Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( map );
   if( visual )
   {
-    mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, float( DepthIndex::BACKGROUND ) );
+    mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
 
     // Trigger a size negotiation request that may be needed by the new visual to relayout its contents.
     RelayoutRequest();
@@ -136,7 +136,7 @@ void Control::SetBackgroundImage( Image image )
   Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( image );
   if( visual )
   {
-    mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, float( DepthIndex::BACKGROUND ) );
+    mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
   }
 }