SET(CAPI_LIB "dali-internal")
SET(TC_SOURCES
+ utc-Dali-Internal-ActorObserver.cpp
utc-Dali-Internal-Core.cpp
utc-Dali-Internal-FixedSizeMemoryPool.cpp
utc-Dali-Internal-FrustumCulling.cpp
--- /dev/null
+/*
+ * Copyright (c) 2019 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.
+ *
+ */
+
+#include <iostream>
+
+#include <stdlib.h>
+
+#include <dali-test-suite-utils.h>
+#include <dali/public-api/signals/callback.h>
+
+// Internal headers are allowed here
+#include <dali/internal/event/actors/actor-impl.h>
+#include <dali/internal/event/events/actor-observer.h>
+
+using namespace Dali;
+using ActorObserver = Internal::ActorObserver;
+
+namespace TestCallback
+{
+Internal::Actor* disconnectedActor = nullptr;
+int callCount = 0;
+void Function( Internal::Actor* actor )
+{
+ disconnectedActor = actor;
+ ++callCount;
+}
+
+void Reset()
+{
+ callCount = 0;
+ disconnectedActor = nullptr;
+}
+
+} // namespace TestCallback
+
+void utc_dali_internal_actor_observer_startup()
+{
+ test_return_value = TET_UNDEF;
+}
+
+void utc_dali_internal_actor_observer_cleanup()
+{
+ test_return_value = TET_PASS;
+}
+
+int UtcDaliActorObserverTests(void)
+{
+ TestApplication application;
+
+ auto stage = Stage::GetCurrent();
+ auto actor = Actor::New();
+ auto& actorImpl = GetImplementation( actor );
+
+ // Ensure we're not observing anything at the start
+ ActorObserver actorObserver;
+ DALI_TEST_EQUALS( actorObserver.GetActor(), nullptr, TEST_LOCATION );
+
+ // Set the actor and ensure GetActor returns the correct pointer
+ actorObserver.SetActor( &actorImpl );
+ DALI_TEST_EQUALS( actorObserver.GetActor(), &actorImpl, TEST_LOCATION );
+
+ stage.Add( actor );
+ DALI_TEST_EQUALS( actorObserver.GetActor(), &actorImpl, TEST_LOCATION );
+
+ // Removing the actor from the stage should make it return null
+ stage.Remove( actor );
+ DALI_TEST_EQUALS( actorObserver.GetActor(), nullptr, TEST_LOCATION );
+
+ // Adding the actor back to the scene should mean it returning the actor again
+ stage.Add( actor );
+ DALI_TEST_EQUALS( actorObserver.GetActor(), &actorImpl, TEST_LOCATION );
+
+ // Resetting the actor should return nullptr
+ actorObserver.ResetActor();
+ DALI_TEST_EQUALS( actorObserver.GetActor(), nullptr, TEST_LOCATION );
+
+ // Set the actor again
+ actorObserver.SetActor( &actorImpl );
+ DALI_TEST_EQUALS( actorObserver.GetActor(), &actorImpl, TEST_LOCATION );
+
+ // Create another Actor and observe that (don't add it to the stage just yet)
+ {
+ auto actor2 = Actor::New();
+ auto& actor2Impl = GetImplementation( actor2 );
+ actorObserver.SetActor( &actor2Impl );
+ DALI_TEST_EQUALS( actorObserver.GetActor(), &actor2Impl, TEST_LOCATION );
+ }
+
+ // Actor destroyed now, should return nullptr
+ DALI_TEST_EQUALS( actorObserver.GetActor(), nullptr, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliActorObserverGracefulDeletion(void)
+{
+ TestApplication application;
+
+ // Create an ActorObserver and observe an actor that outlives the observer...
+ // when the actor is destroyed, there should be no segmentation fault,
+ // i.e. the ActorObserver should unregister itself
+ try
+ {
+ {
+ // Scope lifetime of Actor
+ auto actor = Actor::New();
+ auto& actorImpl = GetImplementation( actor );
+
+ // Now scope the lifetime of ActorObserver
+ {
+ ActorObserver actorObserver;
+ actorObserver.SetActor( &actorImpl );
+ } // ActorObserver goes out of scope
+ } // Actor goes out of scope
+
+ // If we get here without a crash, then it's all good
+ DALI_TEST_CHECK( true );
+ }
+ catch( ... )
+ {
+ tet_infoline( "ActorObserver did not clean up properly" );
+ DALI_TEST_CHECK( false );
+ }
+
+ END_TEST;
+}
+
+int UtcDaliActorObserverMoveConstructorAndAssignmentEmpty(void)
+{
+ TestApplication application;
+
+ // Copy empty observer
+ ActorObserver observer1;
+ ActorObserver observer2( std::move( observer1 ) );
+ DALI_TEST_EQUALS( observer1.GetActor(), nullptr, TEST_LOCATION );
+ DALI_TEST_EQUALS( observer2.GetActor(), nullptr, TEST_LOCATION );
+
+ // Assign empty observer
+ observer1 = std::move( observer2 );
+ DALI_TEST_EQUALS( observer1.GetActor(), nullptr, TEST_LOCATION );
+ DALI_TEST_EQUALS( observer2.GetActor(), nullptr, TEST_LOCATION );
+
+ // Ensure self assignment doesn't change anything
+ observer1 = std::move( observer1 );
+ observer2 = std::move( observer2 );
+ DALI_TEST_EQUALS( observer1.GetActor(), nullptr, TEST_LOCATION );
+ DALI_TEST_EQUALS( observer2.GetActor(), nullptr, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliActorObserverMoveConstructorAndAssignment(void)
+{
+ TestApplication application;
+
+ // Ensure new observer is observing the correct actor
+ // Ensure previous observer is not observing anything any more
+ auto actor = Actor::New();
+ auto& actorImpl = GetImplementation( actor );
+
+ ActorObserver observer1;
+ observer1.SetActor( &actorImpl );
+ DALI_TEST_EQUALS( observer1.GetActor(), &actorImpl, TEST_LOCATION );
+
+ // Move constructor
+ ActorObserver observer2( std::move( observer1 ) );
+ DALI_TEST_EQUALS( observer1.GetActor(), nullptr, TEST_LOCATION );
+ DALI_TEST_EQUALS( observer2.GetActor(), &actorImpl, TEST_LOCATION );
+
+ // Move assignment
+ observer1 = std::move( observer2 );
+ DALI_TEST_EQUALS( observer1.GetActor(), &actorImpl, TEST_LOCATION );
+ DALI_TEST_EQUALS( observer2.GetActor(), nullptr, TEST_LOCATION );
+
+ // Self assignment
+ observer1 = std::move( observer1 );
+ observer2 = std::move( observer2 );
+ DALI_TEST_EQUALS( observer1.GetActor(), &actorImpl, TEST_LOCATION );
+ DALI_TEST_EQUALS( observer2.GetActor(), nullptr, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliActorObserverEnsureRValueCleansUp(void)
+{
+ TestApplication application;
+
+ // ActorObservers observe the actors
+ // When an actor observer is moved, we need to ensure that the r-value observer cleans up after itself
+
+ // Here we're testing that we're handling this correctly by scoping the lifetime of the observer and actor
+ try
+ {
+ {
+ // Scope lifetime of Actor
+ auto actor = Actor::New();
+ auto& actorImpl = GetImplementation( actor );
+
+ // Score lifetime of observers
+ {
+ ActorObserver observer1;
+ observer1.SetActor( &actorImpl );
+ ActorObserver observer2( std::move( observer1 ) );
+ } // Both observers die here
+ } // Actor goes out of scope
+
+ // If we get here without a crash, then it's all good
+ DALI_TEST_CHECK( true );
+ }
+ catch( ... )
+ {
+ tet_infoline( "ActorObserver did not clean up properly" );
+ DALI_TEST_CHECK( false );
+ }
+
+ END_TEST;
+}
+
+int UtcDaliActorObserverFunctionCallback(void)
+{
+ TestApplication application;
+
+ // Test to ensure the passed in callback is called when the observed actor is disconnected
+ TestCallback::Reset();
+
+ auto stage = Stage::GetCurrent();
+ auto actor = Actor::New();
+ auto& actorImpl = GetImplementation( actor );
+ stage.Add( actor );
+
+ ActorObserver actorObserver( MakeCallback( &TestCallback::Function ) );
+ actorObserver.SetActor( &actorImpl );
+ DALI_TEST_EQUALS( actorObserver.GetActor(), &actorImpl, TEST_LOCATION );
+ DALI_TEST_EQUALS( TestCallback::disconnectedActor, nullptr, TEST_LOCATION );
+
+ // Unstage Actor
+ actor.Unparent();
+ DALI_TEST_EQUALS( actorObserver.GetActor(), nullptr, TEST_LOCATION );
+ DALI_TEST_EQUALS( TestCallback::disconnectedActor, &actorImpl, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliActorObserverFunctionCallbackEnsureNoDoubleDelete(void)
+{
+ TestApplication application;
+
+ // When we move an observer, we need to make sure we pass the ownership of a connected callback
+ // to ensure no double deletion.
+ TestCallback::Reset();
+
+ try
+ {
+ auto stage = Stage::GetCurrent();
+ auto actor = Actor::New();
+ auto& actorImpl = GetImplementation( actor );
+ stage.Add( actor );
+
+ ActorObserver *observer1 = new ActorObserver( MakeCallback( &TestCallback::Function ) );
+ observer1->SetActor( &actorImpl );
+
+ // Move observer1 into a new observer
+ ActorObserver* observer2 = new ActorObserver( std::move( *observer1 ) );
+
+ // Unstage Actor, function should be called only once
+ actor.Unparent();
+ DALI_TEST_EQUALS( TestCallback::disconnectedActor, &actorImpl, TEST_LOCATION );
+ DALI_TEST_EQUALS( TestCallback::callCount, 1, TEST_LOCATION );
+
+ // Delete both observers here, only one of them should delete the callback
+ delete observer1;
+ delete observer2;
+
+ // If we get here without a crash, then the callback has NOT been double-freed
+ DALI_TEST_CHECK( true );
+ }
+ catch( ... )
+ {
+ DALI_TEST_CHECK( false );
+ tet_infoline( "Callback double Freed" );
+ }
+
+ END_TEST;
+}
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
// Test that task 2 renders actor2
DALI_TEST_CHECK( boundTextures[2] == 9u );
}
+
+ // Create a renderable actor and replace the source actor in task2
+ auto actor4 = CreateRenderableActor();
+ task2.SetSourceActor( actor3 );
+ DALI_TEST_EQUALS( actor3, task2.GetSourceActor(), TEST_LOCATION );
+
END_TEST;
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
END_TEST;
}
+int UtcDaliRenderTaskListRemoveTaskWithExclusiveActor(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTaskList::RemoveTask() which has an exclusive actor set");
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
+
+ RenderTask newTask = taskList.CreateTask();
+ DALI_TEST_CHECK( 2u == taskList.GetTaskCount() );
+
+ auto actor = CreateRenderableActor();
+ newTask.SetSourceActor( actor );
+ newTask.SetExclusive( true );
+ DALI_TEST_EQUALS( actor, newTask.GetSourceActor(), TEST_LOCATION );
+ DALI_TEST_EQUALS( true, newTask.IsExclusive(), TEST_LOCATION );
+ taskList.RemoveTask( newTask );
+
+ DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
+ END_TEST;
+}
+
int UtcDaliRenderTaskListGetTaskCount(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliTouchRenderTaskWithExclusiveActor(void)
+{
+ TestApplication application;
+ auto stage = Stage::GetCurrent();
+ auto stageSize( stage.GetSize() );
+
+ auto actor = CreateRenderableActor();
+ actor.SetSize( stageSize.x, stageSize.y );
+ stage.Add( actor );
+
+ auto renderTask = stage.GetRenderTaskList().CreateTask();
+ renderTask.SetSourceActor( actor );
+ renderTask.SetExclusive( true );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Connect to actor's touched signal
+ SignalData data;
+ TouchEventFunctor functor( data );
+ actor.TouchedSignal().Connect( &application, functor );
+
+ // Emit a down signal
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+ DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+ data.Reset();
+
+ END_TEST;
+}
+
int UtcDaliTouchMultipleRenderableActors(void)
{
TestApplication application;
END_TEST;
-}
\ No newline at end of file
+}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
}
ActorObserver::ActorObserver()
-: mActor ( NULL ),
- mActorDisconnected( false ),
- mRemoveCallback( NULL )
+: ActorObserver( nullptr )
{
- DALI_LOG_TRACE_METHOD( gLogFilter );
}
ActorObserver::ActorObserver( CallbackBase* callback )
-: mActor ( NULL ),
+: mActor ( nullptr ),
mActorDisconnected( false ),
mRemoveCallback( callback )
{
+ DALI_LOG_TRACE_METHOD( gLogFilter );
}
ActorObserver::~ActorObserver()
{
DALI_LOG_TRACE_METHOD( gLogFilter );
- SetActor( NULL );
+ SetActor( nullptr );
delete mRemoveCallback;
}
-Actor* ActorObserver::GetActor()
+ActorObserver::ActorObserver( ActorObserver&& other )
+: ActorObserver( nullptr )
+{
+ operator=( std::move( other ) );
+}
+
+ActorObserver& ActorObserver::operator=( ActorObserver&& other )
+{
+ if( this != &other )
+ {
+ SetActor( other.mActor );
+ mActorDisconnected = other.mActorDisconnected;
+ mRemoveCallback = other.mRemoveCallback;
+ other.ResetActor();
+ other.mRemoveCallback = nullptr;
+ }
+ return *this;
+}
+
+Actor* ActorObserver::GetActor() const
{
- return mActorDisconnected ? NULL : mActor;
+ return mActorDisconnected ? nullptr : mActor;
}
void ActorObserver::SetActor( Actor* actor )
{
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Stop Observing: %p\n", mActor);
mActor->RemoveObserver( *this );
- mActor = NULL;
+ mActor = nullptr;
+ mActorDisconnected = false;
+ }
+}
+
+void ActorObserver::SceneObjectAdded( Object& object )
+{
+ DALI_LOG_TRACE_METHOD( gLogFilter );
+
+ if ( mActor == &object )
+ {
mActorDisconnected = false;
}
}
if ( mActor == &object )
{
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Stop Observing: %p\n", mActor);
- mActor = NULL;
+ mActor = nullptr;
}
}
*/
~ActorObserver();
+ // Movable
+
+ /**
+ * Move constructor.
+ *
+ * @param[in] other The object to move the data from
+ *
+ * @note The other's actor is appropriately disconnected.
+ * @note Ownership of callback is passed onto this class.
+ */
+ ActorObserver( ActorObserver&& other );
+
+ /**
+ * Move assignment operator.
+ *
+ * @param[in] other The object to move the data from
+ *
+ * @note The other's actor is appropriately disconnected.
+ * @note Ownership of callback is passed onto this class.
+ */
+ ActorObserver& operator=( ActorObserver&& other );
+
+ // Not copyable
+
+ ActorObserver( const ActorObserver& ) = delete; ///< Deleted copy constructor.
+ ActorObserver& operator=( const ActorObserver& ) = delete; ///< Deleted copy assignment operator.
+
// Methods
/**
* Return the stored Actor pointer.
* @return The Actor pointer.
+ * @note Returns nullptr while the observed actor is not on the scene.
*/
- Actor* GetActor();
+ Actor* GetActor() const;
/**
* Assignment operator.
private:
- // Undefined
- ActorObserver( const ActorObserver& );
- ActorObserver& operator=( const ActorObserver& );
-
-private:
-
/**
- * This will never get called as we do not observe objects that have not been added to the scene.
+ * This will be called if an actor is added to the scene.
* @param[in] object The object object.
* @see Object::Observer::SceneObjectAdded()
*/
- virtual void SceneObjectAdded(Object& object) { }
+ virtual void SceneObjectAdded( Object& object );
/**
- * This will be called when the actor is removed from the stage, we should clear and stop
- * observing it.
+ * This will be called when the actor is removed from the scene.
* @param[in] object The object object.
* @see Object::Observer::SceneObjectRemoved()
*/
- virtual void SceneObjectRemoved(Object& object);
+ virtual void SceneObjectRemoved( Object& object );
/**
* This will be called when the actor is destroyed. We should clear the actor.
* No need to stop observing as the object is being destroyed anyway.
* @see Object::Observer::ObjectDestroyed()
*/
- virtual void ObjectDestroyed(Object& object);
+ virtual void ObjectDestroyed( Object& object );
private:
Actor* mActor; ///< Raw pointer to an Actor.
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
*/
bool IsActorExclusiveToAnotherRenderTask( const Actor& actor,
const RenderTask& renderTask,
- const Vector< RenderTaskList::Exclusive >& exclusives )
+ const RenderTaskList::ExclusivesContainer& exclusives )
{
- if( exclusives.Size() )
+ if( exclusives.size() )
{
- for( Vector< RenderTaskList::Exclusive >::Iterator exclusiveIt = exclusives.Begin(); exclusives.End() != exclusiveIt; ++exclusiveIt )
+ for( const auto& exclusive : exclusives )
{
- if( ( exclusiveIt->renderTaskPtr != &renderTask ) && ( exclusiveIt->actorPtr == &actor ) )
+ if( ( exclusive.renderTaskPtr != &renderTask ) && ( exclusive.actor.GetActor() == &actor ) )
{
return true;
}
*/
HitActor HitTestWithinLayer( Actor& actor,
const RenderTask& renderTask,
- const Vector< RenderTaskList::Exclusive >& exclusives,
+ const RenderTaskList::ExclusivesContainer& exclusives,
const Vector4& rayOrigin,
const Vector4& rayDir,
float& nearClippingPlane,
/**
* Hit test a RenderTask
*/
-bool HitTestRenderTask( const Vector< RenderTaskList::Exclusive >& exclusives,
+bool HitTestRenderTask( const RenderTaskList::ExclusivesContainer& exclusives,
const Vector2& sceneSize,
LayerList& layers,
RenderTask& renderTask,
{
RenderTaskList::RenderTaskContainer& tasks = taskList.GetTasks();
RenderTaskList::RenderTaskContainer::reverse_iterator endIter = tasks.rend();
- const Vector< RenderTaskList::Exclusive >& exclusives = taskList.GetExclusivesList();
+ const auto& exclusives = taskList.GetExclusivesList();
for( RenderTaskList::RenderTaskContainer::reverse_iterator iter = tasks.rbegin(); endIter != iter; ++iter )
{
return HitTest( sceneSize, renderTaskList, layerList, screenCoordinates, results, actorTouchableCheck );
}
-bool HitTest( const Vector2& sceneSize, RenderTaskList& renderTaskList, LayerList& layerList, RenderTask& renderTask, const Vector2& screenCoordinates,
- Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func )
-{
- bool wasHit( false );
- Results hitTestResults;
-
- const Vector< RenderTaskList::Exclusive >& exclusives = renderTaskList.GetExclusivesList();
- HitTestFunctionWrapper hitTestFunctionWrapper( func );
- if( HitTestRenderTask( exclusives, sceneSize, layerList, renderTask, screenCoordinates, hitTestResults, hitTestFunctionWrapper ) )
- {
- results.actor = hitTestResults.actor;
- results.actorCoordinates = hitTestResults.actorCoordinates;
- wasHit = true;
- }
- return wasHit;
-}
-
-
} // namespace HitTestAlgorithm
} // namespace Internal
#define DALI_INTERNAL_HIT_TEST_ALGORITHM_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
*/
bool HitTest( const Vector2& sceneSize, RenderTaskList& renderTaskList, LayerList& layerList, const Vector2& screenCoordinates, Results& results );
-/**
- * Hit test specific to a given RenderTask
- *
- * @param[in] sceneSize The size of the scene.
- * @param[in] renderTaskList The render task list of the scene.
- * @param[in] layerList The layer list of the scene.
- * @param[in] renderTask The render task for hit test
- * @param[in] screenCoordinates The screen coordinates.
- * @param[out] results The results of the hit-test.
- * @param[in] func The function to use in the hit-test algorithm.
- * @return true if something was hit
- */
-bool HitTest( const Vector2& sceneSize, RenderTaskList& renderTaskList, LayerList& layerList, RenderTask& renderTask, const Vector2& screenCoordinates,
- Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func );
-
-
} // namespace HitTestAlgorithm
} // namespace Internal
// send a message to remove the scene-graph RenderTask
RemoveTaskMessage( mEventThreadServices, *mSceneObject, sceneObject );
- for ( Vector< Exclusive >::Iterator exclusiveIt = mExclusives.Begin(); exclusiveIt != mExclusives.End(); ++exclusiveIt )
+ for ( auto exclusiveIt = mExclusives.begin(); exclusiveIt != mExclusives.end(); ++exclusiveIt )
{
if ( exclusiveIt->renderTaskPtr == ptr )
{
- mExclusives.Erase( exclusiveIt );
+ mExclusives.erase( exclusiveIt );
break;
}
}
void RenderTaskList::SetExclusive( RenderTask* task, bool exclusive )
{
// Check to see if this rendertask has an entry?
- for ( Vector< Exclusive >::Iterator exclusiveIt = mExclusives.Begin(); exclusiveIt != mExclusives.End(); ++exclusiveIt )
+ for ( auto exclusiveIt = mExclusives.begin(); exclusiveIt != mExclusives.end(); ++exclusiveIt )
{
if ( exclusiveIt->renderTaskPtr == task )
{
if ( !exclusive )
{
- mExclusives.Erase( exclusiveIt );
+ mExclusives.erase( exclusiveIt );
break;
}
else
{
- exclusiveIt->actorPtr = task->GetSourceActor();
+ exclusiveIt->actor.SetActor( task->GetSourceActor() );
exclusive = false;
break;
}
{
Exclusive exclusiveSlot;
exclusiveSlot.renderTaskPtr = task;
- exclusiveSlot.actorPtr = task->GetSourceActor();
- mExclusives.PushBack( exclusiveSlot );
+ exclusiveSlot.actor.SetActor( task->GetSourceActor() );
+ mExclusives.emplace_back( std::move( exclusiveSlot ) );
}
}
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/internal/event/common/complete-notification-interface.h>
#include <dali/internal/event/render-tasks/render-task-impl.h>
+#include <dali/internal/event/events/actor-observer.h>
namespace Dali
{
struct Exclusive
{
RenderTask* renderTaskPtr; ///< Pointer for comparison with current rendertask.
- Actor* actorPtr; ///< Pointer for comparison with current actor.
+ ActorObserver actor; ///< For comparison with current actor.
};
+ using ExclusivesContainer = std::vector< Exclusive >;
+
/**
* Create a RenderTaskList.
* @return A newly allocated RenderTaskList; the caller takes ownership.
*
* @return [description]
*/
- const Vector< Exclusive >& GetExclusivesList() const
+ const ExclusivesContainer& GetExclusivesList() const
{
return mExclusives;
}
SceneGraph::RenderTaskList* mSceneObject; ///< Raw-pointer to the scene-graph object; not owned.
RenderTaskContainer mTasks; ///< Reference counted render-tasks
- Vector< Exclusive > mExclusives; ///< List of rendertasks with exclusively owned source actors.
+ ExclusivesContainer mExclusives; ///< List of rendertasks with exclusively owned source actors.
};
} // namespace Internal