/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
namespace
{
+const int CUSTOM_PROPERTY_COUNT(7); // 5 transform properties + color,size
+
const char* const POSITION_ATTRIBUTE_NAME("aPosition");
const char* const DRIFT_ATTRIBUTE_NAME("aDrift");
const char* const INDEX_NAME("indices");
void BorderVisual::DoSetOnScene(Actor& actor)
{
- mBorderColorIndex = mImpl->mRenderer.RegisterProperty(Toolkit::BorderVisual::Property::COLOR, COLOR_NAME, mBorderColor);
+ if(mBorderColorIndex == Property::INVALID_INDEX)
+ {
+ mBorderColorIndex = mImpl->mRenderer.RegisterUniqueProperty(Toolkit::BorderVisual::Property::COLOR, COLOR_NAME, mBorderColor);
+ }
if(mBorderColor.a < 1.f || mAntiAliasing)
{
mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
}
- mBorderSizeIndex = mImpl->mRenderer.RegisterProperty(Toolkit::BorderVisual::Property::SIZE, SIZE_NAME, mBorderSize);
+ if(mBorderSizeIndex == Property::INVALID_INDEX)
+ {
+ mBorderSizeIndex = mImpl->mRenderer.RegisterUniqueProperty(Toolkit::BorderVisual::Property::SIZE, SIZE_NAME, mBorderSize);
+ }
actor.AddRenderer(mImpl->mRenderer);
Shader shader = GetBorderShader();
mImpl->mRenderer = Renderer::New(geometry, shader);
+ mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
//Register transform properties
mImpl->mTransform.RegisterUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);