Removing lookup/cache of property type function getter & size getter.
Reduces size of uniform map from 64 bytes to 48 bytes on x86-64 platform
Change-Id: I1f5259192a974a5579b381564a8d16df67d28589
SET(CAPI_LIB "dali-internal")
SET(TC_SOURCES
+ utc-Dali-Internal-AnimatableProperty.cpp
utc-Dali-Internal-ActorObserver.cpp
utc-Dali-Internal-ActorRelayout.cpp
utc-Dali-Internal-ConstString.cpp
--- /dev/null
+/*
+ * Copyright (c) 2024 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <utility>
+
+// INTERNAL INCLUDES
+#include <dali-test-suite-utils.h>
+#include <dali/internal/event/common/property-input-impl.h>
+#include <dali/internal/update/common/animatable-property.h>
+#include <dali/internal/update/common/inherited-property.h>
+#include <dali/internal/update/gestures/gesture-properties.h>
+#include <dali/internal/update/manager/transform-manager-property.h>
+
+using namespace Dali::Internal::SceneGraph;
+
+void utc_dali_internal_animatable_property_startup(void)
+{
+ test_return_value = TET_UNDEF;
+}
+
+void utc_dali_internal_animatable_property_cleanup(void)
+{
+ test_return_value = TET_PASS;
+}
+
+int UtcDaliInternalPropertyGetValueAddress(void)
+{
+ struct S
+ {
+ Dali::Internal::PropertyInputImpl* property;
+ Property::Value value;
+ size_t size;
+ S(Dali::Internal::PropertyInputImpl* p, Property::Value v, size_t s)
+ : property(p),
+ value(v),
+ size(s)
+ {
+ }
+ };
+ std::vector<S> properties;
+ properties.emplace_back(new AnimatableProperty<bool>(true), true, sizeof(bool));
+ properties.emplace_back(new AnimatableProperty<int>(1337), 1337, sizeof(int));
+ properties.emplace_back(new AnimatableProperty<float>(8.008135f), 8.008135f, sizeof(float));
+ properties.emplace_back(new AnimatableProperty<Vector2>(Vector2(1.0f, 1.0f)), Vector2(1.0f, 1.0f), sizeof(Vector2));
+ properties.emplace_back(new AnimatableProperty<Vector3>(Vector3(1.0f, 1.0f, 1.0f)), Vector3(1.0f, 1.0f, 1.0f), sizeof(Vector3));
+ properties.emplace_back(new AnimatableProperty<Vector4>(Vector4(1.0f, 1.0f, 1.0f, 1.0f)), Vector4(1.0f, 1.0f, 1.0f, 1.0f), sizeof(Vector4));
+ properties.emplace_back(new AnimatableProperty<Quaternion>(Quaternion(Radian(1.619f), Vector3::ZAXIS)), Quaternion(Radian(1.619f), Vector3::ZAXIS), sizeof(Quaternion));
+ properties.emplace_back(new AnimatableProperty<Matrix>(Matrix::IDENTITY), Matrix::IDENTITY, sizeof(Matrix));
+ properties.emplace_back(new AnimatableProperty<Matrix3>(Matrix3::IDENTITY), Matrix3::IDENTITY, sizeof(Matrix3));
+
+ properties.emplace_back(new InheritedVector3(Vector3(1.0f, 1.0f, 1.0f)), Vector3(1.0f, 1.0f, 1.0f), sizeof(Vector3));
+ properties.emplace_back(new InheritedColor(Color::SIENNA), Color::SIENNA, sizeof(Vector4));
+ properties.emplace_back(new InheritedQuaternion(), Quaternion(Radian(1.619f), Vector3::ZAXIS), sizeof(Quaternion));
+ static_cast<InheritedQuaternion*>(properties.back().property)->Set(0, properties.back().value.Get<Quaternion>());
+ properties.emplace_back(new InheritedMatrix(), Matrix::IDENTITY, sizeof(Matrix));
+ static_cast<InheritedMatrix*>(properties.back().property)->Set(0, properties.back().value.Get<Matrix>());
+
+ properties.emplace_back(new GesturePropertyBool(), true, sizeof(bool));
+ static_cast<GesturePropertyBool*>(properties.back().property)->Set(true);
+
+ properties.emplace_back(new GesturePropertyVector2(), Vector2(3.2f, 2.1f), sizeof(Vector2));
+ static_cast<GesturePropertyVector2*>(properties.back().property)->Set(properties.back().value.Get<Vector2>());
+
+ for(auto& s : properties)
+ {
+ void* addr = const_cast<void*>(s.property->GetValueAddress(0));
+ switch(s.value.GetType())
+ {
+ case Property::Type::BOOLEAN:
+ {
+ DALI_TEST_EQUALS(s.value.Get<bool>(), *reinterpret_cast<bool*>(addr), TEST_LOCATION);
+ break;
+ }
+ case Property::Type::INTEGER:
+ {
+ DALI_TEST_EQUALS(s.value.Get<int>(), *reinterpret_cast<int*>(addr), TEST_LOCATION);
+ break;
+ }
+ case Property::Type::FLOAT:
+ {
+ DALI_TEST_EQUALS(s.value.Get<float>(), *reinterpret_cast<float*>(addr), TEST_LOCATION);
+ break;
+ }
+ case Property::Type::VECTOR2:
+ {
+ DALI_TEST_EQUALS(s.value.Get<Vector2>(), *reinterpret_cast<Vector2*>(addr), TEST_LOCATION);
+ break;
+ }
+ case Property::Type::VECTOR3:
+ {
+ DALI_TEST_EQUALS(s.value.Get<Vector3>(), *reinterpret_cast<Vector3*>(addr), TEST_LOCATION);
+ break;
+ }
+ case Property::Type::VECTOR4:
+ {
+ DALI_TEST_EQUALS(s.value.Get<Vector4>(), *reinterpret_cast<Vector4*>(addr), TEST_LOCATION);
+ break;
+ }
+ case Property::Type::MATRIX:
+ {
+ DALI_TEST_EQUALS(s.value.Get<Matrix>(), *reinterpret_cast<Matrix*>(addr), TEST_LOCATION);
+ break;
+ }
+ case Property::Type::MATRIX3:
+ {
+ DALI_TEST_EQUALS(s.value.Get<Matrix3>(), *reinterpret_cast<Matrix3*>(addr), TEST_LOCATION);
+ break;
+ }
+ default:
+ break;
+ }
+ DALI_TEST_EQUALS(s.property->GetValueSize(), s.size, TEST_LOCATION);
+ }
+
+ END_TEST;
+}
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
#include <dali-test-suite-utils.h>
#include <dali/internal/update/manager/transform-manager-property.h>
+#include <dali/internal/update/nodes/node-helper.h>
// Internal headers are allowed here
END_TEST;
}
+
+using namespace Dali::Internal::SceneGraph;
+int UtcDaliInternalTransformPropertyGetValueSize(void)
+{
+ struct S
+ {
+ Dali::Internal::PropertyInputImpl* property;
+ Property::Value value;
+ size_t size;
+ S(Dali::Internal::PropertyInputImpl* p, Property::Value v, size_t s)
+ : property(p),
+ value(v),
+ size(s)
+ {
+ }
+ };
+ std::vector<S> properties;
+
+ properties.emplace_back(new TransformManagerPropertyVector3<TransformManagerProperty::TRANSFORM_PROPERTY_SCALE, 0>(), Vector3(2.3f, 4.5f, 1.9f), sizeof(Vector3));
+
+ properties.emplace_back(new TransformManagerPropertyQuaternion<0>(), Quaternion(Radian(1.619f), Vector3::ZAXIS), sizeof(Quaternion));
+
+ properties.emplace_back(new TransformManagerVector3Input<0>(TransformManagerProperty::TRANSFORM_PROPERTY_WORLD_SCALE, Vector3(2.3f, 4.5f, 1.9f)), Vector3(2.3f, 4.5f, 1.9f), sizeof(Vector3));
+
+ properties.emplace_back(new TransformManagerQuaternionInput<0>(), Quaternion(Radian(1.619f), Vector3::ZAXIS), sizeof(Quaternion));
+
+ properties.emplace_back(new TransformManagerMatrixInput<0>(), Matrix::IDENTITY, sizeof(Matrix));
+
+ for(auto& s : properties)
+ {
+ DALI_TEST_EQUALS(s.property->GetValueSize(), s.size, TEST_LOCATION);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliInternalTransformPropertyGetValueAddress(void)
+{
+ struct N
+ {
+ BASE(TransformManagerData, mTransformManagerData);
+ PROPERTY_WRAPPER(mTransformManagerData, TransformManagerPropertyVector3, TRANSFORM_PROPERTY_SCALE, mScale);
+ TEMPLATE_WRAPPER(mScale, TransformManagerPropertyQuaternion, mOrientation);
+ TEMPLATE_WRAPPER(mOrientation, TransformManagerVector3Input, mWorldPosition);
+ TEMPLATE_WRAPPER(mWorldPosition, TransformManagerQuaternionInput, mWorldOrientation);
+ TEMPLATE_WRAPPER(mWorldOrientation, TransformManagerMatrixInput, mWorldMatrix);
+
+ N()
+ : mTransformManagerData(),
+ mWorldPosition(TRANSFORM_PROPERTY_WORLD_POSITION, Vector3(1.0f, 1.0f, 1.0f)),
+ mWorldOrientation(),
+ mWorldMatrix()
+ {
+ }
+ };
+
+ TransformManager testManager;
+ N node;
+ node.mTransformManagerData.mManager = &testManager;
+ node.mTransformManagerData.mId = testManager.CreateTransform();
+
+ const void* addr = node.mScale.GetValueAddress(0);
+ node.mScale.Set(0, Vector3(1.2f, 1.2f, 1.2f));
+
+ DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(1.2f, 1.2f, 1.2f), TEST_LOCATION);
+
+ node.mOrientation.Set(0, Quaternion(Radian(1.619f), Vector3::ZAXIS));
+ addr = node.mOrientation.GetValueAddress(0);
+ DALI_TEST_EQUALS(*reinterpret_cast<const Quaternion*>(addr), Quaternion(Radian(1.619f), Vector3::ZAXIS), TEST_LOCATION);
+
+ Matrix& m = node.mWorldMatrix.Get(0);
+ m = Matrix::IDENTITY;
+
+ addr = node.mWorldPosition.GetValueAddress(0);
+ DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.f, 0.f, 0.f), TEST_LOCATION);
+
+ addr = node.mWorldOrientation.GetValueAddress(0);
+ DALI_TEST_EQUALS(*reinterpret_cast<const Quaternion*>(addr), Quaternion(Radian(0), Vector3::ZAXIS), TEST_LOCATION);
+
+ addr = node.mWorldMatrix.GetValueAddress(0);
+ DALI_TEST_EQUALS(*reinterpret_cast<const Matrix*>(addr), Matrix::IDENTITY, TEST_LOCATION);
+
+ END_TEST;
+}
#define DALI_INTERNAL_PROPERTY_INPUT_IMPL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
return reinterpret_cast<const Matrix&>(*this);
}
+ /**
+ * Retrieve the address of the property value. Only for use
+ * when writing uniforms.
+ */
+ virtual const void* GetValueAddress(BufferIndex bufferIndex) const = 0;
+
+ /**
+ * Retrieve the size of the property value for use in copying.
+ * Only for use when writing uniforms.
+ */
+ virtual size_t GetValueSize() const = 0;
+
// Accessors for Constraint functions
/**
namespace
{
-// Helper to get the property value getter by type
-typedef const float& (PropertyInputImpl::*FuncGetter)(BufferIndex) const;
-constexpr FuncGetter GetPropertyValueGetter(Property::Type type)
-{
- switch(type)
- {
- case Property::BOOLEAN:
- {
- return FuncGetter(&PropertyInputImpl::GetBoolean);
- }
- case Property::INTEGER:
- {
- return FuncGetter(&PropertyInputImpl::GetInteger);
- }
- case Property::FLOAT:
- {
- return FuncGetter(&PropertyInputImpl::GetFloat);
- }
- case Property::VECTOR2:
- {
- return FuncGetter(&PropertyInputImpl::GetVector2);
- }
- case Property::VECTOR3:
- {
- return FuncGetter(&PropertyInputImpl::GetVector3);
- }
- case Property::VECTOR4:
- {
- return FuncGetter(&PropertyInputImpl::GetVector4);
- }
- case Property::MATRIX3:
- {
- return FuncGetter(&PropertyInputImpl::GetMatrix3);
- }
- case Property::MATRIX:
- {
- return FuncGetter(&PropertyInputImpl::GetMatrix);
- }
- default:
- {
- return nullptr;
- }
- }
-}
-
-/**
- * Helper function that returns size of uniform datatypes based
- * on property type.
- */
-constexpr int GetPropertyValueSizeForUniform(Property::Type type)
-{
- switch(type)
- {
- case Property::Type::BOOLEAN:
- {
- return sizeof(bool);
- }
- case Property::Type::FLOAT:
- {
- return sizeof(float);
- }
- case Property::Type::INTEGER:
- {
- return sizeof(int);
- }
- case Property::Type::VECTOR2:
- {
- return sizeof(Vector2);
- }
- case Property::Type::VECTOR3:
- {
- return sizeof(Vector3);
- }
- case Property::Type::VECTOR4:
- {
- return sizeof(Vector4);
- }
- case Property::Type::MATRIX3:
- {
- return sizeof(Matrix3);
- }
- case Property::Type::MATRIX:
- {
- return sizeof(Matrix);
- }
- default:
- {
- return 0;
- }
- };
-}
-
/**
* Helper function to calculate the correct alignment of data for uniform buffers
* @param dataSize size of uniform buffer
{
auto& uniform = iter;
int arrayIndex = uniform.arrayIndex;
- if(!uniform.uniformFunc)
+ if(!uniform.initialized)
{
auto uniformInfo = Graphics::UniformInfo{};
auto uniformFound = program.GetUniform(uniform.uniformName.GetStringView(),
uniform.uniformOffset = uniformInfo.offset;
uniform.uniformLocation = uniformInfo.location;
uniform.uniformBlockIndex = uniformInfo.bufferIndex;
+ uniform.initialized = true;
auto dst = ubo->GetOffset() + uniformInfo.offset;
- const auto typeSize = GetPropertyValueSizeForUniform(iter.propertyValue->GetType());
+ const auto typeSize = iter.propertyValue->GetValueSize();
const auto dest = dst + static_cast<uint32_t>(typeSize) * arrayIndex;
- const auto func = GetPropertyValueGetter(iter.propertyValue->GetType());
- uniform.uniformSize = typeSize;
- uniform.uniformFunc = func;
- ubo->Write(&(iter.propertyValue->*func)(updateBufferIndex),
+ ubo->Write(iter.propertyValue->GetValueAddress(updateBufferIndex),
typeSize,
dest);
}
UniformBufferView* ubo = uboViews[uniform.uniformBlockIndex].get();
auto dst = ubo->GetOffset() + uniform.uniformOffset;
- const auto typeSize = uniform.uniformSize;
+ const auto typeSize = iter.propertyValue->GetValueSize();
const auto dest = dst + static_cast<uint32_t>(typeSize) * arrayIndex;
- const auto func = uniform.uniformFunc;
- ubo->Write(&(iter.propertyValue->*func)(updateBufferIndex),
+ ubo->Write(iter.propertyValue->GetValueAddress(updateBufferIndex),
typeSize,
dest);
}
using Hash = std::size_t;
- typedef const float& (PropertyInputImpl::*FuncGetter)(BufferIndex) const;
-
struct UniformIndexMap
{
ConstString uniformName; ///< The uniform name
Hash uniformNameHashNoArray{0u};
int32_t arrayIndex{-1}; ///< The array index
- int16_t uniformLocation{0u};
- uint16_t uniformOffset{0u};
- uint16_t uniformSize{0u};
- uint16_t uniformBlockIndex{0u};
- FuncGetter uniformFunc{0};
+ int16_t uniformLocation{0u};
+ uint16_t uniformOffset{0u};
+ uint16_t uniformBlockIndex{0u};
+ bool initialized{false};
};
StencilParameters mStencilParameters; ///< Struct containing all stencil related options
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(bool);
+ }
+
+ /**
* Set the property value. This will only persist for the current frame; the property
* will be reset with the base value, at the beginning of the next frame.
* @param[in] bufferIndex The buffer to write.
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(int);
+ }
+
+ /**
* Set the property value. This will only persist for the current frame; the property
* will be reset with the base value, at the beginning of the next frame.
* @param[in] bufferIndex The buffer to write.
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(float);
+ }
+
+ /**
* Set the property value. This will only persist for the current frame; the property
* will be reset with the base value, at the beginning of the next frame.
* @param[in] bufferIndex The buffer to write.
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector2);
+ }
+
+ /**
* Set the property value. This will only persist for the current frame; the property
* will be reset with the base value, at the beginning of the next frame.
* @param[in] bufferIndex The buffer to write.
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector3);
+ }
+
+ /**
* Set the property value. This will only persist for the current frame; the property
* will be reset with the base value, at the beginning of the next frame.
* @param[in] bufferIndex The buffer to write.
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector4);
+ }
+
+ /**
* Set the property value. This will only persist for the current frame; the property
* will be reset with the base value, at the beginning of the next frame.
* @param[in] bufferIndex The buffer to write.
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector4);
+ }
+
+ /**
* Change the property value by a relative amount.
* @param[in] bufferIndex The buffer to write.
* @param[in] delta The property will change by this amount.
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Matrix);
+ }
+
+ /**
* Set the property value. This will only persist for the current frame; the property
* will be reset with the base value, at the beginning of the next frame.
* @param[in] bufferIndex The buffer to write.
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Matrix3);
+ }
+
+ /**
* Set the property value. This will only persist for the current frame; the property
* will be reset with the base value, at the beginning of the next frame.
* @param[in] bufferIndex The buffer to write.
#define DALI_INTERNAL_SCENE_GRAPH_INHERITED_PROPERTY_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector3);
+ }
+
+ /**
* @copydoc Dali::PropertyInput::GetConstraintInputVector3()
*/
const Vector3& GetConstraintInputVector3(BufferIndex bufferIndex) const override
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector4);
+ }
+
+ /**
* @copydoc Dali::PropertyInput::GetConstraintInputVector4()
*/
const Vector4& GetConstraintInputVector4(BufferIndex bufferIndex) const override
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector4);
+ }
+
+ /**
* @copydoc Dali::PropertyInput::GetConstraintInputQuaternion()
*/
const Quaternion& GetConstraintInputQuaternion(BufferIndex bufferIndex) const override
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Matrix);
+ }
+
+ /**
* @copydoc Dali::Internal::PropertyInputImpl::GetConstraintInputMatrix()
*/
const Matrix& GetConstraintInputMatrix(BufferIndex bufferIndex) const override
#define DALI_INTERNAL_SCENE_GRAPH_GESTURE_PROPERTIES_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
{
return mValue;
}
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue;
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector2);
+ }
};
/**
{
return mValue;
}
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &mValue;
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(bool);
+ }
};
} // namespace SceneGraph
return Get(bufferIndex);
}
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &GetVector3(bufferIndex);
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector3);
+ }
+
const float& GetFloatComponent(uint32_t component) const override
{
return GetTxManagerData()->Manager()->GetVector3PropertyComponentValue(GetTxManagerData()->Id(), PropertyT, component);
{
return Get(bufferIndex);
}
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &Get(bufferIndex);
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector4);
+ }
};
/**
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &GetVector3(bufferIndex);
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector3);
+ }
+
+ /**
* @copydoc Dali::PropertyInput::GetConstraintInputVector3()
*/
const Vector3& GetConstraintInputVector3(BufferIndex bufferIndex) const override
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ return &GetQuaternion(bufferIndex);
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Vector4);
+ }
+
+ /**
* @copydoc Dali::PropertyInput::GetConstraintInputQuaternion()
*/
const Quaternion& GetConstraintInputQuaternion(BufferIndex bufferIndex) const override
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueAddress()
+ */
+ const void* GetValueAddress(BufferIndex bufferIndex) const override
+ {
+ static const Matrix identityMatrix(Matrix::IDENTITY);
+ auto transformManagerData = GetTxManagerData();
+ auto id = transformManagerData->Id();
+ if(id != INVALID_TRANSFORM_ID)
+ {
+ return &(transformManagerData->Manager()->GetWorldMatrix(id));
+ }
+ return &identityMatrix;
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetValueSize()
+ */
+ size_t GetValueSize() const override
+ {
+ return sizeof(Matrix);
+ }
+
+ /**
* @copydoc Dali::PropertyInput::GetConstraintInputMatrix()
*/
const Matrix& GetConstraintInputMatrix(BufferIndex bufferIndex) const override