#include <dali-test-suite-utils.h>
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/common/capabilities.h>
+#include <dali/devel-api/threading/thread.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
}
END_TEST;
}
+
+int UtcDaliActorDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliActorDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mActor.Reset();
+ }
+
+ Dali::Actor mActor;
+ };
+ TestThread thread;
+
+ Dali::Actor actor = Dali::Actor::New();
+ thread.mActor = std::move(actor);
+ actor.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/animation/animation-devel.h>
#include <dali/devel-api/animation/key-frames-devel.h>
+#include <dali/devel-api/threading/thread.h>
#include <dali/public-api/dali-core.h>
#include <stdlib.h>
}
END_TEST;
-}
\ No newline at end of file
+}
+
+int UtcDaliAnimationDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliAnimationDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mAnimation.Reset();
+ }
+
+ Dali::Animation mAnimation;
+ };
+ TestThread thread;
+
+ Dali::Animation animation = Dali::Animation::New(0);
+ thread.mAnimation = std::move(animation);
+ animation.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ 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/devel-api/rendering/frame-buffer-devel.h>
+#include <dali/devel-api/threading/thread.h>
#include <dali/public-api/dali-core.h>
using namespace Dali;
test_return_value = TET_PASS;
}
+namespace
+{
RenderTask CreateRenderTask(TestApplication& application,
FrameBuffer framebuffer)
{
return newTask;
}
+} // namespace
int UtcDaliFrameBufferNew01(void)
{
}
END_TEST;
}
+
+int UtcDaliFrameBufferDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliFrameBufferDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mFrameBuffer.Reset();
+ }
+
+ Dali::FrameBuffer mFrameBuffer;
+ };
+ TestThread thread;
+
+ Dali::FrameBuffer frameBuffer = Dali::FrameBuffer::New(100, 100);
+ thread.mFrameBuffer = std::move(frameBuffer);
+ frameBuffer.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
/*
- * 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.
*/
#include <dali-test-suite-utils.h>
+#include <dali/devel-api/threading/thread.h>
#include <dali/public-api/dali-core.h>
using namespace Dali;
}
END_TEST;
}
+
+int UtcDaliGeometryDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliGeometryDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mGeometry.Reset();
+ }
+
+ Dali::Geometry mGeometry;
+ };
+ TestThread thread;
+
+ Dali::Geometry geometry = Dali::Geometry::New();
+ thread.mGeometry = std::move(geometry);
+ geometry.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ 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/public-api/dali-core.h>
+#include <dali/devel-api/threading/thread.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/touch-integ.h>
#include <dali/integration-api/render-task-list-integ.h>
+#include <dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.h>
#include <dali/internal/event/events/touch-event-impl.h>
#include <dali/internal/event/render-tasks/render-task-impl.h>
-#include <dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.h>
+#include <dali/public-api/dali-core.h>
#include <stdlib.h>
#include <algorithm>
return touchEvent;
}
-}
-
+} // namespace
int UtcDaliGestureDetectorConstructorN(void)
{
int UtcDaliGestureDetectorCancelProcessing(void)
{
- TestApplication application;
- Integration::Scene scene = application.GetScene();
- RenderTaskList taskList = scene.GetRenderTaskList();
- Dali::RenderTask task = taskList.GetTask(0);
+ TestApplication application;
+ Integration::Scene scene = application.GetScene();
+ RenderTaskList taskList = scene.GetRenderTaskList();
+ Dali::RenderTask task = taskList.GetTask(0);
LongPressGestureDetector longDetector = LongPressGestureDetector::New();
TapGestureDetector tapDetector = TapGestureDetector::New();
TestTriggerLongPress(application);
longDetector.CancelAllOtherGestureDetectors();
-
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(false, tData.functorCalled, TEST_LOCATION);
data.Reset();
tData.Reset();
- tp = GenerateSingleTouch(PointState::UP, Vector2(50.0f, 50.0f), 1, 650);
+ tp = GenerateSingleTouch(PointState::UP, Vector2(50.0f, 50.0f), 1, 650);
touchEventImpl = new Internal::TouchEvent(650);
touchEventImpl->AddPoint(tp.GetPoint(0));
touchEventImpl->SetRenderTask(task);
longDetector.SetTouchesRequired(2, 2);
- tp = GenerateDoubleTouch(PointState::DOWN, Vector2(2.0f, 20.0f), PointState::DOWN, Vector2(38.0f, 20.0f), 100);
+ tp = GenerateDoubleTouch(PointState::DOWN, Vector2(2.0f, 20.0f), PointState::DOWN, Vector2(38.0f, 20.0f), 100);
touchEventImpl = new Internal::TouchEvent(100);
touchEventImpl->AddPoint(tp.GetPoint(0));
touchEventImpl->AddPoint(tp.GetPoint(1));
pinchDetector.CancelAllOtherGestureDetectors();
- tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 150);
+ tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 150);
touchEventImpl = new Internal::TouchEvent(150);
touchEventImpl->AddPoint(tp.GetPoint(0));
touchEventImpl->AddPoint(tp.GetPoint(1));
pinchDetector.HandleEvent(actor, touchEventHandle);
rotationDetector.HandleEvent(actor, touchEventHandle);
-
- tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 200);
+ tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 200);
touchEventImpl = new Internal::TouchEvent(200);
touchEventImpl->AddPoint(tp.GetPoint(0));
touchEventImpl->AddPoint(tp.GetPoint(1));
pinchDetector.HandleEvent(actor, touchEventHandle);
rotationDetector.HandleEvent(actor, touchEventHandle);
-
- tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 250);
+ tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 250);
touchEventImpl = new Internal::TouchEvent(250);
touchEventImpl->AddPoint(tp.GetPoint(0));
touchEventImpl->AddPoint(tp.GetPoint(1));
pinchDetector.HandleEvent(actor, touchEventHandle);
rotationDetector.HandleEvent(actor, touchEventHandle);
-
- tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 300);
+ tp = GenerateDoubleTouch(PointState::MOTION, Vector2(10.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 20.0f), 300);
touchEventImpl = new Internal::TouchEvent(300);
touchEventImpl->AddPoint(tp.GetPoint(0));
touchEventImpl->AddPoint(tp.GetPoint(1));
pinchDetector.HandleEvent(actor, touchEventHandle);
rotationDetector.HandleEvent(actor, touchEventHandle);
-
- tp = GenerateDoubleTouch(PointState::UP, Vector2(10.0f, 20.0f), PointState::UP, Vector2(30.0f, 20.0f), 350);
+ tp = GenerateDoubleTouch(PointState::UP, Vector2(10.0f, 20.0f), PointState::UP, Vector2(30.0f, 20.0f), 350);
touchEventImpl = new Internal::TouchEvent(350);
touchEventImpl->AddPoint(tp.GetPoint(0));
touchEventImpl->AddPoint(tp.GetPoint(1));
END_TEST;
}
+
+int UtcDaliGestureDetectorDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliGestureDetectorDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mGestureDetector.Reset();
+ }
+
+ Dali::GestureDetector mGestureDetector;
+ };
+ TestThread thread;
+
+ GestureDetector detector = PanGestureDetector::New();
+ thread.mGestureDetector = std::move(detector);
+ detector.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
/*
- * 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.
#include <dali-test-suite-utils.h>
#include <dali/devel-api/events/hit-test-algorithm.h>
+#include <dali/devel-api/threading/thread.h>
#include <dali/integration-api/debug.h>
#include <dali/public-api/dali-core.h>
#include <mesh-builder.h>
Actor parent = CreateRenderableActor();
parent.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 1.0f));
parent.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
- Actor child = CreateRenderableActor();
+ Actor child = CreateRenderableActor();
child.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 1.0f));
stage.Add(parent);
parent.Add(child);
- if (i == 1)
+ if(i == 1)
{
secondChild = child;
}
Actor parent = CreateRenderableActor();
parent.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 1.0f));
parent.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
- Actor child = Actor::New(); // Has no renderer
+ Actor child = Actor::New(); // Has no renderer
child.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 1.0f));
stage.Add(parent);
parent.Add(child);
- if (i == 1)
+ if(i == 1)
{
secondChild = child;
}
RenderTask renderTask1 = renderTaskList.CreateTask();
application.SendNotification();
- uint32_t answer1[2] = {0u, 0u};
+ uint32_t answer1[2] = {0u, 0u};
DALI_TEST_EQUALS(2, renderTaskList.GetTaskCount(), TEST_LOCATION);
for(uint32_t i = 0; i < 2; ++i)
{
RenderTask renderTask1 = renderTaskList.CreateTask();
application.SendNotification();
DALI_TEST_EQUALS(renderTask1, renderTaskList.GetTask(1u), TEST_LOCATION);
-
- RenderTask renderTask2 = renderTaskList.CreateTask();
+
+ RenderTask renderTask2 = renderTaskList.CreateTask();
application.SendNotification();
DALI_TEST_EQUALS(renderTask1, renderTaskList.GetTask(1u), TEST_LOCATION);
DALI_TEST_EQUALS(renderTask2, renderTaskList.GetTask(2u), TEST_LOCATION);
- RenderTask renderTask3 = renderTaskList.CreateTask();
+ RenderTask renderTask3 = renderTaskList.CreateTask();
application.SendNotification();
DALI_TEST_EQUALS(renderTask1, renderTaskList.GetTask(1u), TEST_LOCATION);
DALI_TEST_EQUALS(renderTask2, renderTaskList.GetTask(2u), TEST_LOCATION);
DALI_TEST_EQUALS(renderTask3, renderTaskList.GetTask(3u), TEST_LOCATION);
- RenderTask renderTask4 = renderTaskList.CreateTask();
+ RenderTask renderTask4 = renderTaskList.CreateTask();
application.SendNotification();
DALI_TEST_EQUALS(renderTask1, renderTaskList.GetTask(1u), TEST_LOCATION);
DALI_TEST_EQUALS(renderTask2, renderTaskList.GetTask(2u), TEST_LOCATION);
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;
}
+
+int UtcDaliRenderTaskDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliRenderTaskDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mRenderTask.Reset();
+ }
+
+ Dali::RenderTask mRenderTask;
+ };
+ TestThread thread;
+ Stage stage = Stage::GetCurrent();
+ Vector2 stageSize(stage.GetSize());
+
+ RenderTaskList renderTaskList = stage.GetRenderTaskList();
+
+ RenderTask renderTask = renderTaskList.CreateTask();
+
+ renderTaskList.RemoveTask(renderTask);
+
+ thread.mRenderTask = std::move(renderTask);
+ renderTask.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
\ No newline at end of file
/*
- * Copyright (c) 2020 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/devel-api/threading/thread.h>
#include <dali/public-api/dali-core.h>
#include <stdlib.h>
}
END_TEST;
}
+
+int UtcDaliRenderTaskListDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliRenderTaskListDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mRenderTaskList.Reset();
+ }
+
+ Dali::RenderTaskList mRenderTaskList;
+ };
+ TestThread thread;
+
+ Dali::Integration::Scene scene = Dali::Integration::Scene::New(Size(480.0f, 800.0f));
+
+ RenderTaskList renderTaskList = scene.GetRenderTaskList();
+
+ thread.mRenderTaskList = std::move(renderTaskList);
+ renderTaskList.Reset();
+
+ scene.RemoveSceneObject();
+ scene.Discard();
+ scene.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
#include <dali/devel-api/common/capabilities.h>
#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/rendering/renderer-devel.h>
+#include <dali/devel-api/threading/thread.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/render-task-list-integ.h>
#include <dali/public-api/dali-core.h>
const int skinningBlockSize = MAX_BONE_COUNT * sizeof(Matrix);
graphics.AddCustomUniformBlock(TestGraphicsReflection::TestUniformBlockInfo{
- "Skinning Block", 0, 0,
- skinningBlockSize,
- {{"uBone", Graphics::UniformClass::UNIFORM, 0, 0, {0}, {1}, MAX_BONE_COUNT, Property::Type::MATRIX}}});
+ "Skinning Block", 0, 0, skinningBlockSize, {{"uBone", Graphics::UniformClass::UNIFORM, 0, 0, {0}, {1}, MAX_BONE_COUNT, Property::Type::MATRIX}}});
const int MAX_MORPH_COUNT{128};
const int morphBlockSize = MAX_MORPH_COUNT * sizeof(float) + sizeof(float);
const uint32_t UNIFORM_BLOCK_ALIGNMENT(512);
gl.SetUniformBufferOffsetAlignment(UNIFORM_BLOCK_ALIGNMENT);
- const int MAX_BONE_COUNT{300};
+ const int MAX_BONE_COUNT{300};
TestGraphicsReflection::TestUniformBlockInfo skinningBlock;
skinningBlock.name = "SkinningBlock";
skinningBlock.binding = 0;
skinningBlock.descriptorSet = 0;
- graphics.AddMemberToUniformBlock( skinningBlock, "uBone", Property::Type::MATRIX, MAX_BONE_COUNT, 16 );
+ graphics.AddMemberToUniformBlock(skinningBlock, "uBone", Property::Type::MATRIX, MAX_BONE_COUNT, 16);
graphics.AddCustomUniformBlock(skinningBlock);
const int skinningBlockSize = int(skinningBlock.size);
- const int MAX_MORPH_COUNT{128};
+ const int MAX_MORPH_COUNT{128};
TestGraphicsReflection::TestUniformBlockInfo morphBlock;
morphBlock.name = "MorphBlock";
morphBlock.binding = 1;
morphBlock.descriptorSet = 0;
- graphics.AddMemberToUniformBlock( morphBlock, "uNumberOfBlendShapes", Property::Type::FLOAT, 0, 0 );
- graphics.AddMemberToUniformBlock( morphBlock, "uBlendShapeWeight", Property::Type::FLOAT, MAX_MORPH_COUNT, 16 );
+ graphics.AddMemberToUniformBlock(morphBlock, "uNumberOfBlendShapes", Property::Type::FLOAT, 0, 0);
+ graphics.AddMemberToUniformBlock(morphBlock, "uBlendShapeWeight", Property::Type::FLOAT, MAX_MORPH_COUNT, 16);
graphics.AddCustomUniformBlock(morphBlock);
Actor actor = CreateActor(application.GetScene().GetRootLayer(), 0, TEST_LOCATION);
TestGraphicsBuffer* bufferPtr = FindUniformBuffer(i % 2, graphics);
DALI_TEST_CHECK(graphics.mAllocatedBuffers.size() == (i == 0 ? 4 : 5));
DALI_TEST_CHECK(bufferPtr != nullptr);
- auto offset0 = sizeof(Dali::Matrix) * 299;
- Matrix* mPtr = reinterpret_cast<Dali::Matrix*>(&bufferPtr->memory[0] + offset0);
+ auto offset0 = sizeof(Dali::Matrix) * 299;
+ Matrix* mPtr = reinterpret_cast<Dali::Matrix*>(&bufferPtr->memory[0] + offset0);
DALI_TEST_EQUALS(*mPtr, n, 0.0001, TEST_LOCATION);
- const auto size = morphBlock.members[1].elementStride;
+ const auto size = morphBlock.members[1].elementStride;
const auto memberOffset = morphBlock.members[1].offsets[0];
- float* wPtr1 = reinterpret_cast<float*>(&bufferPtr->memory[MORPH_BLOCK_OFFSET] + memberOffset + size * 0);
- float* wPtr2 = reinterpret_cast<float*>(&bufferPtr->memory[MORPH_BLOCK_OFFSET] + memberOffset + size * 55);
- float* wPtr3 = reinterpret_cast<float*>(&bufferPtr->memory[MORPH_BLOCK_OFFSET] + memberOffset + size * 127);
+ float* wPtr1 = reinterpret_cast<float*>(&bufferPtr->memory[MORPH_BLOCK_OFFSET] + memberOffset + size * 0);
+ float* wPtr2 = reinterpret_cast<float*>(&bufferPtr->memory[MORPH_BLOCK_OFFSET] + memberOffset + size * 55);
+ float* wPtr3 = reinterpret_cast<float*>(&bufferPtr->memory[MORPH_BLOCK_OFFSET] + memberOffset + size * 127);
tet_printf("Test that uBlendShapeWeight[0] is written correctly as %4.2f\n", w1);
tet_printf("Test that uBlendShapeWeight[55] is written correctly as %4.2f\n", w2);
// if r is 0.0f then test fails as the array stomped on the uniform's memory.
DALI_TEST_EQUALS((uniformColor.r != 0.0f), true, TEST_LOCATION);
END_TEST;
-}
\ No newline at end of file
+}
+
+int UtcDaliRendererDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliRendererDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mRenderer.Reset();
+ }
+
+ Dali::Renderer mRenderer;
+ };
+ TestThread thread;
+
+ Dali::Geometry geometry = CreateQuadGeometry();
+ Dali::Shader shader = Dali::Shader::New("vertexSrc", "fragmentSrc");
+ Dali::Renderer renderer = Dali::Renderer::New(geometry, shader);
+ thread.mRenderer = std::move(renderer);
+ renderer.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
/*
- * Copyright (c) 2021 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.
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/threading/thread.h>
#include <dali/public-api/dali-core.h>
#include <string.h>
#include <unistd.h>
}
END_TEST;
}
+
+int UtcDaliSamplerDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliSamplerDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mSampler.Reset();
+ }
+
+ Dali::Sampler mSampler;
+ };
+ TestThread thread;
+
+ Dali::Sampler sampler = Dali::Sampler::New();
+ thread.mSampler = std::move(sampler);
+ sampler.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
#include <dali-test-suite-utils.h>
#include <dali/devel-api/common/stage.h>
+#include <dali/devel-api/threading/thread.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
application.Render(0);
END_TEST;
-}
\ No newline at end of file
+}
+
+int UtcDaliSceneDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliSceneDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // RemoveSceneObject, Discard and Destruct at worker thread.
+ mScene.RemoveSceneObject();
+ mScene.Discard();
+
+ mScene.Reset();
+ }
+
+ Dali::Integration::Scene mScene;
+ };
+ TestThread thread;
+
+ Dali::Integration::Scene scene = Dali::Integration::Scene::New(Size(480.0f, 800.0f));
+
+ // Unparent of DefaultCamera might throw exception. and exception at destructor will make abort.
+ // To avoid it, we should remove all children of root layer.
+ while(scene.GetRootLayer().GetChildCount() > 0)
+ {
+ auto child = scene.GetRootLayer().GetChildAt(0);
+ scene.GetRootLayer().Remove(child);
+ }
+
+ // To make ensure the last reference is in thread, call Discard first.
+ scene.Discard();
+
+ thread.mScene = std::move(scene);
+ scene.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
*/
#include <dali-test-suite-utils.h>
+#include <dali/devel-api/threading/thread.h>
#include <dali/public-api/dali-core.h>
#include <mesh-builder.h>
#include <stdlib.h>
DALI_TEST_CHECK(arrayCount == 0u);
END_TEST;
-}
\ No newline at end of file
+}
+
+int UtcDaliShaderDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliShaderDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mShader.Reset();
+ }
+
+ Dali::Shader mShader;
+ };
+ TestThread thread;
+
+ Dali::Shader shader = Dali::Shader::New("", "");
+ thread.mShader = std::move(shader);
+ shader.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
#include <dali-test-suite-utils.h>
#include <dali/devel-api/rendering/texture-devel.h>
+#include <dali/devel-api/threading/thread.h>
#include <dali/integration-api/pixel-data-integ.h>
#include <dali/integration-api/texture-integ.h>
#include <dali/public-api/dali-core.h>
END_TEST;
}
+
+int UtcDaliTextureDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliTextureDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Upload at worker thread
+ uint8_t* rawBuffer = new uint8_t[4];
+ Dali::PixelData pixelData = Dali::PixelData::New(rawBuffer, 4, 1, 1, Pixel::RGBA8888, Dali::PixelData::DELETE_ARRAY);
+
+ // Use try-catch to avoid memory leak false alarm
+ try
+ {
+ // Upload, GenerateMipmaps, and Destruct at worker thread.
+ mTexture.Upload(pixelData);
+ mTexture.GenerateMipmaps();
+ mTexture.Reset();
+ }
+ catch(...)
+ {
+ }
+ }
+
+ Dali::Texture mTexture;
+ };
+ TestThread thread;
+
+ Dali::Texture texture = Dali::Texture::New(Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 100, 100);
+ thread.mTexture = std::move(texture);
+ texture.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
/*
- * 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.
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/threading/thread.h>
#include <dali/public-api/dali-core.h>
// INTERNAL INCLUDES
END_TEST;
}
+
+int UtcDaliTextureSetDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliTextureSetDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mTextureSet.Reset();
+ }
+
+ Dali::TextureSet mTextureSet;
+ };
+ TestThread thread;
+
+ Dali::TextureSet textureSet = Dali::TextureSet::New();
+ thread.mTextureSet = std::move(textureSet);
+ textureSet.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
/*
- * 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.
*/
#include <dali-test-suite-utils.h>
+#include <dali/devel-api/threading/thread.h>
#include <dali/public-api/dali-core.h>
#include <chrono>
using namespace std::chrono_literals;
END_TEST;
}
+
+int UtcDaliVertexBufferDestructWorkerThreadN(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliAnimationDestructWorkerThreadN Test, for line coverage");
+
+ try
+ {
+ class TestThread : public Thread
+ {
+ public:
+ virtual void Run()
+ {
+ tet_printf("Run TestThread\n");
+ // Destruct at worker thread.
+ mVertexBuffer.Reset();
+ }
+
+ Dali::VertexBuffer mVertexBuffer;
+ };
+ TestThread thread;
+
+ Dali::VertexBuffer vertexBuffer = VertexBuffer::New(Property::Map() = {
+ {"aPosition", Property::Type::VECTOR2},
+ {"aTexCoord", Property::Type::VECTOR2}});
+ thread.mVertexBuffer = std::move(vertexBuffer);
+ vertexBuffer.Reset();
+
+ thread.Start();
+
+ thread.Join();
+ }
+ catch(...)
+ {
+ }
+
+ // Always success
+ DALI_TEST_CHECK(true);
+
+ END_TEST;
+}
/*
- * 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.
Actor::~Actor()
{
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~Actor[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
// Remove mParent pointers from children even if we're destroying core,
// to guard against GetParent() & Unparent() calls from CustomActor destructors.
UnparentChildren();
// Guard to allow handle destruction after Core has been destroyed
- if(EventThreadServices::IsCoreRunning())
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning()))
{
if(mRenderers)
{
// Actors can be added (in a callback), before the off-stage state is reported.
// Also if the actor was added & removed before mOnSceneSignalled was set, then we don't notify here.
// only do this step if there is a stage, i.e. Core is not being shut down
- if(EventThreadServices::IsCoreRunning() && !OnScene() && mOnSceneSignalled)
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning()) && !OnScene() && mOnSceneSignalled)
{
if(notify)
{
void Actor::SetParent(ActorParent* parent, bool notify)
{
bool emitInheritedVisible = false;
- bool visiblility = true;
+ bool visiblility = true;
if(parent)
{
DALI_ASSERT_ALWAYS(!mParent && "Actor cannot have 2 parents");
RequestRenderingMessage(GetEventThreadServices().GetUpdateManager());
}
- Actor* actor = this->GetParent();
- bool emitInheritedVisible = OnScene();
+ Actor* actor = this->GetParent();
+ bool emitInheritedVisible = OnScene();
while(emitInheritedVisible && actor)
{
emitInheritedVisible &= actor->GetProperty(Dali::Actor::Property::VISIBLE).Get<bool>();
if(mIsRoot)
{
// Guard to allow handle destruction after Core has been destroyed
- if(EventThreadServices::IsCoreRunning())
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning()))
{
UninstallRootMessage(GetEventThreadServices().GetUpdateManager(), &GetSceneGraphLayer());
Animation::~Animation()
{
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~Animation[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
// Guard to allow handle destruction after Core has been destroyed
if(Stage::IsInstalled())
{
/*
- * Copyright (c) 2021 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.
ConstraintBase::~ConstraintBase()
{
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~ConstraintBase[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
StopObservation();
RemoveInternal();
{
if(mTargetObject && !mApplied && !mSourceDestroyed)
{
- mApplied = true;
+ mApplied = true;
mIsPreConstraint = isPreConstraint;
ConnectConstraint(mIsPreConstraint);
Object::~Object()
{
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ if(nullptr != mUpdateObject)
+ {
+ DALI_LOG_ERROR("~Object[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+ }
+
NotifyObservers(*this, mObservers, &Object::Observer::ObjectDestroyed);
// Note : We don't need to restore mObserverNotifying to false as we are in delete the object.
/*
- * 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.
Scene::~Scene()
{
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~Scene[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
if(mDefaultCamera)
{
// its enough to release the handle so the object is released
void Scene::RemoveSceneObject()
{
- if(EventThreadServices::IsCoreRunning() && mSceneObject)
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning() && mSceneObject))
{
ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
RemoveSceneMessage(tls->GetUpdateManager(), *mSceneObject);
mSceneObject = nullptr;
}
+ else if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("Scene[%p] called RemoveSceneObject API from non-UI thread!\n", this);
+ }
}
void Scene::Discard()
{
- if(EventThreadServices::IsCoreRunning())
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning()))
{
ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
tls->RemoveScene(this);
}
+ else if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("Scene[%p] called Discard API from non-UI thread!\n", this);
+ }
}
void Scene::RequestRebuildDepthTree()
/*
- * Copyright (c) 2021 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.
GestureDetector::~GestureDetector()
{
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~GestureDetector[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
if(!mPendingAttachActors.empty())
{
for(GestureDetectorActorContainer::iterator iter = mPendingAttachActors.begin(), endIter = mPendingAttachActors.end(); iter != endIter; ++iter)
bool GestureDetector::HandleEvent(Dali::Actor& actor, Dali::TouchEvent& touch)
{
- bool ret = false;
+ bool ret = false;
Dali::Internal::Actor& actorImpl(GetImplementation(actor));
if(touch.GetPointCount() > 0 && actorImpl.OnScene())
{
}
Integration::TouchEvent touchEvent(touch.GetTime());
- for(std::size_t i = 0; i< touch.GetPointCount(); i++)
+ for(std::size_t i = 0; i < touch.GetPointCount(); i++)
{
- Integration::Point point;
+ Integration::Point point;
point.SetState(touch.GetState(i));
point.SetDeviceId(touch.GetDeviceId(i));
point.SetScreenPosition(touch.GetScreenPosition(i));
touchEvent.points.push_back(point);
}
-
Dali::Internal::TouchEvent& touchEventImpl(GetImplementation(touch));
mFeededActor.SetActor(&actorImpl);
mRenderTask = &GetImplementation(touchEventImpl.GetRenderTaskPtr());
/*
- * 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 false;
}
- CameraActor* localCamera = GetCameraActor();
- StagePtr stage = Stage::GetCurrent();
+ CameraActor* localCamera = GetCameraActor();
+ StagePtr stage = Stage::GetCurrent();
if(stage)
{
Vector2 size(stage->GetSize());
void RenderTask::RenderUntil(Actor* stopperActor)
{
Actor* target = mSourceActor.GetActor();
- DALI_ASSERT_ALWAYS((target && stopperActor)
- && "RenderTask::RenderUntil() has empty actors.");
- DALI_ASSERT_ALWAYS((target->GetHierarchyDepth() < stopperActor->GetHierarchyDepth())
- && "RenderTask::RenderUntil() has reversed hierarchy.");
+ DALI_ASSERT_ALWAYS((target && stopperActor) && "RenderTask::RenderUntil() has empty actors.");
+ DALI_ASSERT_ALWAYS((target->GetHierarchyDepth() < stopperActor->GetHierarchyDepth()) && "RenderTask::RenderUntil() has reversed hierarchy.");
Actor* parent = stopperActor;
while(parent != target && !(parent->IsLayer()))
RenderTask::~RenderTask()
{
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~RenderTask[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
DALI_LOG_INFO(gLogRender, Debug::General, "RenderTask::~RenderTask(this:%p)\n", this);
// scene object deletion is handled by our parent
// scene object handles observation of source and camera
/*
- * 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;
}
- std::stable_sort(mTasks.begin(), mTasks.end(), [](RenderTaskPtr first, RenderTaskPtr second) -> bool
- { return first->GetOrderIndex() < second->GetOrderIndex(); });
+ std::stable_sort(mTasks.begin(), mTasks.end(), [](RenderTaskPtr first, RenderTaskPtr second) -> bool { return first->GetOrderIndex() < second->GetOrderIndex(); });
OwnerPointer<std::vector<const SceneGraph::RenderTask*>> sortedTasks(new std::vector<const SceneGraph::RenderTask*>());
- for(auto && task : mTasks)
+ for(auto&& task : mTasks)
{
sortedTasks->push_back(task->GetRenderTaskSceneObject());
}
RenderTaskList::~RenderTaskList()
{
- if(EventThreadServices::IsCoreRunning() && mSceneObject)
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~RenderTaskList[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning() && mSceneObject))
{
// Remove the render task list using a message to the update manager
RemoveRenderTaskListMessage(mEventThreadServices.GetUpdateManager(), *mSceneObject);
/*
- * 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.
FrameBuffer::~FrameBuffer()
{
- if(EventThreadServices::IsCoreRunning() && mRenderObject)
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~FrameBuffer[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning() && mRenderObject))
{
RemoveFrameBuffer(mEventThreadServices.GetUpdateManager(), *mRenderObject);
}
/*
- * 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.
Geometry::~Geometry()
{
- if(EventThreadServices::IsCoreRunning() && mRenderObject)
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~Geometry[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning() && mRenderObject))
{
RemoveGeometry(mEventThreadServices.GetUpdateManager(), *mRenderObject);
}
/*
- * 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.
Renderer::~Renderer()
{
- if(EventThreadServices::IsCoreRunning())
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~Renderer[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning()))
{
EventThreadServices& eventThreadServices = GetEventThreadServices();
SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
/*
- * Copyright (c) 2021 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.
Sampler::~Sampler()
{
- if(EventThreadServices::IsCoreRunning() && mRenderObject)
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~Sampler[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning() && mRenderObject))
{
SceneGraph::UpdateManager& updateManager = mEventThreadServices.GetUpdateManager();
RemoveSamplerMessage(updateManager, *mRenderObject);
Shader::~Shader()
{
- if(EventThreadServices::IsCoreRunning())
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~Shader[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning()))
{
EventThreadServices& eventThreadServices = GetEventThreadServices();
SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
/*
- * 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.
void Texture::Initialize()
{
- if(EventThreadServices::IsCoreRunning())
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning()))
{
if(mNativeImage)
{
Texture::~Texture()
{
- if(EventThreadServices::IsCoreRunning() && mTextureKey)
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~Texture[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning() && mTextureKey))
{
RemoveTextureMessage(mEventThreadServices.GetUpdateManager(), mTextureKey);
}
"Parameter value out of range");
bool result(false);
- if(EventThreadServices::IsCoreRunning() && mTextureKey)
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning() && mTextureKey))
{
if(mNativeImage)
{
}
}
}
+ else
+ {
+ DALI_LOG_ERROR("Texture[%p] called Upload API from non-UI thread!\n", this);
+ }
return result;
}
void Texture::GenerateMipmaps()
{
- if(EventThreadServices::IsCoreRunning() && mTextureKey)
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning() && mTextureKey))
{
GenerateMipmapsMessage(mEventThreadServices.GetUpdateManager(), mTextureKey);
}
+ else
+ {
+ DALI_LOG_ERROR("Texture[%p] called GenerateMipmaps API from non-UI thread!\n", this);
+ }
}
uint32_t Texture::GetWidth() const
void Texture::SetSize(const ImageDimensions& size)
{
mSize = size;
- if(EventThreadServices::IsCoreRunning() && mTextureKey)
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning() && mTextureKey))
{
SetTextureSizeMessage(mEventThreadServices.GetUpdateManager(), mTextureKey, mSize);
}
void Texture::SetPixelFormat(Pixel::Format format)
{
mFormat = format;
- if(EventThreadServices::IsCoreRunning() && mTextureKey)
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning() && mTextureKey))
{
SetTextureFormatMessage(mEventThreadServices.GetUpdateManager(), mTextureKey, mFormat);
}
/*
- * 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.
TextureSet::~TextureSet()
{
- if(EventThreadServices::IsCoreRunning())
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~TextureSet[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning()))
{
SceneGraph::UpdateManager& updateManager = mEventThreadServices.GetUpdateManager();
RemoveTextureSetMessage(updateManager, *mSceneObject);
/*
- * 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.
VertexBuffer::~VertexBuffer()
{
- if(EventThreadServices::IsCoreRunning() && mRenderObject)
+ if(DALI_UNLIKELY(!Dali::Stage::IsCoreThread()))
+ {
+ DALI_LOG_ERROR("~VertexBuffer[%p] called from non-UI thread! something unknown issue will be happened!\n", this);
+ }
+
+ if(DALI_LIKELY(EventThreadServices::IsCoreRunning() && mRenderObject))
{
SceneGraph::RemoveVertexBuffer(mEventThreadServices.GetUpdateManager(), *mRenderObject);
}