Make some visual use DecoratedVisualRenderer s.t. use some properties as default :
CORNER_RADIUS
CORNER_RADIUS_POLICY
BORDERLINE_WIDTH
BORDERLINE_COLOR
BORDERLINE_OFFSET
BLUR_RADIUS
Now BORDERLINE_WIDTH and BLUR_RADIUS informations can be accessed in
dali-core level. So we can calculate update size
Change-Id: Ib9d20d202a939acf70eac12f602b05c1451e1030
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
#include <dali-toolkit/public-api/transition/transition-set.h>
#include <dali-toolkit/public-api/transition/transition.h>
#include <dali/devel-api/actors/actor-devel.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h> // for Renderer Property Index.
#include <stdlib.h>
#include <iostream>
DALI_TEST_NOT_EQUALS(destinationPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), 0.00001f, TEST_LOCATION);
DALI_TEST_EQUALS(1, control2.GetRendererCount(), TEST_LOCATION);
- Dali::Renderer renderer = control2.GetRendererAt(0);
- Property::Index index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
- cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
+ Dali::Renderer renderer = control2.GetRendererAt(0);
+ cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
DALI_TEST_NOT_EQUALS(destinationRadiusV4, cornerRadius, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
- borderlineWidth = renderer.GetCurrentProperty<float>(index);
+ borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
DALI_TEST_NOT_EQUALS(destinationBorderlineWidth, borderlineWidth, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
- borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+ borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
DALI_TEST_NOT_EQUALS(destinationBorderlineColor, borderlineColor, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
- borderlineOffset = renderer.GetCurrentProperty<float>(index);
+ borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
DALI_TEST_NOT_EQUALS(destinationBorderlineOffset, borderlineOffset, 0.00001f, TEST_LOCATION);
application.SendNotification();
DALI_TEST_EQUALS(destinationOpacity, control2.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
DALI_TEST_EQUALS(1, control2.GetRendererCount(), TEST_LOCATION);
renderer = control2.GetRendererAt(0);
- index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
- cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
+ cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
- borderlineWidth = renderer.GetCurrentProperty<float>(index);
+ borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
- borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+ borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
- borderlineOffset = renderer.GetCurrentProperty<float>(index);
+ borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
END_TEST;
DALI_TEST_NOT_EQUALS(destinationPosition, control1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), 0.00001f, TEST_LOCATION);
DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
- Dali::Renderer renderer = control1.GetRendererAt(0);
- Property::Index index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
- cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
+ Dali::Renderer renderer = control1.GetRendererAt(0);
+ cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
DALI_TEST_NOT_EQUALS(destinationRadiusV4, cornerRadius, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
- borderlineWidth = renderer.GetCurrentProperty<float>(index);
+ borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
DALI_TEST_NOT_EQUALS(destinationBorderlineWidth, borderlineWidth, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
- borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+ borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
DALI_TEST_NOT_EQUALS(destinationBorderlineColor, borderlineColor, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
- borderlineOffset = renderer.GetCurrentProperty<float>(index);
+ borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
DALI_TEST_NOT_EQUALS(destinationBorderlineOffset, borderlineOffset, 0.00001f, TEST_LOCATION);
application.SendNotification();
DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
renderer = control1.GetRendererAt(0);
- index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
- cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
+ cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
- borderlineWidth = renderer.GetCurrentProperty<float>(index);
+ borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
- borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+ borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
- borderlineOffset = renderer.GetCurrentProperty<float>(index);
+ borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
// every actor properties of control1 are returned to the source properties.
// after next update, renderer properties are returned to the source properties.
DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
renderer = control1.GetRendererAt(0);
- index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
- cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
+ cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
DALI_TEST_EQUALS(sourceRadiusV4, cornerRadius, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
- borderlineWidth = renderer.GetCurrentProperty<float>(index);
+ borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
DALI_TEST_EQUALS(sourceBorderlineWidth, borderlineWidth, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
- borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+ borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
DALI_TEST_EQUALS(sourceBorderlineColor, borderlineColor, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
- borderlineOffset = renderer.GetCurrentProperty<float>(index);
+ borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
DALI_TEST_EQUALS(sourceBorderlineOffset, borderlineOffset, TEST_LOCATION);
END_TEST;
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
#include <memory>
// INTERNAL INCLUDES
{
namespace
{
-const int CUSTOM_PROPERTY_COUNT(10); // ltr, wrap, pixel area, crop to mask, mask texture ratio + border/corner
+const int CUSTOM_PROPERTY_COUNT(5); // ltr, wrap, pixel area, crop to mask, mask texture ratio
// stop behavior
DALI_ENUM_TO_STRING_TABLE_BEGIN(STOP_BEHAVIOR)
if(mAnimatedImageLoading)
{
- mImageCache = new RollingAnimatedImageCache(textureManager, mAnimatedImageLoading, mMaskingData, *this, mCacheSize, mBatchSize, IsSynchronousLoadingRequired(),mFactoryCache.GetPreMultiplyOnLoad());
+ mImageCache = new RollingAnimatedImageCache(textureManager, mAnimatedImageLoading, mMaskingData, *this, mCacheSize, mBatchSize, IsSynchronousLoadingRequired(), mFactoryCache.GetPreMultiplyOnLoad());
}
else if(mImageUrls)
{
Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
- mImpl->mRenderer = VisualRenderer::New(geometry, shader);
+ mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
// Register transform properties
{
if(mMaskingData && !mMaskingData->mPreappliedMasking)
{
- bool maskLoadFailed = true;
- TextureSet textures = mImpl->mRenderer.GetTextures();
+ bool maskLoadFailed = true;
+ TextureSet textures = mImpl->mRenderer.GetTextures();
if(textures && textures.GetTextureCount() >= TEXTURE_COUNT_FOR_GPU_ALPHA_MASK)
{
maskLoadFailed = false;
#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/rendering/renderer-devel.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h>
{
namespace
{
-const int CUSTOM_PROPERTY_COUNT(6); // 5 transform properties + pixel area,
+const int CUSTOM_PROPERTY_COUNT(1); // pixel area,
const Dali::Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
- mImpl->mRenderer = VisualRenderer::New(geometry, shader);
+ mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
TextureSet textureSet = TextureSet::New();
// EXTERNAL INCLUDES
#include <dali/devel-api/rendering/renderer-devel.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
//INTERNAL INCLUDES
#include <dali-toolkit/devel-api/visuals/color-visual-properties-devel.h>
{
namespace
{
-const int CUSTOM_PROPERTY_COUNT(6); // Blur Radius + border/corner
+const int CUSTOM_PROPERTY_COUNT(0);
VisualFactoryCache::ShaderType SHADER_TYPE_TABLE[6] =
{
ColorVisual::ColorVisual(VisualFactoryCache& factoryCache)
: Visual::Base(factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::COLOR),
mBlurRadius(0.0f),
- mBlurRadiusIndex(Property::INVALID_INDEX),
mAlwaysUsingBlurRadius(false)
{
}
DALI_LOG_ERROR("ColorVisual:DoSetProperties:: BLUR_RADIUS property has incorrect type: %d\n", blurRadiusValue->GetType());
}
- if(mBlurRadiusIndex != Property::INVALID_INDEX)
- {
- mImpl->mRenderer.SetProperty(mBlurRadiusIndex, mBlurRadius);
- }
- else if(DALI_UNLIKELY(mImpl->mRenderer && (!EqualsZero(mBlurRadius) || mAlwaysUsingBlurRadius)))
+ if(DALI_UNLIKELY(mImpl->mRenderer))
{
// Unusual case. SetProperty called after OnInitialize().
// Assume that DoAction call UPDATE_PROPERTY.
- // We must regist properies into renderer, and update shader.
-
- // BlurRadius added by this action. Regist property to renderer.
- mBlurRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelColorVisual::Property::BLUR_RADIUS, BLUR_RADIUS_NAME, mBlurRadius);
- mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+ DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBlurRadiusUniform();
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BLUR_RADIUS, mBlurRadius);
- // Change the shader must not be occured many times. we always have to use blur feature.
- mAlwaysUsingBlurRadius = true;
-
- // Change shader
- UpdateShader();
+ // Check whether we must update shader.
+ if(!mAlwaysUsingBlurRadius && IsBlurRequired())
+ {
+ // Change the shader must not be occured many times. we always have to use blur feature.
+ mAlwaysUsingBlurRadius = true;
+
+ mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+ // Change shader
+ if(!mImpl->mCustomShader)
+ {
+ UpdateShader();
+ }
+ }
}
}
}
map.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
map.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, mImpl->mMixColor);
- if(mImpl->mRenderer && mBlurRadiusIndex != Property::INVALID_INDEX)
+ if(mImpl->mRenderer)
{
// Update values from Renderer
- float blurRadius = mImpl->mRenderer.GetProperty<float>(mBlurRadiusIndex);
+ float blurRadius = mImpl->mRenderer.GetProperty<float>(DecoratedVisualRenderer::Property::BLUR_RADIUS);
map.Insert(Toolkit::DevelColorVisual::Property::BLUR_RADIUS, blurRadius);
}
else
Shader shader = GenerateShader();
- mImpl->mRenderer = VisualRenderer::New(geometry, shader);
+ mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
mImpl->mRenderer.SetProperty(VisualRenderer::Property::VISUAL_MIX_COLOR, Vector3(mImpl->mMixColor));
- if(!EqualsZero(mBlurRadius))
+ if(mAlwaysUsingBlurRadius || !EqualsZero(mBlurRadius))
{
- mBlurRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelColorVisual::Property::BLUR_RADIUS, BLUR_RADIUS_NAME, mBlurRadius);
+ DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBlurRadiusUniform();
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BLUR_RADIUS, mBlurRadius);
mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
}
bool roundedCorner = IsRoundedCornerRequired();
bool borderline = IsBorderlineRequired();
- bool blur = !EqualsZero(mBlurRadius) || mAlwaysUsingBlurRadius;
+ bool blur = IsBlurRequired();
int shaderTypeFlag = ColorVisualRequireFlag::DEFAULT;
if(roundedCorner)
if((key.type == Property::Key::INDEX && key.indexKey == DevelColorVisual::Property::BLUR_RADIUS) || (key.type == Property::Key::STRING && key.stringKey == BLUR_RADIUS_NAME))
{
- mBlurRadiusIndex = mImpl->mRenderer.RegisterProperty(DevelColorVisual::Property::BLUR_RADIUS, BLUR_RADIUS_NAME, mBlurRadius);
+ const bool updateShader = !mImpl->mCustomShader && !IsBlurRequired();
// Blur is animated now. we always have to use blur feature.
mAlwaysUsingBlurRadius = true;
- mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
-
- // Change shader
- UpdateShader();
+ if(updateShader)
+ {
+ // Update each values to renderer
+ DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBlurRadiusUniform();
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BLUR_RADIUS, mBlurRadius);
- return Dali::Property(mImpl->mRenderer, mBlurRadiusIndex);
+ // Change shader
+ UpdateShader();
+ }
+ mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+ return Dali::Property(mImpl->mRenderer, DecoratedVisualRenderer::Property::BLUR_RADIUS);
}
Handle handle;
return Dali::Property(handle, Property::INVALID_INDEX);
}
+bool ColorVisual::IsBlurRequired() const
+{
+ float blurRadius = mBlurRadius;
+ if(mImpl->mRenderer)
+ {
+ // Update values from Renderer
+ blurRadius = mImpl->mRenderer.GetProperty<float>(DecoratedVisualRenderer::Property::BLUR_RADIUS);
+ }
+ return mAlwaysUsingBlurRadius || !EqualsZero(blurRadius);
+}
+
} // namespace Internal
} // namespace Toolkit
*/
Dali::Property OnGetPropertyObject(Dali::Property::Key key) override;
+protected:
+ /**
+ * @brief Query whether the visual requires to be blur.
+ *
+ * @return Returns true if the blur is required, false otherwise.
+ */
+ bool IsBlurRequired() const;
+
private:
// Undefined
ColorVisual(const ColorVisual& colorRenderer);
ColorVisual& operator=(const ColorVisual& colorRenderer);
private:
- float mBlurRadius; ///< The blur radius
- Property::Index mBlurRadiusIndex; ///< The blur radius property index
- bool mAlwaysUsingBlurRadius : 1; ///< Whether we need the blur radius in shader always.
+ float mBlurRadius; ///< The blur radius
+ bool mAlwaysUsingBlurRadius : 1; ///< Whether we need the blur radius in shader always.
};
} // namespace Internal
#include <dali/integration-api/debug.h>
#include <dali/public-api/common/dali-vector.h>
#include <dali/public-api/object/property-array.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
#include <typeinfo>
// INTERNAL INCLUDES
{
namespace
{
-const int CUSTOM_PROPERTY_COUNT(6); // alignment + corner/border
+const int CUSTOM_PROPERTY_COUNT(1); // alignment
DALI_ENUM_TO_STRING_TABLE_BEGIN(UNITS)
DALI_ENUM_TO_STRING_WITH_SCOPE(Toolkit::GradientVisual::Units, OBJECT_BOUNDING_BOX)
sampler.SetWrapMode(wrap, wrap);
textureSet.SetSampler(0u, sampler);
- mImpl->mRenderer = VisualRenderer::New(geometry, shader);
+ mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
mImpl->mRenderer.SetTextures(textureSet);
#include <dali/devel-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
#include <cstring> // for strlen()
// INTERNAL HEADERS
{
namespace
{
-const int CUSTOM_PROPERTY_COUNT(12); // ltr, wrap, pixel area, atlas, pixalign, crop to mask, mask texture ratio + border/corner
+const int CUSTOM_PROPERTY_COUNT(7); // ltr, wrap, pixel area, atlas, pixalign, crop to mask, mask texture ratio
// fitting modes
DALI_ENUM_TO_STRING_TABLE_BEGIN(FITTING_MODE)
Shader shader = GenerateShader();
// Create the renderer
- mImpl->mRenderer = VisualRenderer::New(geometry, shader);
+ mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
//Register transform properties
if(useStandardShader)
{
- bool requiredAlphaMaskingOnRendering = (mMaskingData && !mMaskingData->mMaskImageLoadingFailed) ? !mMaskingData->mPreappliedMasking : false;
+ bool requiredAlphaMaskingOnRendering = (mMaskingData && !mMaskingData->mMaskImageLoadingFailed) ? !mMaskingData->mPreappliedMasking : false;
// Create and cache the standard shader
shader = mImageVisualShaderFactory.GetShader(
mFactoryCache,
{
if(mMaskingData && !mMaskingData->mPreappliedMasking)
{
- bool maskLoadFailed = true;
- TextureSet textures = mImpl->mRenderer.GetTextures();
+ bool maskLoadFailed = true;
+ TextureSet textures = mImpl->mRenderer.GetTextures();
if(textures && textures.GetTextureCount() >= TEXTURE_COUNT_FOR_GPU_ALPHA_MASK)
{
if(mMaskingData->mCropToMask)
// EXTERNAL INCLUDES
#include <dali/devel-api/common/stage.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
namespace Dali
{
{
namespace
{
-const int CUSTOM_PROPERTY_COUNT(6); // atlas + corner/border
+const int CUSTOM_PROPERTY_COUNT(1); // atlas
// property name
const Dali::Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
{
Shader shader = GenerateShader();
Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
- mImpl->mRenderer = VisualRenderer::New(geometry, shader);
+ mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
Vector2 dpi = Stage::GetCurrent().GetDpi();
mCornerRadius(Vector4::ZERO),
mCornerRadiusPolicy(1.0f),
mDepthIndex(0.0f),
- mBorderlineWidthIndex(Property::INVALID_INDEX),
- mBorderlineColorIndex(Property::INVALID_INDEX),
- mBorderlineOffsetIndex(Property::INVALID_INDEX),
- mCornerRadiusIndex(Property::INVALID_INDEX),
mFittingMode(fittingMode),
mFlags(0),
mResourceStatus(Toolkit::Visual::ResourceStatus::PREPARING),
Vector4 mCornerRadius;
float mCornerRadiusPolicy;
int mDepthIndex;
- Property::Index mBorderlineWidthIndex;
- Property::Index mBorderlineColorIndex;
- Property::Index mBorderlineOffsetIndex;
- Property::Index mCornerRadiusIndex;
FittingMode mFittingMode; ///< How the contents should fit the view
int mFlags;
Toolkit::Visual::ResourceStatus mResourceStatus;
#include <dali/devel-api/rendering/renderer-devel.h>
#include <dali/devel-api/scripting/enum-helper.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
#include <dali/public-api/rendering/visual-renderer.h>
//INTERNAL HEARDER
if(mImpl->mRenderer)
{
RegisterMixColor();
+ RegisterDecoration();
- if(IsRoundedCornerRequired())
- {
- mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
- mImpl->mRenderer.RegisterUniqueProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
-
- mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
- }
if(IsBorderlineRequired())
{
- mImpl->mBorderlineWidthIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_WIDTH, BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
- mImpl->mBorderlineColorIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_COLOR, BORDERLINE_COLOR, mImpl->mBorderlineColor);
- mImpl->mBorderlineOffsetIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_OFFSET, BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
-
mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
}
+ else if(IsRoundedCornerRequired())
+ {
+ mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+ }
}
}
mImpl->mBorderlineWidth = width;
}
- if(mImpl->mBorderlineWidthIndex != Property::INVALID_INDEX)
- {
- mImpl->mRenderer.SetProperty(mImpl->mBorderlineWidthIndex, mImpl->mBorderlineWidth);
- }
- else if(DALI_UNLIKELY(mImpl->mRenderer && IsBorderlineRequired()))
+ if(DALI_UNLIKELY(mImpl->mRenderer))
{
// Unusual case. SetProperty called after OnInitialize().
// Assume that DoAction call UPDATE_PROPERTY.
- // We must regist properies into renderer, and update shader.
+ DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBorderlineUniform();
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
- // Borderline added by this action. Register property to renderer.
- mImpl->mBorderlineWidthIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_WIDTH, BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
- mImpl->mBorderlineColorIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_COLOR, BORDERLINE_COLOR, mImpl->mBorderlineColor);
- mImpl->mBorderlineOffsetIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_OFFSET, BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
-
- // Make Blend mode ON_WITHOUT_CULL for transparent mix color.
- mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
+ // Check whether we must update shader.
+ if(!mImpl->mAlwaysUsingBorderline && IsBorderlineRequired())
+ {
+ // Make Blend mode ON_WITHOUT_CULL for transparent mix color.
+ mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
- // Change the shader must not be occured many times. we always have to use borderline feature.
- mImpl->mAlwaysUsingBorderline = true;
+ // Change the shader must not be occured many times. we always have to use borderline feature.
+ mImpl->mAlwaysUsingBorderline = true;
- // Change shader
- needUpdateShader = true;
+ // Change shader
+ if(!mImpl->mCustomShader)
+ {
+ needUpdateShader = true;
+ }
+ }
}
break;
}
mImpl->mBorderlineColor = color;
}
- if(mImpl->mBorderlineColorIndex != Property::INVALID_INDEX)
+ if(DALI_UNLIKELY(mImpl->mRenderer))
{
- mImpl->mRenderer.SetProperty(mImpl->mBorderlineColorIndex, mImpl->mBorderlineColor);
+ // Unusual case. SetProperty called after OnInitialize().
+ // Assume that DoAction call UPDATE_PROPERTY.
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_COLOR, mImpl->mBorderlineColor);
}
break;
}
mImpl->mBorderlineOffset = offset;
}
- if(mImpl->mBorderlineOffsetIndex != Property::INVALID_INDEX)
+ if(DALI_UNLIKELY(mImpl->mRenderer))
{
- mImpl->mRenderer.SetProperty(mImpl->mBorderlineOffsetIndex, mImpl->mBorderlineOffset);
+ // Unusual case. SetProperty called after OnInitialize().
+ // Assume that DoAction call UPDATE_PROPERTY.
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
}
break;
}
}
}
- if(mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
- {
- mImpl->mRenderer.SetProperty(mImpl->mCornerRadiusIndex, mImpl->mCornerRadius);
- }
- else if(DALI_UNLIKELY(mImpl->mRenderer && IsRoundedCornerRequired()))
+ if(DALI_UNLIKELY(mImpl->mRenderer))
{
// Unusual case. SetProperty called after OnInitialize().
// Assume that DoAction call UPDATE_PROPERTY.
- // We must regist properies into renderer, and update shader.
+ DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterCornerRadiusUniform();
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS, mImpl->mCornerRadius);
- // CornerRadius added by this action. Regist property to renderer.
- mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
- mImpl->mRenderer.RegisterUniqueProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
+ // Check whether we must update shader.
+ if(!mImpl->mAlwaysUsingCornerRadius && IsRoundedCornerRequired())
+ {
+ // Change the shader must not be occured many times. we always have to use corner radius feature.
+ mImpl->mAlwaysUsingCornerRadius = true;
- // Change the shader must not be occured many times. we always have to use corner radius feature.
- mImpl->mAlwaysUsingCornerRadius = true;
+ if(!IsBorderlineRequired())
+ {
+ // If IsBorderlineRequired is true, BLEND_MODE is already BlendMode::ON_WITHOUT_CULL. So we don't overwrite it.
+ mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+ }
- if(!IsBorderlineRequired())
- {
- // If IsBorderlineRequired is true, BLEND_MODE is already BlendMode::ON_WITHOUT_CULL. So we don't overwrite it.
- mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+ // Change shader
+ if(!mImpl->mCustomShader)
+ {
+ needUpdateShader = true;
+ }
}
-
- // Change shader
- needUpdateShader = true;
}
+
break;
}
case Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY:
case Toolkit::Visual::Transform::Policy::ABSOLUTE:
{
mImpl->mCornerRadiusPolicy = policy;
- if(DALI_UNLIKELY(mImpl->mRenderer && mImpl->mCornerRadiusIndex != Property::INVALID_INDEX))
+ if(DALI_UNLIKELY(mImpl->mRenderer))
{
// Unusual case. SetProperty called after OnInitialize().
// Assume that DoAction call UPDATE_PROPERTY.
- // We must update properies result into renderer
- // Note : mImpl->mCornerRadiusIndex is not INVALID_INDEX.
- // So CornerRadiusPolicy property is already registed.
- mImpl->mRenderer.SetProperty(mImpl->mRenderer.GetPropertyIndex(CORNER_RADIUS_POLICY), mImpl->mCornerRadiusPolicy);
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
}
break;
}
mImpl->mTransform.mOffset = mImpl->mRenderer.GetProperty<Vector2>(VisualRenderer::Property::TRANSFORM_OFFSET);
mImpl->mTransform.mSize = mImpl->mRenderer.GetProperty<Vector2>(VisualRenderer::Property::TRANSFORM_SIZE);
- if(mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
- {
- mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mCornerRadiusIndex);
- }
- if(mImpl->mBorderlineWidthIndex != Property::INVALID_INDEX)
+ if(IsTypeAvailableForCornerRadius(mImpl->mType))
{
- mImpl->mBorderlineWidth = mImpl->mRenderer.GetProperty<float>(mImpl->mBorderlineWidthIndex);
+ mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
}
- if(mImpl->mBorderlineColorIndex != Property::INVALID_INDEX)
+ if(IsTypeAvailableForBorderline(mImpl->mType))
{
- mImpl->mBorderlineColor = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mBorderlineColorIndex);
- }
- if(mImpl->mBorderlineOffsetIndex != Property::INVALID_INDEX)
- {
- mImpl->mBorderlineOffset = mImpl->mRenderer.GetProperty<float>(mImpl->mBorderlineOffsetIndex);
+ mImpl->mBorderlineWidth = mImpl->mRenderer.GetProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
+ mImpl->mBorderlineColor = mImpl->mRenderer.GetProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
+ mImpl->mBorderlineOffset = mImpl->mRenderer.GetProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
}
}
// If VisualType doesn't support rounded corner, always return false.
if(IsTypeAvailableForCornerRadius(mImpl->mType))
{
- if(mImpl->mRenderer && mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
+ if(mImpl->mRenderer)
{
// Update values from Renderer
- mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mCornerRadiusIndex);
+ Property::Value value = mImpl->mRenderer.GetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS);
+ value.Get(mImpl->mCornerRadius);
}
- return !(mImpl->mCornerRadius == Vector4::ZERO) || mImpl->mAlwaysUsingCornerRadius;
+ return mImpl->mAlwaysUsingCornerRadius || !(mImpl->mCornerRadius == Vector4::ZERO);
}
return false;
}
// If VisualType doesn't support borderline, always return false.
if(IsTypeAvailableForBorderline(mImpl->mType))
{
- if(mImpl->mRenderer && mImpl->mBorderlineWidthIndex != Property::INVALID_INDEX)
+ if(mImpl->mRenderer)
{
// Update values from Renderer
- mImpl->mBorderlineWidth = mImpl->mRenderer.GetProperty<float>(mImpl->mBorderlineWidthIndex);
+ Property::Value value = mImpl->mRenderer.GetProperty(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
+ value.Get(mImpl->mBorderlineWidth);
}
- return !EqualsZero(mImpl->mBorderlineWidth) || mImpl->mAlwaysUsingBorderline;
+ return mImpl->mAlwaysUsingBorderline || !EqualsZero(mImpl->mBorderlineWidth);
}
return false;
}
}
}
+void Visual::Base::RegisterDecoration()
+{
+ if(mImpl->mRenderer)
+ {
+ if(IsTypeAvailableForCornerRadius(mImpl->mType))
+ {
+ if(mImpl->mAlwaysUsingCornerRadius || !(mImpl->mCornerRadius == Vector4::ZERO))
+ {
+ DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterCornerRadiusUniform();
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS, mImpl->mCornerRadius);
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
+ }
+ }
+ if(IsTypeAvailableForBorderline(mImpl->mType))
+ {
+ if(mImpl->mAlwaysUsingBorderline || !EqualsZero(mImpl->mBorderlineWidth))
+ {
+ DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBorderlineUniform();
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_COLOR, mImpl->mBorderlineColor);
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
+ }
+ }
+ }
+}
+
void Visual::Base::SetMixColor(const Vector4& color)
{
mImpl->mMixColor = color;
{
return VisualRenderer::Property::VISUAL_PRE_MULTIPLIED_ALPHA;
}
+ case Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS:
+ {
+ return DecoratedVisualRenderer::Property::CORNER_RADIUS;
+ }
+ case Dali::Toolkit::DevelVisual::Property::BORDERLINE_WIDTH:
+ {
+ return DecoratedVisualRenderer::Property::BORDERLINE_WIDTH;
+ }
+ case Dali::Toolkit::DevelVisual::Property::BORDERLINE_COLOR:
+ {
+ return DecoratedVisualRenderer::Property::BORDERLINE_COLOR;
+ }
+ case Dali::Toolkit::DevelVisual::Property::BORDERLINE_OFFSET:
+ {
+ return DecoratedVisualRenderer::Property::BORDERLINE_OFFSET;
+ }
}
Property::Index index = mImpl->mRenderer.GetPropertyIndex(key);
return Dali::Property(handle, Property::INVALID_INDEX);
}
- // Default animatable properties from VisualRenderer
switch(GetIntKey(key))
{
+ // Default animatable properties from VisualRenderer
case Toolkit::Visual::Property::MIX_COLOR:
{
return Dali::Property(mImpl->mRenderer, VisualRenderer::Property::VISUAL_MIX_COLOR);
{
return Dali::Property(mImpl->mRenderer, VisualRenderer::Property::TRANSFORM_SIZE);
}
- default:
- {
- if(key.type == Property::Key::INDEX &&
- ((mImpl->mType == Toolkit::Visual::COLOR && key.indexKey == ColorVisual::Property::MIX_COLOR) ||
- (mImpl->mType == Toolkit::Visual::PRIMITIVE && key.indexKey == PrimitiveVisual::Property::MIX_COLOR)))
- {
- return Dali::Property(mImpl->mRenderer, VisualRenderer::Property::VISUAL_MIX_COLOR);
- }
- }
- }
- // Other cases
- Property::Index index = GetPropertyIndex(key);
- if(index == Property::INVALID_INDEX)
- {
- if(IsTypeAvailableForBorderline(mImpl->mType) &&
- ((key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::BORDERLINE_WIDTH) || (key.type == Property::Key::STRING && key.stringKey == BORDERLINE_WIDTH) ||
- (key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::BORDERLINE_COLOR) || (key.type == Property::Key::STRING && key.stringKey == BORDERLINE_COLOR) ||
- (key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::BORDERLINE_OFFSET) || (key.type == Property::Key::STRING && key.stringKey == BORDERLINE_OFFSET)))
+ // Default animatable properties from DecoratedVisualRenderer
+ case Toolkit::DevelVisual::Property::CORNER_RADIUS:
{
- mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
-
- // Register borderline properties
- mImpl->mBorderlineWidthIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_WIDTH, BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
- mImpl->mBorderlineColorIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_COLOR, BORDERLINE_COLOR, mImpl->mBorderlineColor);
- mImpl->mBorderlineOffsetIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_OFFSET, BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
+ if(IsTypeAvailableForCornerRadius(mImpl->mType))
+ {
+ const bool updateShader = !mImpl->mCustomShader && !IsRoundedCornerRequired();
- // Borderline is animated now. we always have to use borderline feature.
- mImpl->mAlwaysUsingBorderline = true;
+ // CornerRadius is animated now. we always have to use corner radius feature.
+ mImpl->mAlwaysUsingCornerRadius = true;
- index = mImpl->mRenderer.GetPropertyIndex(key);
+ if(updateShader)
+ {
+ // Update each values to renderer
+ DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterCornerRadiusUniform();
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS, mImpl->mCornerRadius);
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
- // Change shader
- UpdateShader();
+ // Change shader
+ UpdateShader();
+ }
+ if(!IsBorderlineRequired())
+ {
+ // If IsBorderlineRequired is true, BLEND_MODE is already BlendMode::ON_WITHOUT_CULL. So we don't overwrite it.
+ mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+ }
+ return Dali::Property(mImpl->mRenderer, DecoratedVisualRenderer::Property::CORNER_RADIUS);
+ }
+ break;
}
- else if(IsTypeAvailableForCornerRadius(mImpl->mType) && ((key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::CORNER_RADIUS) || (key.type == Property::Key::STRING && key.stringKey == CORNER_RADIUS)))
+ case Toolkit::DevelVisual::Property::BORDERLINE_WIDTH:
+ case Toolkit::DevelVisual::Property::BORDERLINE_COLOR:
+ case Toolkit::DevelVisual::Property::BORDERLINE_OFFSET:
{
- // Register CORNER_RADIUS property
- mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
- mImpl->mRenderer.RegisterUniqueProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
+ if(IsTypeAvailableForBorderline(mImpl->mType))
+ {
+ const bool updateShader = !mImpl->mCustomShader && !IsBorderlineRequired();
- // CornerRadius is animated now. we always have to use corner radius feature.
- mImpl->mAlwaysUsingCornerRadius = true;
+ // Borderline is animated now. we always have to use borderline feature.
+ mImpl->mAlwaysUsingBorderline = true;
- if(!IsBorderlineRequired())
- {
- // If IsBorderlineRequired is true, BLEND_MODE is already BlendMode::ON_WITHOUT_CULL. So we don't overwrite it.
- mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
- }
+ if(updateShader)
+ {
+ // Update each values to renderer
+ DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBorderlineUniform();
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_COLOR, mImpl->mBorderlineColor);
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
- index = mImpl->mCornerRadiusIndex;
+ // Change shader
+ UpdateShader();
+ }
+ mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
- // Change shader
- UpdateShader();
- }
- else
- {
- // We can't find the property in the base class.
- // Request to child class
- return OnGetPropertyObject(key);
- }
- }
- else
- {
- if(index == mImpl->mBorderlineWidthIndex ||
- index == mImpl->mBorderlineColorIndex ||
- index == mImpl->mBorderlineOffsetIndex)
- {
- // Borderline is animated now. we always have to use borderline feature.
- mImpl->mAlwaysUsingBorderline = true;
+ return Dali::Property(mImpl->mRenderer, GetPropertyIndex(key));
+ }
+ break;
}
- if(index == mImpl->mCornerRadiusIndex)
+ // Special case for MIX_COLOR
+ default:
{
- // CornerRadius is animated now. we always have to use corner radius feature.
- mImpl->mAlwaysUsingCornerRadius = true;
+ if(key.type == Property::Key::INDEX &&
+ ((mImpl->mType == Toolkit::Visual::COLOR && key.indexKey == ColorVisual::Property::MIX_COLOR) ||
+ (mImpl->mType == Toolkit::Visual::PRIMITIVE && key.indexKey == PrimitiveVisual::Property::MIX_COLOR)))
+ {
+ return Dali::Property(mImpl->mRenderer, VisualRenderer::Property::VISUAL_MIX_COLOR);
+ }
}
}
- return Dali::Property(mImpl->mRenderer, index);
+ // We can't find the property in the base class.
+ // Request to child class
+ return OnGetPropertyObject(key);
}
} // namespace Internal
*/
void RegisterMixColor();
+ /**
+ * Register the uniform on the DecoratedVisualRenderer and store the property index if necessary.
+ */
+ void RegisterDecoration();
+
/**
* Find the matching property on the renderer or shader. If it's a shader
* property, register it on the renderer in order to animate it for this