From bfa5276cfac80f6dd1f874503e6fefb74a90b19e Mon Sep 17 00:00:00 2001 From: David Steele Date: Mon, 24 Aug 2020 13:49:01 +0100 Subject: [PATCH] Updates following publication of devel-handle APIs Change-Id: I070abe62055a6574fcf98a96ab3e1140113256d4 --- .../src/dali-toolkit/utc-Dali-ImageVisual.cpp | 5 ++--- .../src/dali-toolkit/utc-Dali-TransitionData.cpp | 17 ++++++++--------- automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp | 10 +++++----- .../internal/controls/control/control-data-impl.cpp | 2 +- dali-toolkit/internal/visuals/border/border-visual.cpp | 5 ++--- dali-toolkit/internal/visuals/color/color-visual.cpp | 3 +-- dali-toolkit/internal/visuals/npatch/npatch-visual.cpp | 5 ++--- .../internal/visuals/primitive/primitive-visual.cpp | 3 +-- dali-toolkit/internal/visuals/visual-base-impl.cpp | 10 ++++------ 9 files changed, 26 insertions(+), 34 deletions(-) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp index 6921dd3..e07933a 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -750,7 +749,7 @@ int UtcDaliImageVisualAnimateMixColor(void) DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION); Renderer renderer = actor.GetRendererAt(0); - Property::Index index = DevelHandle::GetPropertyIndex( renderer, Visual::Property::MIX_COLOR ); + Property::Index index = renderer.GetPropertyIndex( Visual::Property::MIX_COLOR ); Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE ); DALI_TEST_EQUALS( blendModeValue.Get(), (int)BlendMode::AUTO, TEST_LOCATION ); @@ -1029,7 +1028,7 @@ int UtcDaliImageVisualAnimatePixelArea(void) DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION); Renderer renderer = actor.GetRendererAt(0); - Property::Index index = DevelHandle::GetPropertyIndex( renderer, Visual::Property::MIX_COLOR ); + Property::Index index = renderer.GetPropertyIndex( Visual::Property::MIX_COLOR ); tet_infoline("Test that the renderer has the mixColor property"); DALI_TEST_CHECK( index != Property::INVALID_INDEX ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp index 3476f89..ab94ef2 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -254,7 +253,7 @@ int UtcDaliTransitionDataMap1P(void) DALI_TEST_CHECK( anim ); Renderer renderer = actor.GetRendererAt(0); - Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); + Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR ); application.SendNotification(); application.Render(0); @@ -322,7 +321,7 @@ int UtcDaliTransitionDataMap2P(void) DALI_TEST_CHECK( anim ); Renderer renderer = actor.GetRendererAt(0); - Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); + Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR ); application.SendNotification(); application.Render(0); @@ -394,7 +393,7 @@ int UtcDaliTransitionDataMap2Pb(void) DALI_TEST_CHECK( anim ); Renderer renderer = actor.GetRendererAt(0); - Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR ); + Property::Index mixColorIndex = renderer.GetPropertyIndex( PrimitiveVisual::Property::MIX_COLOR ); application.SendNotification(); application.Render(0); @@ -590,7 +589,7 @@ int UtcDaliTransitionDataMap5P(void) DALI_TEST_CHECK( anim ); Renderer renderer = actor.GetRendererAt(0); - Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); + Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR ); application.SendNotification(); application.Render(0); @@ -662,7 +661,7 @@ int UtcDaliTransitionDataMap6P(void) DALI_TEST_CHECK( anim ); Renderer renderer = actor.GetRendererAt(0); - Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); + Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR ); application.SendNotification(); application.Render(0); @@ -814,7 +813,7 @@ int UtcDaliTransitionDataMapN4(void) application.SendNotification(); Renderer renderer = actor.GetRendererAt(0); - Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); + Property::Index mixColorIdx = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR ); tet_printf( "Test that the property has been set to target value\n"); DALI_TEST_EQUALS(renderer.GetProperty(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION); @@ -866,7 +865,7 @@ int UtcDaliTransitionDataMapN5(void) application.SendNotification(); Renderer renderer = actor.GetRendererAt(0); - Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); + Property::Index mixColorIdx = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR ); tet_printf( "Test that the property has been set to target value\n"); DALI_TEST_EQUALS(renderer.GetProperty(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION); @@ -917,7 +916,7 @@ int UtcDaliTransitionDataMapN6(void) application.SendNotification(); Renderer renderer = actor.GetRendererAt(0); - Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); + Property::Index mixColorIdx = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR ); tet_printf( "Test that the property has been set to target value\n"); DALI_TEST_EQUALS(renderer.GetProperty(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp index e41565d..9823516 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp @@ -1775,8 +1775,8 @@ int UtcDaliVisualAnimateBorderVisual01(void) DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION); Renderer renderer = actor.GetRendererAt(0); - Property::Index borderColorIndex = DevelHandle::GetPropertyIndex( renderer, BorderVisual::Property::COLOR ); - Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, Visual::Property::MIX_COLOR ); + Property::Index borderColorIndex = renderer.GetPropertyIndex( BorderVisual::Property::COLOR ); + Property::Index mixColorIndex = renderer.GetPropertyIndex( Visual::Property::MIX_COLOR ); Animation animation = dummyImpl.CreateTransition( transition ); @@ -1843,7 +1843,7 @@ int UtcDaliVisualAnimateBorderVisual02(void) DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION); Renderer renderer = actor.GetRendererAt(0); - Property::Index index = DevelHandle::GetPropertyIndex( renderer, BorderVisual::Property::SIZE ); + Property::Index index = renderer.GetPropertyIndex( BorderVisual::Property::SIZE ); Animation animation = Animation::New(4.0f); animation.AnimateTo( Property(renderer, index), 9.0f ); @@ -1887,7 +1887,7 @@ int UtcDaliVisualAnimateColorVisual(void) DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION); Renderer renderer = actor.GetRendererAt(0); - Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); + Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR ); Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE ); DALI_TEST_EQUALS( blendModeValue.Get(), (int)BlendMode::AUTO, TEST_LOCATION ); @@ -1943,7 +1943,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void) DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION); Renderer renderer = actor.GetRendererAt(0); - Property::Index index = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR ); + Property::Index index = renderer.GetPropertyIndex( PrimitiveVisual::Property::MIX_COLOR ); tet_infoline("Test that the renderer has the Primitive mix color"); DALI_TEST_CHECK( index != Property::INVALID_INDEX ); diff --git a/dali-toolkit/internal/controls/control/control-data-impl.cpp b/dali-toolkit/internal/controls/control/control-data-impl.cpp index ab65570..958dd2c 100755 --- a/dali-toolkit/internal/controls/control/control-data-impl.cpp +++ b/dali-toolkit/internal/controls/control/control-data-impl.cpp @@ -759,7 +759,7 @@ void Control::Impl::AddTransitions( Dali::Animation& animation, Actor child = mControlImpl.Self().FindChildByName( animator->objectName ); if( child ) { - Property::Index propertyIndex = DevelHandle::GetPropertyIndex( child, animator->propertyKey ); + Property::Index propertyIndex = child.GetPropertyIndex( animator->propertyKey ); if( propertyIndex != Property::INVALID_INDEX ) { if( animator->animate == false ) diff --git a/dali-toolkit/internal/visuals/border/border-visual.cpp b/dali-toolkit/internal/visuals/border/border-visual.cpp index 229d12c..94376e6 100644 --- a/dali-toolkit/internal/visuals/border/border-visual.cpp +++ b/dali-toolkit/internal/visuals/border/border-visual.cpp @@ -20,7 +20,6 @@ // EXTERNAL INCLUDES #include -#include // INTERNAL INCLUDES #include @@ -201,12 +200,12 @@ void BorderVisual::DoSetOnScene( Actor& actor ) { InitializeRenderer(); - mBorderColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::BorderVisual::Property::COLOR, COLOR_NAME, mBorderColor ); + mBorderColorIndex = mImpl->mRenderer.RegisterProperty( Toolkit::BorderVisual::Property::COLOR, COLOR_NAME, mBorderColor ); if( mBorderColor.a < 1.f || mAntiAliasing) { mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON ); } - mBorderSizeIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::BorderVisual::Property::SIZE, SIZE_NAME, mBorderSize ); + mBorderSizeIndex = mImpl->mRenderer.RegisterProperty( Toolkit::BorderVisual::Property::SIZE, SIZE_NAME, mBorderSize ); actor.AddRenderer( mImpl->mRenderer ); diff --git a/dali-toolkit/internal/visuals/color/color-visual.cpp b/dali-toolkit/internal/visuals/color/color-visual.cpp index 4107dcb..dce5255 100644 --- a/dali-toolkit/internal/visuals/color/color-visual.cpp +++ b/dali-toolkit/internal/visuals/color/color-visual.cpp @@ -20,7 +20,6 @@ // EXTERNAL INCLUDES #include -#include //INTERNAL INCLUDES #include @@ -338,7 +337,7 @@ void ColorVisual::InitializeRenderer() // ColorVisual has it's own index key for mix color - use this instead // of using the new base index to avoid changing existing applications // String keys will get to this property. - mImpl->mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::ColorVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) ); + mImpl->mMixColorIndex = mImpl->mRenderer.RegisterProperty( Toolkit::ColorVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) ); mImpl->mRenderer.RegisterProperty( BLUR_RADIUS_NAME, mBlurRadius ); diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp index 265dcd8..e17f701 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -19,7 +19,6 @@ #include "npatch-visual.h" // EXTERNAL INCLUDES -#include #include #include #include @@ -671,8 +670,8 @@ void NPatchVisual::ApplyTextureAndUniforms() auxiliaryPixelData.GetHeight() ); texture.Upload( auxiliaryPixelData ); textureSet.SetTexture( 1, texture ); - DevelHandle::RegisterProperty( mImpl->mRenderer, DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA, - AUXILIARY_IMAGE_ALPHA_NAME, mAuxiliaryImageAlpha ); + mImpl->mRenderer.RegisterProperty( DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA, + AUXILIARY_IMAGE_ALPHA_NAME, mAuxiliaryImageAlpha ); } mImpl->mRenderer.SetTextures( textureSet ); diff --git a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp index 484f58f..449deb7 100644 --- a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp +++ b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -458,7 +457,7 @@ void PrimitiveVisual::InitializeRenderer() // Register transform properties mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT ); - mImpl->mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::PrimitiveVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) ); + mImpl->mMixColorIndex = mImpl->mRenderer.RegisterProperty( Toolkit::PrimitiveVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) ); } void PrimitiveVisual::UpdateShaderUniforms() diff --git a/dali-toolkit/internal/visuals/visual-base-impl.cpp b/dali-toolkit/internal/visuals/visual-base-impl.cpp index c47cfca..885bc72 100755 --- a/dali-toolkit/internal/visuals/visual-base-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-impl.cpp @@ -20,7 +20,6 @@ // EXTERNAL HEADER #include -#include #include #include #include @@ -441,8 +440,7 @@ void Visual::Base::RegisterMixColor() // (Color and Primitive visuals will register their own and save to this index) if( mImpl->mMixColorIndex == Property::INVALID_INDEX ) { - mImpl->mMixColorIndex = DevelHandle::RegisterProperty( - mImpl->mRenderer, + mImpl->mMixColorIndex = mImpl->mRenderer.RegisterProperty( Toolkit::Visual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) ); @@ -556,13 +554,13 @@ Renderer Visual::Base::GetRenderer() Property::Index Visual::Base::GetPropertyIndex( Property::Key key ) { - Property::Index index = DevelHandle::GetPropertyIndex( mImpl->mRenderer, key ); + Property::Index index = mImpl->mRenderer.GetPropertyIndex( key ); if( index == Property::INVALID_INDEX ) { // Is it a shader property? Shader shader = mImpl->mRenderer.GetShader(); - index = DevelHandle::GetPropertyIndex( shader, key ); + index = shader.GetPropertyIndex( key ); if( index != Property::INVALID_INDEX ) { // Yes - we should register it in the Renderer so it can be set / animated @@ -580,7 +578,7 @@ Property::Index Visual::Base::GetPropertyIndex( Property::Key key ) // Leave keyIndex as INVALID_KEY - it can still be registered against the string key. } Property::Value value = shader.GetProperty( index ); - index = DevelHandle::RegisterProperty( mImpl->mRenderer, keyIndex, keyName, value ); + index = mImpl->mRenderer.RegisterProperty( keyIndex, keyName, value ); } } return index; -- 2.7.4