/*
- * 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.
END_TEST;
}
+int UtcDaliControlWrapperRegisterVisualWithDepthIndexToSelf(void)
+{
+ ToolkitTestApplication application;
+
+ Test::ObjectDestructionTracker objectDestructionTracker;
+
+ {
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
+ ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+
+ objectDestructionTracker.Start( controlWrapper );
+
+ Property::Index index = 1;
+
+ Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
+ Toolkit::Visual::Base visual;
+
+ Property::Map map;
+ map[Visual::Property::TYPE] = Visual::COLOR;
+ map[ColorVisual::Property::MIX_COLOR] = Color::RED;
+
+ visual = visualFactory.CreateVisual( map );
+ DALI_TEST_CHECK( visual );
+
+ // Register to self
+ controlWrapperImpl->RegisterVisual( index, visual, 4.0f );
+
+ 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( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
+
+ END_TEST;
+}
+
int UtcDaliControlWrapperRegisterDisabledVisual(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliControlWrapperRegisterDisabledVisualWithDepthIndex(void)
+{
+ ToolkitTestApplication application;
+
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
+ ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+
+ Property::Index TEST_PROPERTY = 1;
+
+ Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
+ Toolkit::Visual::Base visual;
+
+ Property::Map map;
+ map[Visual::Property::TYPE] = Visual::COLOR;
+ map[ColorVisual::Property::MIX_COLOR] = Color::RED;
+
+ visual = visualFactory.CreateVisual( map );
+ DALI_TEST_CHECK(visual);
+
+ // Register index with a color visual
+ controlWrapperImpl->RegisterVisual( TEST_PROPERTY, visual, false, 10.0f );
+
+ 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 );
+
+ Stage::GetCurrent().Add( controlWrapper );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( controlWrapper.OnStage(), true, TEST_LOCATION );
+
+ controlWrapperImpl->EnableVisual( TEST_PROPERTY, true );
+
+ DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), true, TEST_LOCATION );
+
+ END_TEST;
+}
+
int UtcDaliControlWrapperRegisterUnregisterVisual(void)
{
ToolkitTestApplication application;
#include <dali/public-api/rendering/texture-set.h>
#include <dali/public-api/rendering/shader.h>
#include <dali/devel-api/object/handle-devel.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/devel-api/visual-factory/transition-data.h>
#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
END_TEST;
}
+
+int UtcDaliRegisterVisualOrder(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "Register Visual Order" );
+
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+
+ VisualFactory factory = VisualFactory::Get();
+ Property::Map propertyMap;
+ propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
+ propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
+
+ 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 );
+
+ tet_infoline( "Register more visuals, each added one should have a depth index greater than previous" );
+
+ Visual::Base testVisual2 = factory.CreateVisual( propertyMap );
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, testVisual2 );
+ DALI_TEST_CHECK( testVisual2.GetDepthIndex() > testVisual.GetDepthIndex() );
+
+ Visual::Base foregroundVisual = factory.CreateVisual( propertyMap );
+ dummyImpl.RegisterVisual( DummyControl::Property::FOREGROUND_VISUAL, foregroundVisual );
+ DALI_TEST_CHECK( foregroundVisual.GetDepthIndex() > testVisual2.GetDepthIndex() );
+
+ Visual::Base focusVisual = factory.CreateVisual( propertyMap );
+ dummyImpl.RegisterVisual( DummyControl::Property::FOCUS_VISUAL, focusVisual );
+ DALI_TEST_CHECK( focusVisual.GetDepthIndex() > foregroundVisual.GetDepthIndex() );
+
+ 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 );
+ dummyImpl.RegisterVisual( DummyControl::Property::LABEL_VISUAL, labelVisual );
+ DALI_TEST_EQUALS( labelVisual.GetDepthIndex(), -2000.0f, TEST_LOCATION );
+
+ tet_infoline( "Replace visual, the depth index should be the same as what was previously set" );
+ const float testVisual2DepthIndex = testVisual2.GetDepthIndex();
+ Visual::Base testVisual2Replacement = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( testVisual2Replacement.GetDepthIndex() != testVisual2DepthIndex );
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, testVisual2Replacement );
+ DALI_TEST_EQUALS( testVisual2Replacement.GetDepthIndex(), testVisual2DepthIndex, TEST_LOCATION );
+
+ 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 );
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, anotherTestVisual2Replacement );
+ DALI_TEST_EQUALS( anotherTestVisual2Replacement.GetDepthIndex(), 2000.0f, TEST_LOCATION );
+
+ dummyControl.SetSize(200.f, 200.f);
+ Stage::GetCurrent().Add( dummyControl );
+
+ END_TEST;
+}
+
+int UtcDaliRegisterVisualWithDepthIndex(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "Register a Visual With Depth Index" );
+
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+
+ VisualFactory factory = VisualFactory::Get();
+ Property::Map propertyMap;
+ propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
+ propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
+
+ 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 );
+ 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 );
+ 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 );
+ DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL2 ), true, TEST_LOCATION );
+
+ dummyControl.SetSize(200.f, 200.f);
+ Stage::GetCurrent().Add( dummyControl );
+
+ END_TEST;
+}
controlImpl.RegisterVisual( index, visual );
}
+void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, float depthIndex )
+{
+ Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
+ controlImpl.RegisterVisual( index, visual, depthIndex );
+}
+
void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled )
{
Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
controlImpl.RegisterVisual( index, visual, enabled );
}
+void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex )
+{
+ Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
+ controlImpl.RegisterVisual( index, visual, enabled, depthIndex );
+}
+
void UnregisterVisual( Internal::Control& control, Dali::Property::Index index )
{
Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
DALI_IMPORT_API bool IsResourceReady( const Control& control );
/**
- * @brief Register a visual by Property Index, linking an Actor to visual when required.
- * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
- * No parenting is done during registration, this should be done by derived class.
+ * @brief Register a visual by Property Index.
*
* @param[in] control The control
* @param[in] index The Property index of the visual, used to reference visual
* @param[in] visual The visual to register
+ *
* @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
* Use below API with enabled set to false if derived class wishes to control when visual is staged.
+ * @note If the depth-index is not set on the visual, then it is set to be above the currently registered visuals.
+ * @note If replacing a visual, then the depth-index of the visual being replaced is used for the visual.
*/
DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual );
/**
- * @brief Register a visual by Property Index, linking an Actor to visual when required.
+ * @brief Register a visual by Property Index with a depth index.
+ *
+ * @param[in] control The control
+ * @param[in] index The Property index of the visual, used to reference visual
+ * @param[in] visual The visual to register
+ * @param[in] depthIndex The visual's depth-index is set to this
*
- * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
- * If enabled is false then the visual is not set on stage until enabled by the derived class.
- * @see EnableVisual
+ * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
+ * Use below API with enabled set to false if derived class wishes to control when visual is staged.
+ *
+ * @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 );
+
+/**
+ * @brief Register a visual by Property Index with the option of enabling/disabling it.
*
* @param[in] control The control
* @param[in] index The Property index of the visual, used to reference visual
* @param[in] visual The visual to register
* @param[in] enabled false if derived class wants to control when visual is set on stage.
*
+ * @note If the depth-index is not set on the visual, then it is set to be above the currently registered visuals.
+ * @note If replacing a visual, then the depth-index of the visual being replaced is used for the visual.
+ *
+ * @see EnableVisual()
*/
DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled );
/**
+ * @brief Register a visual by Property Index with a depth index with the option of enabling/disabling it.
+ *
+ * @param[in] control The control
+ * @param[in] index The Property index of the visual, used to reference visual
+ * @param[in] visual The visual to register
+ * @param[in] enabled false if derived class wants to control when visual is set on stage.
+ * @param[in] depthIndex The visual's depth-index is set to this
+ *
+ * @see EnableVisual()
+ * @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 );
+
+/**
* @brief Erase the entry matching the given index from the list of registered visuals
*
* @param[in] control The control
DevelControl::RegisterVisual( *this, index, visual );
}
+void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex )
+{
+ DevelControl::RegisterVisual( *this, index, visual, depthIndex );
+}
+
void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled )
{
DevelControl::RegisterVisual( *this, index, visual, enabled );
}
+void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex )
+{
+ DevelControl::RegisterVisual( *this, index, visual, enabled, depthIndex );
+}
+
void ControlWrapper::UnregisterVisual( Property::Index index )
{
DevelControl::UnregisterVisual( *this, index );
/**
* @ref Dali::Toolkit::DevelControl::RegisterVisual()
*/
+ void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex );
+
+ /**
+ * @ref Dali::Toolkit::DevelControl::RegisterVisual()
+ */
void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled );
/**
+ * @ref Dali::Toolkit::DevelControl::RegisterVisual()
+ */
+ void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex );
+
+ /**
* @ref Dali::Toolkit::DevelControl::UnregisterVisual()
*/
void UnregisterVisual( Property::Index index );
{
DALI_LOG_INFO( gLogButtonFilter, Debug::Verbose, "CreateVisualsForComponent RegisterVisual index(%d) enabled(%s)\n",
index, DevelControl::IsVisualEnabled( *this, index )?"true":"false" );
- buttonVisual.SetDepthIndex( visualDepth );
- DevelControl::RegisterVisual( *this, index, buttonVisual, DevelControl::IsVisualEnabled( *this, index ) );
+ DevelControl::RegisterVisual( *this, index, buttonVisual, DevelControl::IsVisualEnabled( *this, index ), visualDepth );
}
else
{
#include <dali/integration-api/debug.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <cstring>
+#include <limits>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual )
{
- RegisterVisual( index, visual, true );
+ RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::NOT_SET );
+}
+
+void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex )
+{
+ RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::SET, depthIndex );
}
void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled )
{
+ 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 )
+{
+ 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 )
+{
bool visualReplaced ( false );
Actor self = mControlImpl.Self();
Toolkit::GetImplementation((*iter)->visual).SetOffStage( self );
}
+ // 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() ) )
+ {
+ const float currentDepthIndex = (*iter)->visual.GetDepthIndex();
+ visual.SetDepthIndex( currentDepthIndex );
+ }
+
StopObservingVisual( (*iter)->visual );
StartObservingVisual( visual );
(*iter)->visual = visual;
+ (*iter)->enabled = ( enabled == VisualState::ENABLED ) ? true : false;
visualReplaced = true;
}
}
if( !visualReplaced ) // New registration entry
{
- mVisuals.PushBack( new RegisteredVisual( index, visual, enabled ) );
+ mVisuals.PushBack( new RegisteredVisual( index, visual, ( enabled == VisualState::ENABLED ? true : false ) ) );
// monitor when the visuals resources are ready
StartObservingVisual( visual );
+ // 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() ) )
+ {
+ float maxDepthIndex = std::numeric_limits< float >::min();
+
+ RegisteredVisualContainer::ConstIterator iter;
+ const RegisteredVisualContainer::ConstIterator endIter = mVisuals.End();
+ for ( iter = mVisuals.Begin(); iter != endIter; iter++ )
+ {
+ const float visualDepthIndex = (*iter)->visual.GetDepthIndex();
+ if ( visualDepthIndex > maxDepthIndex )
+ {
+ maxDepthIndex = visualDepthIndex;
+ }
+ }
+
+ ++maxDepthIndex; // Add one to the current maximum depth index so that our added visual appears on top
+ visual.SetDepthIndex( maxDepthIndex );
+ }
}
- if( visual && self.OnStage() && enabled )
+ if( visual )
{
- Toolkit::GetImplementation(visual).SetOnStage( self );
+ // If the caller has set the depth-index, then set it here
+ if( depthIndexValueSet == DepthIndexValue::SET )
+ {
+ visual.SetDepthIndex( depthIndex );
+ }
+
+ // Put on stage if enabled and the control is already on the stage
+ if( ( enabled == VisualState::ENABLED ) && self.OnStage() )
+ {
+ Toolkit::GetImplementation(visual).SetOnStage( self );
+ }
}
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::RegisterVisual() Registered %s(%d), enabled:%s\n", visual.GetName().c_str(), index, enabled?"T":"F" );
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( url, ImageDimensions() );
if( visual )
{
- controlImpl.mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual );
- visual.SetDepthIndex( DepthIndex::BACKGROUND );
+ controlImpl.mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, float( DepthIndex::BACKGROUND ) );
}
}
else if( value.Get( color ) )
/**
* @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
*/
+ void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, float depthIndex );
+
+ /**
+ * @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
+ */
void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled );
/**
+ * @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
+ */
+ void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, float depthIndex );
+
+ /**
* @copydoc Dali::Toolkit::DevelControl::UnregisterVisual()
*/
void UnregisterVisual( Property::Index index );
*/
bool IsResourceReady() const;
+private:
+
+ /**
+ * Used as an alternative to boolean so that it is obvious whether a visual is enabled/disabled.
+ */
+ struct VisualState
+ {
+ enum Type
+ {
+ DISABLED = 0, ///< Visual disabled.
+ ENABLED = 1 ///< Visual enabled.
+ };
+ };
+
+ /**
+ * Used as an alternative to boolean so that it is obvious whether a visual's depth value has been set or not by the caller.
+ */
+ struct DepthIndexValue
+ {
+ enum Type
+ {
+ NOT_SET = 0, ///< Visual depth value not set by caller.
+ SET = 1 ///< Visual depth value set by caller.
+ };
+ };
+
+ /**
+ * @brief Adds the visual to the list of registered visuals.
+ * @param[in] index The Property index of the visual, used to reference visual
+ * @param[in] visual The visual to register
+ * @param[in] enabled false if derived class wants to control when visual is set on stage
+ * @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 );
+
+public:
+
Control& mControlImpl;
DevelControl::State mState;
std::string mSubStateName;
mImageForChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
Internal::InitializeVisual( self, mVisualForChildren, mImageForChildren );
- DevelControl::RegisterVisual( *this, CHILD_VISUAL, mVisualForChildren );
- mVisualForChildren.SetDepthIndex( DepthIndex::CONTENT+1 );
+ DevelControl::RegisterVisual( *this, CHILD_VISUAL, mVisualForChildren, float( DepthIndex::CONTENT + 1 ) );
mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
TextureSet textureSet = TextureSet::New();
if ( progressVisual )
{
- progressVisual.SetDepthIndex( visualDepth );
if( index == Toolkit::ProgressBar::Property::INDETERMINATE_VISUAL )
{
- DevelControl::RegisterVisual( *this, index, progressVisual, mIndeterminate );
+ DevelControl::RegisterVisual( *this, index, progressVisual, mIndeterminate, visualDepth );
}
else
{
- DevelControl::RegisterVisual( *this, index, progressVisual, true );
+ DevelControl::RegisterVisual( *this, index, progressVisual, true, visualDepth );
}
}
else
Actor self( Self() );
mVisuals[0] = Toolkit::VisualFactory::Get().CreateVisual( mInputImage );
- DevelControl::RegisterVisual( *this, 0, mVisuals[0] ); // Will clean up previously registered visuals for this index.
- mVisuals[0].SetDepthIndex(0);
+ DevelControl::RegisterVisual( *this, 0, mVisuals[0], 0.0f ); // Will clean up previously registered visuals for this index.
// custom shader is not applied on the original image.
BlurImage( 0, inputImage);
GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT );
mVisuals[i] = Toolkit::VisualFactory::Get().CreateVisual( mBlurredImage[i - 1] );
- DevelControl::RegisterVisual( *this, i, mVisuals[i] ); // Will clean up existing visual with same index.
- mVisuals[i].SetDepthIndex( i );
+ DevelControl::RegisterVisual( *this, i, mVisuals[i], float( i ) ); // Will clean up existing visual with same index.
SetShaderEffect( mVisuals[i] );
}
if( visual )
{
- DevelControl::RegisterVisual( *this, Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER, visual );
- visual.SetDepthIndex( DepthIndex::CONTENT );
+ DevelControl::RegisterVisual( *this, Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER, visual, float( DepthIndex::CONTENT ) );
}
}
}
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( map );
if( visual )
{
- mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual );
- visual.SetDepthIndex( DepthIndex::BACKGROUND );
+ mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, float( DepthIndex::BACKGROUND ) );
// Trigger a size negotiation request that may be needed by the new visual to relayout its contents.
RelayoutRequest();
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( image );
if( visual )
{
- mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual );
- visual.SetDepthIndex( DepthIndex::BACKGROUND );
+ mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, float( DepthIndex::BACKGROUND ) );
}
}