2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "visual-base-impl.h"
22 #include <dali-toolkit/public-api/dali-toolkit-common.h>
23 #include <dali/devel-api/scripting/enum-helper.h>
24 #include <dali/devel-api/rendering/renderer-devel.h>
25 #include <dali/integration-api/debug.h>
28 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
29 #include <dali-toolkit/public-api/visuals/primitive-visual-properties.h>
30 #include <dali-toolkit/public-api/visuals/visual-properties.h>
31 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
32 #include <dali-toolkit/internal/helpers/property-helper.h>
33 #include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
34 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
38 #if defined(DEBUG_ENABLED)
39 Debug::Filter* gVisualBaseLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_VISUAL_BASE" );
42 const char * const PRE_MULTIPLIED_ALPHA_PROPERTY( "preMultipliedAlpha" );
58 DALI_ENUM_TO_STRING_TABLE_BEGIN( VISUAL_FITTING_MODE )
59 DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, FIT_KEEP_ASPECT_RATIO )
60 DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, FILL )
61 DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, OVER_FIT_KEEP_ASPECT_RATIO )
62 DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, CENTER )
63 DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, FIT_WIDTH )
64 DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, FIT_HEIGHT )
65 DALI_ENUM_TO_STRING_TABLE_END( VISUAL_FITTING_MODE )
69 Visual::Base::Base( VisualFactoryCache& factoryCache, FittingMode fittingMode, Toolkit::Visual::Type type )
70 : mImpl( new Impl( fittingMode, type ) ),
71 mFactoryCache( factoryCache )
80 void Visual::Base::Initialize()
82 // The Renderer should be created inside derived class here.
89 if(IsRoundedCornerRequired())
91 mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
92 mImpl->mRenderer.RegisterProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
94 mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
99 void Visual::Base::SetCustomShader( const Property::Map& shaderMap )
101 if( mImpl->mCustomShader )
103 mImpl->mCustomShader->SetPropertyMap( shaderMap );
107 mImpl->mCustomShader = new Impl::CustomShader( shaderMap );
110 // Let derived class know
114 void Visual::Base::SetProperties( const Property::Map& propertyMap )
116 for( size_t i = 0; i < propertyMap.Count(); ++i )
118 const KeyValuePair& pair = propertyMap.GetKeyValue( i );
119 const Property::Key& key = pair.first;
120 const Property::Value& value = pair.second;
122 Property::Key matchKey = key;
123 if( matchKey.type == Property::Key::STRING )
125 if( matchKey == CUSTOM_SHADER )
127 matchKey = Property::Key( Toolkit::Visual::Property::SHADER );
129 else if( matchKey == TRANSFORM )
131 matchKey = Property::Key( Toolkit::Visual::Property::TRANSFORM );
133 else if( matchKey == PREMULTIPLIED_ALPHA )
135 matchKey = Property::Key( Toolkit::Visual::Property::PREMULTIPLIED_ALPHA );
137 else if( matchKey == MIX_COLOR )
139 matchKey = Property::Key( Toolkit::Visual::Property::MIX_COLOR );
141 else if( matchKey == OPACITY )
143 matchKey = Property::Key( Toolkit::Visual::Property::OPACITY );
145 else if( matchKey == VISUAL_FITTING_MODE )
147 matchKey = Property::Key( Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE );
149 else if( matchKey == CORNER_RADIUS )
151 matchKey = Property::Key( Toolkit::DevelVisual::Property::CORNER_RADIUS );
153 else if( matchKey == CORNER_RADIUS_POLICY )
155 matchKey = Property::Key( Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY );
159 switch( matchKey.indexKey )
161 case Toolkit::Visual::Property::SHADER:
163 Property::Map shaderMap;
164 if( value.Get( shaderMap ) )
166 SetCustomShader( shaderMap );
171 case Toolkit::Visual::Property::TRANSFORM:
174 if( value.Get( map ) )
176 mImpl->mTransform.SetPropertyMap( map );
181 case Toolkit::Visual::Property::PREMULTIPLIED_ALPHA:
183 bool premultipliedAlpha = false;
184 if( value.Get( premultipliedAlpha ) )
186 EnablePreMultipliedAlpha( premultipliedAlpha );
191 case Toolkit::Visual::Property::MIX_COLOR:
194 if( value.Get( mixColor ) )
196 if( value.GetType() == Property::VECTOR4 )
198 SetMixColor( mixColor );
202 Vector3 mixColor3(mixColor);
203 SetMixColor( mixColor3 );
208 case Toolkit::Visual::Property::OPACITY:
211 if( value.Get( opacity ) )
213 mImpl->mMixColor.a = opacity;
214 SetMixColor( mImpl->mMixColor );
218 case Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE:
220 Scripting::GetEnumerationProperty< Visual::FittingMode >(
221 value, VISUAL_FITTING_MODE_TABLE, VISUAL_FITTING_MODE_TABLE_COUNT, mImpl->mFittingMode );
224 case Toolkit::DevelVisual::Property::CORNER_RADIUS:
227 if( value.Get( radius ) )
229 mImpl->mCornerRadius = radius;
233 case Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY:
236 if( value.Get( policy ) )
240 case Toolkit::Visual::Transform::Policy::RELATIVE:
241 case Toolkit::Visual::Transform::Policy::ABSOLUTE:
243 mImpl->mCornerRadiusPolicy = policy;
248 DALI_LOG_ERROR( "Unsupported policy: %d\n", policy );
258 DoSetProperties( propertyMap );
261 void Visual::Base::SetTransformAndSize( const Property::Map& transform, Size controlSize )
263 mImpl->mControlSize = controlSize;
264 mImpl->mTransform.UpdatePropertyMap( transform );
266 #if defined(DEBUG_ENABLED)
267 std::ostringstream oss;
269 DALI_LOG_INFO( gVisualBaseLogFilter, Debug::General, "Visual::Base::SetTransformAndSize(%s) - [\e[1;32mtransform: %s controlSize: (%3.1f, %3.1f)]\e[0m\n",
270 GetName().c_str(), oss.str().c_str(), controlSize.x, controlSize.y );
276 void Visual::Base::SetName( const std::string& name )
281 const std::string& Visual::Base::GetName() const
286 float Visual::Base::GetHeightForWidth( float width )
288 float aspectCorrectedHeight = 0.f;
290 GetNaturalSize( naturalSize );
291 if( naturalSize.width )
293 aspectCorrectedHeight = naturalSize.height * width / naturalSize.width;
295 return aspectCorrectedHeight;
298 float Visual::Base::GetWidthForHeight( float height )
300 float aspectCorrectedWidth = 0.f;
302 GetNaturalSize( naturalSize );
303 if( naturalSize.height > 0.0f )
305 aspectCorrectedWidth = naturalSize.width * height / naturalSize.height;
307 return aspectCorrectedWidth;
310 void Visual::Base::GetNaturalSize( Vector2& naturalSize )
312 naturalSize = Vector2::ZERO;
315 void Visual::Base::DoAction( const Property::Index actionId, const Property::Value attributes )
317 OnDoAction( actionId, attributes );
320 void Visual::Base::SetDepthIndex( int index )
322 mImpl->mDepthIndex = index;
323 if( mImpl->mRenderer )
325 mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex );
329 int Visual::Base::GetDepthIndex() const
331 return mImpl->mDepthIndex;
334 void Visual::Base::SetOnScene( Actor& actor )
338 // To display the actor correctly, renderer should not be added to actor until all required resources are ready.
339 // Thus the calling of actor.AddRenderer() should happen inside derived class as base class does not know the exact timing.
340 DoSetOnScene( actor );
344 mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled());
345 mImpl->mRenderer.SetProperty(Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex);
348 mImpl->mFlags |= Impl::IS_ON_SCENE;
352 void Visual::Base::SetOffScene( Actor& actor )
356 DoSetOffScene( actor );
357 mImpl->mFlags &= ~Impl::IS_ON_SCENE;
361 void Visual::Base::CreatePropertyMap( Property::Map& map ) const
365 // Update values from Renderer
366 mImpl->mMixColor = mImpl->mRenderer.GetProperty<Vector3>(mImpl->mMixColorIndex);
367 mImpl->mMixColor.a = mImpl->mRenderer.GetProperty<float>(DevelRenderer::Property::OPACITY);
368 if(mImpl->mTransform.mOffsetIndex != Property::INVALID_INDEX)
370 mImpl->mTransform.mOffset = mImpl->mRenderer.GetProperty<Vector2>(mImpl->mTransform.mOffsetIndex);
372 if(mImpl->mTransform.mSizeIndex != Property::INVALID_INDEX)
374 mImpl->mTransform.mSize = mImpl->mRenderer.GetProperty<Vector2>(mImpl->mTransform.mSizeIndex);
376 if(mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
378 mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<float>(mImpl->mCornerRadiusIndex);
382 DoCreatePropertyMap(map);
384 if(mImpl->mCustomShader)
386 mImpl->mCustomShader->CreatePropertyMap(map);
389 Property::Map transform;
390 mImpl->mTransform.GetPropertyMap( transform );
391 map.Insert( Toolkit::Visual::Property::TRANSFORM, transform );
393 bool premultipliedAlpha( IsPreMultipliedAlphaEnabled() );
394 map.Insert( Toolkit::Visual::Property::PREMULTIPLIED_ALPHA, premultipliedAlpha );
396 // Note, Color and Primitive will also insert their own mix color into the map
397 // which is ok, because they have a different key value range.
398 map.Insert( Toolkit::Visual::Property::MIX_COLOR, mImpl->mMixColor ); // vec4
399 map.Insert( Toolkit::Visual::Property::OPACITY, mImpl->mMixColor.a );
401 auto fittingModeString = Scripting::GetLinearEnumerationName< FittingMode >(
402 mImpl->mFittingMode, VISUAL_FITTING_MODE_TABLE, VISUAL_FITTING_MODE_TABLE_COUNT );
403 map.Insert( Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE, fittingModeString );
405 map.Insert( Toolkit::DevelVisual::Property::CORNER_RADIUS, mImpl->mCornerRadius );
406 map.Insert( Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, static_cast< int >( mImpl->mCornerRadiusPolicy ) );
409 void Visual::Base::CreateInstancePropertyMap( Property::Map& map ) const
411 DoCreateInstancePropertyMap( map );
413 if( mImpl->mCustomShader )
415 mImpl->mCustomShader->CreatePropertyMap( map );
420 void Visual::Base::EnablePreMultipliedAlpha( bool preMultiplied )
424 mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
428 mImpl->mFlags &= ~Impl::IS_PREMULTIPLIED_ALPHA;
431 if( mImpl->mRenderer )
433 mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, preMultiplied);
434 mImpl->mRenderer.RegisterProperty( PRE_MULTIPLIED_ALPHA_PROPERTY, static_cast<float>( preMultiplied ) );
438 bool Visual::Base::IsPreMultipliedAlphaEnabled() const
440 return mImpl->mFlags & Impl::IS_PREMULTIPLIED_ALPHA;
443 void Visual::Base::DoSetOffScene( Actor& actor )
445 actor.RemoveRenderer( mImpl->mRenderer );
448 bool Visual::Base::IsOnScene() const
450 return mImpl->mFlags & Impl::IS_ON_SCENE;
453 bool Visual::Base::IsRoundedCornerRequired() const
455 if(mImpl->mRenderer && mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
457 // Update values from Renderer
458 mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<float>(mImpl->mCornerRadiusIndex);
460 return !EqualsZero(mImpl->mCornerRadius) || mImpl->mNeedCornerRadius;
463 void Visual::Base::OnDoAction( const Property::Index actionId, const Property::Value& attributes )
465 // May be overriden by derived class
468 void Visual::Base::RegisterMixColor()
470 // Only register if not already registered.
471 // (Color and Primitive visuals will register their own and save to this index)
472 if( mImpl->mMixColorIndex == Property::INVALID_INDEX )
474 mImpl->mMixColorIndex = mImpl->mRenderer.RegisterProperty(
475 Toolkit::Visual::Property::MIX_COLOR,
477 Vector3(mImpl->mMixColor) );
480 mImpl->mRenderer.SetProperty( DevelRenderer::Property::OPACITY, mImpl->mMixColor.a );
482 float preMultipliedAlpha = 0.0f;
483 if( IsPreMultipliedAlphaEnabled() )
485 preMultipliedAlpha = 1.0f;
487 mImpl->mRenderer.RegisterProperty( PRE_MULTIPLIED_ALPHA_PROPERTY, preMultipliedAlpha );
490 void Visual::Base::SetMixColor( const Vector4& color )
492 mImpl->mMixColor = color;
494 if( mImpl->mRenderer )
496 mImpl->mRenderer.SetProperty( mImpl->mMixColorIndex, Vector3(color) );
497 mImpl->mRenderer.SetProperty( DevelRenderer::Property::OPACITY, color.a );
501 void Visual::Base::SetMixColor( const Vector3& color )
503 mImpl->mMixColor.r = color.r;
504 mImpl->mMixColor.g = color.g;
505 mImpl->mMixColor.b = color.b;
507 if( mImpl->mRenderer )
509 mImpl->mRenderer.SetProperty( mImpl->mMixColorIndex, color );
513 void Visual::Base::AddEventObserver( Visual::EventObserver& observer)
515 mImpl->mEventObserver = &observer;
518 void Visual::Base::RemoveEventObserver( Visual::EventObserver& observer )
520 mImpl->mEventObserver = NULL;
523 void Visual::Base::ResourceReady(Toolkit::Visual::ResourceStatus resourceStatus)
525 if( mImpl->mResourceStatus != resourceStatus )
527 mImpl->mResourceStatus = resourceStatus;
529 if( mImpl->mEventObserver )
531 // observer is currently a control impl
532 mImpl->mEventObserver->ResourceReady( *this );
537 bool Visual::Base::IsResourceReady() const
539 return ( mImpl->mResourceStatus == Toolkit::Visual::ResourceStatus::READY );
542 bool Visual::Base::IsSynchronousLoadingRequired() const
544 return ( mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING );
547 Toolkit::Visual::Type Visual::Base::GetType() const
552 Toolkit::Visual::ResourceStatus Visual::Base::GetResourceStatus() const
554 return mImpl->mResourceStatus;
557 Visual::FittingMode Visual::Base::GetFittingMode() const
559 return mImpl->mFittingMode;
562 Visual::Base& Visual::Base::GetVisualObject()
567 Renderer Visual::Base::GetRenderer()
569 return mImpl->mRenderer;
572 Property::Index Visual::Base::GetPropertyIndex( Property::Key key )
574 Property::Index index = mImpl->mRenderer.GetPropertyIndex( key );
576 if( index == Property::INVALID_INDEX )
578 // Is it a shader property?
579 Shader shader = mImpl->mRenderer.GetShader();
580 index = shader.GetPropertyIndex( key );
581 if( index != Property::INVALID_INDEX )
583 // Yes - we should register it in the Renderer so it can be set / animated
584 // independently, as shaders are shared across multiple renderers.
586 Property::Index keyIndex( Property::INVALID_KEY );
587 if( key.type == Property::Key::INDEX )
589 keyName = shader.GetPropertyName( index );
590 keyIndex = key.indexKey;
594 keyName = key.stringKey;
595 // Leave keyIndex as INVALID_KEY - it can still be registered against the string key.
597 Property::Value value = shader.GetProperty( index );
598 index = mImpl->mRenderer.RegisterProperty( keyIndex, keyName, value );
604 void Visual::Base::SetupTransition(
605 Dali::Animation& transition,
606 Internal::TransitionData::Animator& animator,
607 Property::Index index,
608 Property::Value& initialValue,
609 Property::Value& targetValue )
611 if( index != Property::INVALID_INDEX )
613 if( mImpl->mRenderer )
615 if( animator.animate == false )
617 mImpl->mRenderer.SetProperty( index, targetValue );
621 if( animator.initialValue.GetType() != Property::NONE )
623 mImpl->mRenderer.SetProperty( index, initialValue );
628 transition = Dali::Animation::New( 0.1f );
631 transition.AnimateTo( Property( mImpl->mRenderer, index ),
633 animator.alphaFunction,
634 TimePeriod( animator.timePeriodDelay,
635 animator.timePeriodDuration ) );
641 void Visual::Base::AnimateProperty(
642 Dali::Animation& transition,
643 Internal::TransitionData::Animator& animator )
645 #if defined(DEBUG_ENABLED)
647 std::ostringstream oss;
648 oss << "Visual::Base::AnimateProperty(Visual:" << mImpl->mName << " Property:" << animator.propertyKey << " Target: " << animator.targetValue << std::endl;
649 DALI_LOG_INFO( gVisualBaseLogFilter, Debug::General, oss.str().c_str() );
653 if(animator.propertyKey == Toolkit::Visual::Property::MIX_COLOR ||
654 animator.propertyKey == MIX_COLOR ||
655 (mImpl->mType == Toolkit::Visual::COLOR &&
656 animator.propertyKey == ColorVisual::Property::MIX_COLOR) ||
657 (mImpl->mType == Toolkit::Visual::PRIMITIVE &&
658 animator.propertyKey == PrimitiveVisual::Property::MIX_COLOR))
660 AnimateMixColorProperty( transition, animator );
662 else if(animator.propertyKey == Toolkit::Visual::Property::OPACITY ||
663 animator.propertyKey == OPACITY )
665 AnimateOpacityProperty( transition, animator );
667 else if( mImpl->mRenderer )
669 AnimateRendererProperty( transition, animator );
673 void Visual::Base::AnimateOpacityProperty(
674 Dali::Animation& transition,
675 Internal::TransitionData::Animator& animator )
678 if( animator.targetValue.Get( targetOpacity ) )
680 mImpl->mMixColor.a = targetOpacity;
683 SetupTransition( transition, animator, DevelRenderer::Property::OPACITY, animator.initialValue, animator.targetValue );
686 void Visual::Base::AnimateRendererProperty(
687 Dali::Animation& transition,
688 Internal::TransitionData::Animator& animator )
690 Property::Index index = GetPropertyIndex( animator.propertyKey );
691 if( index != Property::INVALID_INDEX )
693 if( animator.targetValue.GetType() != Property::NONE )
695 // Try writing target value into transform property map
696 // if it's not a valid key, then it won't alter mTransform
698 if( animator.propertyKey.type == Property::Key::INDEX )
700 map.Add( animator.propertyKey.indexKey, animator.targetValue );
704 map.Add( animator.propertyKey.stringKey, animator.targetValue );
707 mImpl->mTransform.UpdatePropertyMap( map );
710 SetupTransition( transition, animator, index, animator.initialValue, animator.targetValue );
714 void Visual::Base::AnimateMixColorProperty(
715 Dali::Animation& transition,
716 Internal::TransitionData::Animator& animator )
718 Property::Index index = mImpl->mMixColorIndex;
719 bool animateOpacity = false;
721 Property::Value initialOpacity;
722 Property::Value targetOpacity;
723 Property::Value initialMixColor;
724 Property::Value targetMixColor;
726 if( index != Property::INVALID_INDEX )
728 Vector4 initialColor;
729 if( animator.initialValue.Get(initialColor) )
731 if( animator.initialValue.GetType() == Property::VECTOR4 )
733 // if there is an initial color specifying alpha, test it
734 initialOpacity = initialColor.a;
736 initialMixColor = Vector3( initialColor );
739 // Set target value into data store
740 if( animator.targetValue.GetType() != Property::NONE )
743 animator.targetValue.Get(mixColor);
744 if( animator.targetValue.GetType() == Property::VECTOR4 )
746 mImpl->mMixColor.a = mixColor.a;
747 targetOpacity = mixColor.a;
748 animateOpacity = true;
751 mImpl->mMixColor.r = mixColor.r;
752 mImpl->mMixColor.g = mixColor.g;
753 mImpl->mMixColor.b = mixColor.b;
754 targetMixColor = Vector3(mixColor);
757 SetupTransition( transition, animator, index, initialMixColor, targetMixColor );
760 SetupTransition( transition, animator, DevelRenderer::Property::OPACITY, initialOpacity, targetOpacity );
765 Dali::Property Visual::Base::GetPropertyObject(Dali::Property::Key key)
767 if(!mImpl->mRenderer)
770 return Dali::Property(handle, Property::INVALID_INDEX);
773 // Mix color or opacity cases
774 if(key.type == Property::Key::INDEX)
776 if(key.indexKey == Toolkit::Visual::Property::MIX_COLOR || (mImpl->mType == Toolkit::Visual::COLOR && key.indexKey == ColorVisual::Property::MIX_COLOR) || (mImpl->mType == Toolkit::Visual::PRIMITIVE && key.indexKey == PrimitiveVisual::Property::MIX_COLOR))
778 return Dali::Property(mImpl->mRenderer, mImpl->mMixColorIndex);
780 else if(key.indexKey == Toolkit::Visual::Property::OPACITY)
782 return Dali::Property(mImpl->mRenderer, DevelRenderer::Property::OPACITY);
784 else if(key.indexKey == Toolkit::Visual::Transform::Property::OFFSET)
786 return Dali::Property(mImpl->mRenderer, OFFSET);
788 else if(key.indexKey == Toolkit::Visual::Transform::Property::SIZE)
790 return Dali::Property(mImpl->mRenderer, SIZE);
795 if(key.stringKey == MIX_COLOR)
797 return Dali::Property(mImpl->mRenderer, mImpl->mMixColorIndex);
799 else if(key.stringKey == OPACITY)
801 return Dali::Property(mImpl->mRenderer, DevelRenderer::Property::OPACITY);
803 else if(key.stringKey == OFFSET)
805 return Dali::Property(mImpl->mRenderer, OFFSET);
807 else if(key.stringKey == SIZE)
809 return Dali::Property(mImpl->mRenderer, SIZE);
814 Property::Index index = GetPropertyIndex(key);
815 if(index == Property::INVALID_INDEX)
817 if((key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::CORNER_RADIUS) || (key.type == Property::Key::STRING && key.stringKey == CORNER_RADIUS))
819 // Register CORNER_RADIUS property
820 mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
821 mImpl->mRenderer.RegisterProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
823 mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
825 index = mImpl->mCornerRadiusIndex;
826 mImpl->mNeedCornerRadius = true;
833 // We can't find the property in the base class.
834 // Request to child class
835 return OnGetPropertyObject(key);
839 return Dali::Property(mImpl->mRenderer, index);
842 } // namespace Internal
844 } // namespace Toolkit