Do not allow to add duplicated renderer into actor 06/310606/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 2 May 2024 13:19:52 +0000 (22:19 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Thu, 2 May 2024 13:25:38 +0000 (22:25 +0900)
commitbf74845edaf0ae30569b7a3f72fa530924011418
tree4f0d1aab2f07064cda7b3b72fd2363a0fec1cb0b
parent84bad367e37b2d8c3346bd94217b7b0826ba2422
Do not allow to add duplicated renderer into actor

Internal::Actor allow to add same renderer, but SceneGraph::Node doesn't allow.

If we do something like this, the logic might be breakdown.

actor.AddRenderer(renderer);
actor.AddRenderer(renderer);
actor.RemoveRenderer(renderer);

///< actor will have renderer, but actor's node doesn't have renderer.

To match with node's logic, let we don't allow to push-back the duplicated renderer.
Instead, just check the duplication and return the index.

Change-Id: I689896171b3df5d140089c3b99f44e1d3f0f8722
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
automated-tests/src/dali/utc-Dali-Actor.cpp
dali/internal/event/actors/actor-renderer-container.cpp
dali/public-api/actors/actor.h