From 2330f40fd39db13f7aeb993389072d74dcc88d81 Mon Sep 17 00:00:00 2001 From: Subhransu Mohanty Date: Thu, 27 Aug 2020 10:18:32 +0900 Subject: [PATCH] change Object::OnPropertySet() interface signature. the old interface was taking Property::Value object by value which was making a deep copy (2 allocation). so changed the interface to take it as a const& object. Change-Id: I6cd67f6900ea61ea47154f9345a9ffe8f949f816 --- automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.cpp | 2 +- automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.h | 2 +- automated-tests/src/dali/utc-Dali-CustomActor.cpp | 2 +- dali/internal/event/actors/custom-actor-internal.h | 2 +- dali/internal/event/common/object-impl.h | 2 +- dali/public-api/actors/custom-actor-impl.cpp | 2 +- dali/public-api/actors/custom-actor-impl.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.cpp index 5723f7f..0c52508 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.cpp @@ -322,7 +322,7 @@ void TestCustomActor::OnChildRemove(Actor& child) { AddToCallStacks("OnChildRemove"); } -void TestCustomActor::OnPropertySet( Property::Index index, Property::Value propertyValue ) +void TestCustomActor::OnPropertySet( Property::Index index, const Property::Value& propertyValue ) { AddToCallStacks("OnPropertySet"); } diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.h b/automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.h index 907072f..51a8054 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.h +++ b/automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.h @@ -135,7 +135,7 @@ public: void OnSceneDisconnection() override; void OnChildAdd(Dali::Actor& child) override; void OnChildRemove(Dali::Actor& child) override; - void OnPropertySet( Dali::Property::Index index, Dali::Property::Value propertyValue ) override; + void OnPropertySet( Dali::Property::Index index, const Dali::Property::Value& propertyValue ) override; void OnSizeSet(const Dali::Vector3& targetSize) override; void OnSizeAnimation(Dali::Animation& animation, const Dali::Vector3& targetSize) override; bool OnHoverEvent(const Dali::HoverEvent& event) override; diff --git a/automated-tests/src/dali/utc-Dali-CustomActor.cpp b/automated-tests/src/dali/utc-Dali-CustomActor.cpp index bce0c34..1d60612 100644 --- a/automated-tests/src/dali/utc-Dali-CustomActor.cpp +++ b/automated-tests/src/dali/utc-Dali-CustomActor.cpp @@ -1408,7 +1408,7 @@ struct UnregisteredCustomActor : public Dali::CustomActorImpl { } virtual void OnChildRemove(Actor& child) { } - virtual void OnPropertySet( Property::Index index, Property::Value propertyValue ) + virtual void OnPropertySet( Property::Index index, const Property::Value& propertyValue ) { } virtual void OnSizeSet(const Vector3& targetSize) { } diff --git a/dali/internal/event/actors/custom-actor-internal.h b/dali/internal/event/actors/custom-actor-internal.h index c2a42be..5e5856c 100644 --- a/dali/internal/event/actors/custom-actor-internal.h +++ b/dali/internal/event/actors/custom-actor-internal.h @@ -111,7 +111,7 @@ private: /** * @copydoc Internal::Actor::OnPropertySet */ - virtual void OnPropertySet( Property::Index index, Property::Value propertyValue ) + virtual void OnPropertySet( Property::Index index, const Property::Value& propertyValue ) { mImpl->OnPropertySet(index, propertyValue); } diff --git a/dali/internal/event/common/object-impl.h b/dali/internal/event/common/object-impl.h index 8bdc264..a7bac60 100644 --- a/dali/internal/event/common/object-impl.h +++ b/dali/internal/event/common/object-impl.h @@ -392,7 +392,7 @@ protected: * @param [in] index The index of the property. * @param [in] propertyValue The value of the property. */ - virtual void OnPropertySet( Property::Index index, Property::Value propertyValue ) {} + virtual void OnPropertySet( Property::Index index, const Property::Value& propertyValue ) {} /** * Retrieves the TypeInfo for this object. Only retrieves it from the type-registry once and then stores a pointer diff --git a/dali/public-api/actors/custom-actor-impl.cpp b/dali/public-api/actors/custom-actor-impl.cpp index 5170eba..4fdcbf1 100644 --- a/dali/public-api/actors/custom-actor-impl.cpp +++ b/dali/public-api/actors/custom-actor-impl.cpp @@ -30,7 +30,7 @@ CustomActor CustomActorImpl::Self() const return CustomActor(mOwner); } -void CustomActorImpl::OnPropertySet( Property::Index index, Property::Value propertyValue ) +void CustomActorImpl::OnPropertySet( Property::Index index, const Property::Value& propertyValue ) { } diff --git a/dali/public-api/actors/custom-actor-impl.h b/dali/public-api/actors/custom-actor-impl.h index 4714bc2..fed8c1f 100644 --- a/dali/public-api/actors/custom-actor-impl.h +++ b/dali/public-api/actors/custom-actor-impl.h @@ -155,7 +155,7 @@ public: * @param[in] index The Property index that was set * @param[in] propertyValue The value to set */ - virtual void OnPropertySet( Property::Index index, Property::Value propertyValue ); + virtual void OnPropertySet( Property::Index index, const Property::Value& propertyValue ); /** * @brief Called when the owning actor's size is set e.g. using Actor::SetSize(). -- 2.7.4