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/rendering/renderer-devel.h>
24 #include <dali/devel-api/scripting/enum-helper.h>
25 #include <dali/integration-api/debug.h>
28 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
29 #include <dali-toolkit/internal/helpers/property-helper.h>
30 #include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
31 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
32 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
33 #include <dali-toolkit/public-api/visuals/primitive-visual-properties.h>
34 #include <dali-toolkit/public-api/visuals/visual-properties.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");
54 DALI_ENUM_TO_STRING_TABLE_BEGIN(VISUAL_FITTING_MODE)
55 DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, FIT_KEEP_ASPECT_RATIO)
56 DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, FILL)
57 DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, OVER_FIT_KEEP_ASPECT_RATIO)
58 DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, CENTER)
59 DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, FIT_WIDTH)
60 DALI_ENUM_TO_STRING_WITH_SCOPE(Visual::FittingMode, FIT_HEIGHT)
61 DALI_ENUM_TO_STRING_TABLE_END(VISUAL_FITTING_MODE)
65 Visual::Base::Base(VisualFactoryCache& factoryCache, FittingMode fittingMode, Toolkit::Visual::Type type)
66 : mImpl(new Impl(fittingMode, type)),
67 mFactoryCache(factoryCache)
76 void Visual::Base::Initialize()
78 // The Renderer should be created inside derived class here.
85 if(IsRoundedCornerRequired())
87 mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
88 mImpl->mRenderer.RegisterProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
90 mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
95 void Visual::Base::SetCustomShader(const Property::Map& shaderMap)
97 if(mImpl->mCustomShader)
99 mImpl->mCustomShader->SetPropertyMap(shaderMap);
103 mImpl->mCustomShader = new Impl::CustomShader(shaderMap);
106 // Let derived class know
110 void Visual::Base::SetProperties(const Property::Map& propertyMap)
112 for(size_t i = 0; i < propertyMap.Count(); ++i)
114 const KeyValuePair& pair = propertyMap.GetKeyValue(i);
115 const Property::Key& key = pair.first;
116 const Property::Value& value = pair.second;
118 Property::Key matchKey = key;
119 if(matchKey.type == Property::Key::STRING)
121 if(matchKey == CUSTOM_SHADER)
123 matchKey = Property::Key(Toolkit::Visual::Property::SHADER);
125 else if(matchKey == TRANSFORM)
127 matchKey = Property::Key(Toolkit::Visual::Property::TRANSFORM);
129 else if(matchKey == PREMULTIPLIED_ALPHA)
131 matchKey = Property::Key(Toolkit::Visual::Property::PREMULTIPLIED_ALPHA);
133 else if(matchKey == MIX_COLOR)
135 matchKey = Property::Key(Toolkit::Visual::Property::MIX_COLOR);
137 else if(matchKey == OPACITY)
139 matchKey = Property::Key(Toolkit::Visual::Property::OPACITY);
141 else if(matchKey == VISUAL_FITTING_MODE)
143 matchKey = Property::Key(Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE);
145 else if(matchKey == CORNER_RADIUS)
147 matchKey = Property::Key(Toolkit::DevelVisual::Property::CORNER_RADIUS);
149 else if(matchKey == CORNER_RADIUS_POLICY)
151 matchKey = Property::Key(Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY);
155 switch(matchKey.indexKey)
157 case Toolkit::Visual::Property::SHADER:
159 Property::Map shaderMap;
160 if(value.Get(shaderMap))
162 SetCustomShader(shaderMap);
167 case Toolkit::Visual::Property::TRANSFORM:
172 mImpl->mTransform.SetPropertyMap(map);
177 case Toolkit::Visual::Property::PREMULTIPLIED_ALPHA:
179 bool premultipliedAlpha = false;
180 if(value.Get(premultipliedAlpha))
182 EnablePreMultipliedAlpha(premultipliedAlpha);
187 case Toolkit::Visual::Property::MIX_COLOR:
190 if(value.Get(mixColor))
192 if(value.GetType() == Property::VECTOR4)
194 SetMixColor(mixColor);
198 Vector3 mixColor3(mixColor);
199 SetMixColor(mixColor3);
204 case Toolkit::Visual::Property::OPACITY:
207 if(value.Get(opacity))
209 mImpl->mMixColor.a = opacity;
210 SetMixColor(mImpl->mMixColor);
214 case Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE:
216 Scripting::GetEnumerationProperty<Visual::FittingMode>(
217 value, VISUAL_FITTING_MODE_TABLE, VISUAL_FITTING_MODE_TABLE_COUNT, mImpl->mFittingMode);
220 case Toolkit::DevelVisual::Property::CORNER_RADIUS:
222 if(value.GetType() == Property::VECTOR4)
224 // If CORNER_RADIUS Property is Vector4,
225 // Each values mean the radius of
226 // (top-left, top-right, bottom-right, bottom-left)
228 if(value.Get(radius))
230 mImpl->mCornerRadius = radius;
235 // If CORNER_RADIUS Property is float,
236 // Every corner radius have same value
238 if(value.Get(radius))
240 mImpl->mCornerRadius = Vector4(radius, radius, radius, radius);
245 case Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY:
248 if(value.Get(policy))
252 case Toolkit::Visual::Transform::Policy::RELATIVE:
253 case Toolkit::Visual::Transform::Policy::ABSOLUTE:
255 mImpl->mCornerRadiusPolicy = policy;
260 DALI_LOG_ERROR("Unsupported policy: %d\n", policy);
270 DoSetProperties(propertyMap);
273 void Visual::Base::SetTransformAndSize(const Property::Map& transform, Size controlSize)
275 mImpl->mControlSize = controlSize;
276 mImpl->mTransform.UpdatePropertyMap(transform);
278 #if defined(DEBUG_ENABLED)
279 std::ostringstream oss;
281 DALI_LOG_INFO(gVisualBaseLogFilter, Debug::General, "Visual::Base::SetTransformAndSize(%s) - [\e[1;32mtransform: %s controlSize: (%3.1f, %3.1f)]\e[0m\n", GetName().c_str(), oss.str().c_str(), controlSize.x, controlSize.y);
287 void Visual::Base::SetName(const std::string& name)
292 const std::string& Visual::Base::GetName() const
297 float Visual::Base::GetHeightForWidth(float width)
299 float aspectCorrectedHeight = 0.f;
301 GetNaturalSize(naturalSize);
302 if(naturalSize.width)
304 aspectCorrectedHeight = naturalSize.height * width / naturalSize.width;
306 return aspectCorrectedHeight;
309 float Visual::Base::GetWidthForHeight(float height)
311 float aspectCorrectedWidth = 0.f;
313 GetNaturalSize(naturalSize);
314 if(naturalSize.height > 0.0f)
316 aspectCorrectedWidth = naturalSize.width * height / naturalSize.height;
318 return aspectCorrectedWidth;
321 void Visual::Base::GetNaturalSize(Vector2& naturalSize)
323 naturalSize = Vector2::ZERO;
326 void Visual::Base::DoAction(const Property::Index actionId, const Property::Value attributes)
328 OnDoAction(actionId, attributes);
331 void Visual::Base::SetDepthIndex(int index)
333 mImpl->mDepthIndex = index;
336 mImpl->mRenderer.SetProperty(Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex);
340 int Visual::Base::GetDepthIndex() const
342 return mImpl->mDepthIndex;
345 void Visual::Base::SetOnScene(Actor& actor)
349 // To display the actor correctly, renderer should not be added to actor until all required resources are ready.
350 // Thus the calling of actor.AddRenderer() should happen inside derived class as base class does not know the exact timing.
355 mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled());
356 mImpl->mRenderer.SetProperty(Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex);
359 mImpl->mFlags |= Impl::IS_ON_SCENE;
363 void Visual::Base::SetOffScene(Actor& actor)
367 DoSetOffScene(actor);
368 mImpl->mFlags &= ~Impl::IS_ON_SCENE;
372 void Visual::Base::CreatePropertyMap(Property::Map& map) const
376 // Update values from Renderer
377 mImpl->mMixColor = mImpl->mRenderer.GetProperty<Vector3>(mImpl->mMixColorIndex);
378 mImpl->mMixColor.a = mImpl->mRenderer.GetProperty<float>(DevelRenderer::Property::OPACITY);
379 if(mImpl->mTransform.mOffsetIndex != Property::INVALID_INDEX)
381 mImpl->mTransform.mOffset = mImpl->mRenderer.GetProperty<Vector2>(mImpl->mTransform.mOffsetIndex);
383 if(mImpl->mTransform.mSizeIndex != Property::INVALID_INDEX)
385 mImpl->mTransform.mSize = mImpl->mRenderer.GetProperty<Vector2>(mImpl->mTransform.mSizeIndex);
387 if(mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
389 mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mCornerRadiusIndex);
393 DoCreatePropertyMap(map);
395 if(mImpl->mCustomShader)
397 mImpl->mCustomShader->CreatePropertyMap(map);
400 Property::Map transform;
401 mImpl->mTransform.GetPropertyMap(transform);
402 map.Insert(Toolkit::Visual::Property::TRANSFORM, transform);
404 bool premultipliedAlpha(IsPreMultipliedAlphaEnabled());
405 map.Insert(Toolkit::Visual::Property::PREMULTIPLIED_ALPHA, premultipliedAlpha);
407 // Note, Color and Primitive will also insert their own mix color into the map
408 // which is ok, because they have a different key value range.
409 map.Insert(Toolkit::Visual::Property::MIX_COLOR, mImpl->mMixColor); // vec4
410 map.Insert(Toolkit::Visual::Property::OPACITY, mImpl->mMixColor.a);
412 auto fittingModeString = Scripting::GetLinearEnumerationName<FittingMode>(
413 mImpl->mFittingMode, VISUAL_FITTING_MODE_TABLE, VISUAL_FITTING_MODE_TABLE_COUNT);
414 map.Insert(Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE, fittingModeString);
416 map.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, mImpl->mCornerRadius);
417 map.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, static_cast<int>(mImpl->mCornerRadiusPolicy));
420 void Visual::Base::CreateInstancePropertyMap(Property::Map& map) const
422 DoCreateInstancePropertyMap(map);
424 if(mImpl->mCustomShader)
426 mImpl->mCustomShader->CreatePropertyMap(map);
430 void Visual::Base::EnablePreMultipliedAlpha(bool preMultiplied)
434 mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
438 mImpl->mFlags &= ~Impl::IS_PREMULTIPLIED_ALPHA;
443 mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, preMultiplied);
444 mImpl->mRenderer.RegisterProperty(PRE_MULTIPLIED_ALPHA_PROPERTY, static_cast<float>(preMultiplied));
448 bool Visual::Base::IsPreMultipliedAlphaEnabled() const
450 return mImpl->mFlags & Impl::IS_PREMULTIPLIED_ALPHA;
453 void Visual::Base::DoSetOffScene(Actor& actor)
455 actor.RemoveRenderer(mImpl->mRenderer);
458 bool Visual::Base::IsOnScene() const
460 return mImpl->mFlags & Impl::IS_ON_SCENE;
463 bool Visual::Base::IsRoundedCornerRequired() const
465 if(mImpl->mRenderer && mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
467 // Update values from Renderer
468 mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mCornerRadiusIndex);
470 return !(mImpl->mCornerRadius == Vector4::ZERO) || mImpl->mNeedCornerRadius;
473 void Visual::Base::OnDoAction(const Property::Index actionId, const Property::Value& attributes)
475 // May be overriden by derived class
478 void Visual::Base::RegisterMixColor()
480 // Only register if not already registered.
481 // (Color and Primitive visuals will register their own and save to this index)
482 if(mImpl->mMixColorIndex == Property::INVALID_INDEX)
484 mImpl->mMixColorIndex = mImpl->mRenderer.RegisterProperty(
485 Toolkit::Visual::Property::MIX_COLOR,
487 Vector3(mImpl->mMixColor));
490 mImpl->mRenderer.SetProperty(DevelRenderer::Property::OPACITY, mImpl->mMixColor.a);
492 float preMultipliedAlpha = 0.0f;
493 if(IsPreMultipliedAlphaEnabled())
495 preMultipliedAlpha = 1.0f;
497 mImpl->mRenderer.RegisterProperty(PRE_MULTIPLIED_ALPHA_PROPERTY, preMultipliedAlpha);
500 void Visual::Base::SetMixColor(const Vector4& color)
502 mImpl->mMixColor = color;
506 mImpl->mRenderer.SetProperty(mImpl->mMixColorIndex, Vector3(color));
507 mImpl->mRenderer.SetProperty(DevelRenderer::Property::OPACITY, color.a);
511 void Visual::Base::SetMixColor(const Vector3& color)
513 mImpl->mMixColor.r = color.r;
514 mImpl->mMixColor.g = color.g;
515 mImpl->mMixColor.b = color.b;
519 mImpl->mRenderer.SetProperty(mImpl->mMixColorIndex, color);
523 void Visual::Base::AddEventObserver(Visual::EventObserver& observer)
525 mImpl->mEventObserver = &observer;
528 void Visual::Base::RemoveEventObserver(Visual::EventObserver& observer)
530 mImpl->mEventObserver = NULL;
533 void Visual::Base::ResourceReady(Toolkit::Visual::ResourceStatus resourceStatus)
535 if(mImpl->mResourceStatus != resourceStatus)
537 mImpl->mResourceStatus = resourceStatus;
539 if(mImpl->mEventObserver)
541 // observer is currently a control impl
542 mImpl->mEventObserver->ResourceReady(*this);
547 bool Visual::Base::IsResourceReady() const
549 return (mImpl->mResourceStatus == Toolkit::Visual::ResourceStatus::READY);
552 bool Visual::Base::IsSynchronousLoadingRequired() const
554 return (mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING);
557 Toolkit::Visual::Type Visual::Base::GetType() const
562 Toolkit::Visual::ResourceStatus Visual::Base::GetResourceStatus() const
564 return mImpl->mResourceStatus;
567 Visual::FittingMode Visual::Base::GetFittingMode() const
569 return mImpl->mFittingMode;
572 Visual::Base& Visual::Base::GetVisualObject()
577 Renderer Visual::Base::GetRenderer()
579 return mImpl->mRenderer;
582 Property::Index Visual::Base::GetPropertyIndex(Property::Key key)
584 Property::Index index = mImpl->mRenderer.GetPropertyIndex(key);
586 if(index == Property::INVALID_INDEX)
588 // Is it a shader property?
589 Shader shader = mImpl->mRenderer.GetShader();
590 index = shader.GetPropertyIndex(key);
591 if(index != Property::INVALID_INDEX)
593 // Yes - we should register it in the Renderer so it can be set / animated
594 // independently, as shaders are shared across multiple renderers.
596 Property::Index keyIndex(Property::INVALID_KEY);
597 if(key.type == Property::Key::INDEX)
599 keyName = shader.GetPropertyName(index);
600 keyIndex = key.indexKey;
604 keyName = key.stringKey;
605 // Leave keyIndex as INVALID_KEY - it can still be registered against the string key.
607 Property::Value value = shader.GetProperty(index);
608 index = mImpl->mRenderer.RegisterProperty(keyIndex, keyName, value);
614 void Visual::Base::SetupTransition(
615 Dali::Animation& transition,
616 Internal::TransitionData::Animator& animator,
617 Property::Index index,
618 Property::Value& initialValue,
619 Property::Value& targetValue)
621 if(index != Property::INVALID_INDEX)
625 if(animator.animate == false)
627 mImpl->mRenderer.SetProperty(index, targetValue);
631 if(animator.initialValue.GetType() != Property::NONE)
633 mImpl->mRenderer.SetProperty(index, initialValue);
638 transition = Dali::Animation::New(0.1f);
641 transition.AnimateTo(Property(mImpl->mRenderer, index),
643 animator.alphaFunction,
644 TimePeriod(animator.timePeriodDelay,
645 animator.timePeriodDuration));
651 void Visual::Base::AnimateProperty(
652 Dali::Animation& transition,
653 Internal::TransitionData::Animator& animator)
655 #if defined(DEBUG_ENABLED)
657 std::ostringstream oss;
658 oss << "Visual::Base::AnimateProperty(Visual:" << mImpl->mName << " Property:" << animator.propertyKey << " Target: " << animator.targetValue << std::endl;
659 DALI_LOG_INFO(gVisualBaseLogFilter, Debug::General, oss.str().c_str());
663 if(animator.propertyKey == Toolkit::Visual::Property::MIX_COLOR ||
664 animator.propertyKey == MIX_COLOR ||
665 (mImpl->mType == Toolkit::Visual::COLOR &&
666 animator.propertyKey == ColorVisual::Property::MIX_COLOR) ||
667 (mImpl->mType == Toolkit::Visual::PRIMITIVE &&
668 animator.propertyKey == PrimitiveVisual::Property::MIX_COLOR))
670 AnimateMixColorProperty(transition, animator);
672 else if(animator.propertyKey == Toolkit::Visual::Property::OPACITY ||
673 animator.propertyKey == OPACITY)
675 AnimateOpacityProperty(transition, animator);
677 else if(mImpl->mRenderer)
679 AnimateRendererProperty(transition, animator);
683 void Visual::Base::AnimateOpacityProperty(
684 Dali::Animation& transition,
685 Internal::TransitionData::Animator& animator)
688 if(animator.targetValue.Get(targetOpacity))
690 mImpl->mMixColor.a = targetOpacity;
693 SetupTransition(transition, animator, DevelRenderer::Property::OPACITY, animator.initialValue, animator.targetValue);
696 void Visual::Base::AnimateRendererProperty(
697 Dali::Animation& transition,
698 Internal::TransitionData::Animator& animator)
700 Property::Index index = GetPropertyIndex(animator.propertyKey);
701 if(index != Property::INVALID_INDEX)
703 if(animator.targetValue.GetType() != Property::NONE)
705 // Try writing target value into transform property map
706 // if it's not a valid key, then it won't alter mTransform
708 if(animator.propertyKey.type == Property::Key::INDEX)
710 map.Add(animator.propertyKey.indexKey, animator.targetValue);
714 map.Add(animator.propertyKey.stringKey, animator.targetValue);
717 mImpl->mTransform.UpdatePropertyMap(map);
720 SetupTransition(transition, animator, index, animator.initialValue, animator.targetValue);
724 void Visual::Base::AnimateMixColorProperty(
725 Dali::Animation& transition,
726 Internal::TransitionData::Animator& animator)
728 Property::Index index = mImpl->mMixColorIndex;
729 bool animateOpacity = false;
731 Property::Value initialOpacity;
732 Property::Value targetOpacity;
733 Property::Value initialMixColor;
734 Property::Value targetMixColor;
736 if(index != Property::INVALID_INDEX)
738 Vector4 initialColor;
739 if(animator.initialValue.Get(initialColor))
741 if(animator.initialValue.GetType() == Property::VECTOR4)
743 // if there is an initial color specifying alpha, test it
744 initialOpacity = initialColor.a;
746 initialMixColor = Vector3(initialColor);
749 // Set target value into data store
750 if(animator.targetValue.GetType() != Property::NONE)
753 animator.targetValue.Get(mixColor);
754 if(animator.targetValue.GetType() == Property::VECTOR4)
756 mImpl->mMixColor.a = mixColor.a;
757 targetOpacity = mixColor.a;
758 animateOpacity = true;
761 mImpl->mMixColor.r = mixColor.r;
762 mImpl->mMixColor.g = mixColor.g;
763 mImpl->mMixColor.b = mixColor.b;
764 targetMixColor = Vector3(mixColor);
767 SetupTransition(transition, animator, index, initialMixColor, targetMixColor);
770 SetupTransition(transition, animator, DevelRenderer::Property::OPACITY, initialOpacity, targetOpacity);
775 Dali::Property Visual::Base::GetPropertyObject(Dali::Property::Key key)
777 if(!mImpl->mRenderer)
780 return Dali::Property(handle, Property::INVALID_INDEX);
783 // Mix color or opacity cases
784 if(key.type == Property::Key::INDEX)
786 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))
788 return Dali::Property(mImpl->mRenderer, mImpl->mMixColorIndex);
790 else if(key.indexKey == Toolkit::Visual::Property::OPACITY)
792 return Dali::Property(mImpl->mRenderer, DevelRenderer::Property::OPACITY);
794 else if(key.indexKey == Toolkit::Visual::Transform::Property::OFFSET)
796 return Dali::Property(mImpl->mRenderer, OFFSET);
798 else if(key.indexKey == Toolkit::Visual::Transform::Property::SIZE)
800 return Dali::Property(mImpl->mRenderer, SIZE);
805 if(key.stringKey == MIX_COLOR)
807 return Dali::Property(mImpl->mRenderer, mImpl->mMixColorIndex);
809 else if(key.stringKey == OPACITY)
811 return Dali::Property(mImpl->mRenderer, DevelRenderer::Property::OPACITY);
813 else if(key.stringKey == OFFSET)
815 return Dali::Property(mImpl->mRenderer, OFFSET);
817 else if(key.stringKey == SIZE)
819 return Dali::Property(mImpl->mRenderer, SIZE);
824 Property::Index index = GetPropertyIndex(key);
825 if(index == Property::INVALID_INDEX)
827 if((key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::CORNER_RADIUS) || (key.type == Property::Key::STRING && key.stringKey == CORNER_RADIUS))
829 // Register CORNER_RADIUS property
830 mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
831 mImpl->mRenderer.RegisterProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
833 mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
835 index = mImpl->mCornerRadiusIndex;
836 mImpl->mNeedCornerRadius = true;
843 // We can't find the property in the base class.
844 // Request to child class
845 return OnGetPropertyObject(key);
849 return Dali::Property(mImpl->mRenderer, index);
852 } // namespace Internal
854 } // namespace Toolkit