Let we support to get the id of Animation and RenderTask, follow by NotifyInterface notify id.
Change-Id: I56b6a0d27ceae4024fb52255062ebd00b87332eb
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
END_TEST;
}
+
+int UtcDaliAnimationGetAnimationId(void)
+{
+ TestApplication application;
+
+ Animation animation = Animation::New(1.0f);
+
+ // Let we check id is not zero
+ DALI_TEST_CHECK(animation.GetAnimationId() != 0u);
+
+ auto previousId = animation.GetAnimationId();
+
+ animation.Clear();
+
+ // Let we check id is same even after we call Clear()
+ DALI_TEST_CHECK(animation.GetAnimationId() != 0u);
+ DALI_TEST_CHECK(animation.GetAnimationId() == previousId);
+
+ END_TEST;
+}
\ No newline at end of file
END_TEST;
}
+
+int UtcDaliRenderTaskGetRenderTaskId(void)
+{
+ TestApplication application;
+ tet_infoline("Testing RenderTask Id get");
+
+ Stage stage = Stage::GetCurrent();
+ Vector2 stageSize(stage.GetSize());
+
+ RenderTaskList renderTaskList = stage.GetRenderTaskList();
+
+ RenderTask renderTask1 = renderTaskList.CreateTask();
+ RenderTask renderTask2 = renderTaskList.CreateTask();
+ RenderTask renderTask3 = renderTaskList.CreateTask();
+
+ DALI_TEST_CHECK(renderTask1.GetRenderTaskId() != 0u);
+ DALI_TEST_CHECK(renderTask2.GetRenderTaskId() != 0u);
+ DALI_TEST_CHECK(renderTask3.GetRenderTaskId() != 0u);
+
+ DALI_TEST_CHECK(renderTask1.GetRenderTaskId() != renderTask2.GetRenderTaskId());
+ DALI_TEST_CHECK(renderTask2.GetRenderTaskId() != renderTask3.GetRenderTaskId());
+ DALI_TEST_CHECK(renderTask3.GetRenderTaskId() != renderTask1.GetRenderTaskId());
+
+ END_TEST;
+}
// Create a new animation, Keep a const pointer to the animation.
mAnimation = SceneGraph::Animation::New(mDurationSeconds, mSpeedFactor, mPlayRange, mLoopCount, mEndAction, mDisconnectAction);
+
+ // Set id of scene graph animation
+ mAnimationId = mAnimation->GetNotifyId();
+
OwnerPointer<SceneGraph::Animation> transferOwnership(const_cast<SceneGraph::Animation*>(mAnimation));
AddAnimationMessage(mEventThreadServices.GetUpdateManager(), transferOwnership);
// Remove animation using a message to the update manager
RemoveAnimationMessage(mEventThreadServices.GetUpdateManager(), *mAnimation);
mAnimation = nullptr;
+
+ // Reset id
+ mAnimationId = 0u;
}
}
return mAutoReverseEnabled ? Dali::Animation::AUTO_REVERSE : Dali::Animation::RESTART;
}
+uint32_t Animation::GetAnimationId() const
+{
+ return mAnimationId;
+}
+
bool Animation::CompareConnectorEndTimes(const Animation::ConnectorTargetValues& lhs, const Animation::ConnectorTargetValues& rhs)
{
return ((lhs.timePeriod.delaySeconds + lhs.timePeriod.durationSeconds) < (rhs.timePeriod.delaySeconds + rhs.timePeriod.durationSeconds));
*/
Dali::Animation::LoopingMode GetLoopingMode() const;
+ /**
+ * @copydoc Dali::Animation::GetAnimationId()
+ */
+ uint32_t GetAnimationId() const;
+
public: // For connecting animators to animations
/**
* Add an animator connector.
AnimatorConnectorContainer mConnectors{}; ///< Owned by the Animation
ConnectorTargetValuesContainer mConnectorTargetValues{}; //< Used to store animating property target value information
+ uint32_t mAnimationId{0u};
+
AlphaFunction mDefaultAlpha;
Vector2 mPlayRange{0.0f, 1.0f};
float mBlendPoint{0.0f};
// EXTERNAL INCLUDES
#include <cstring> // for strcmp
+#include "render-task-impl.h"
// INTERNAL INCLUDES
#include <dali/internal/event/actors/actor-impl.h>
if(mOrderIndex != orderIndex)
{
mOrderIndex = orderIndex;
- mRenderTaskList.RequestToSort();
+
+ // We only need to sort render task list if it is valid.
+ if(GetRenderTaskSceneObject())
+ {
+ mRenderTaskList.RequestToSort();
+ }
}
}
return mOrderIndex;
}
+uint32_t RenderTask::GetRenderTaskId() const
+{
+ return mRenderTaskId;
+}
+
const SceneGraph::RenderTask* RenderTask::GetRenderTaskSceneObject() const
{
return static_cast<const SceneGraph::RenderTask*>(mUpdateObject);
mCullMode(Dali::RenderTask::DEFAULT_CULL_MODE),
mRequiresSync(false)
{
+ // Set id of render task
+ mRenderTaskId = sceneObject->GetNotifyId();
+
DALI_LOG_INFO(gLogRender, Debug::General, "RenderTask::RenderTask(this:%p)\n", this);
// scene object handles observation of source and camera
}
*/
int32_t GetOrderIndex() const;
+ /**
+ * @copydoc Dali::RenderTask::GetRenderTaskId()
+ */
+ uint32_t GetRenderTaskId() const;
+
public: // Used by RenderTaskList, which owns the SceneGraph::RenderTasks
/**
* Retrieve the scene-graph RenderTask object.
uint32_t mRenderPassTag{0u};
int32_t mOrderIndex{0u};
+ uint32_t mRenderTaskId{0u};
+
bool mExclusive : 1; ///< True if the render-task has exclusive access to the source Nodes.
bool mInputEnabled : 1; ///< True if the render-task should be considered for input handling.
bool mClearEnabled : 1; ///< True if the render-task should be clear the color buffer.
/*
- * Copyright (c) 2023 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.
return GetImplementation(*this).GetLoopingMode();
}
+uint32_t Animation::GetAnimationId() const
+{
+ return GetImplementation(*this).GetAnimationId();
+}
+
Animation::AnimationSignalType& Animation::FinishedSignal()
{
return GetImplementation(*this).FinishedSignal();
#define DALI_ANIMATION_H
/*
- * Copyright (c) 2023 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.
LoopingMode GetLoopingMode() const;
/**
+ * @brief Get the unique id of Animation. It could be 0 given animation is invalid.
+ *
+ * @SINCE_2_3.14
+ * @return The unique id of Animation, or 0 if invalid.
+ */
+ uint32_t GetAnimationId() const;
+
+ /**
* @brief Connects to this signal to be notified when an Animation's animations have finished.
*
* @SINCE_1_0.0
return GetImplementation(*this).GetOrderIndex();
}
+uint32_t RenderTask::GetRenderTaskId() const
+{
+ return GetImplementation(*this).GetRenderTaskId();
+}
+
RenderTask::RenderTask(Internal::RenderTask* internal)
: Handle(internal)
{
*/
int32_t GetOrderIndex() const;
+ /**
+ * @brief Get the unique id of RenderTask. It could be 0 given render task is invalid.
+ *
+ * @SINCE_2_3.10
+ * @return The unique id of RenderTask, or 0 if invalid.
+ */
+ uint32_t GetRenderTaskId() const;
+
public: // Signals
/**
* @brief If the refresh rate is REFRESH_ONCE, connect to this signal to be notified when a RenderTask has finished.