/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
namespace
{
-
/**
* For the diffuse and specular cube map texture.
* These textures are based off version of Wave engine sample
* Take from https://github.com/WaveEngine/Samples
*
- * Copyright (c) 2024 Wave Coorporation
+ * Copyright (c) 2025 Wave Coorporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
Dali::Scene3D::ModelNode GetContentPlaneNode(Dali::Scene3D::Panel panel)
{
Dali::Scene3D::ModelNode contentPlaneNode;
- Dali::Actor panelNode;
+ Dali::Actor panelNode;
for(uint32_t i = 0; i < panel.GetChildCount(); ++i)
{
- Dali::Actor actor = panel.GetChildAt(i);
+ Dali::Actor actor = panel.GetChildAt(i);
Scene3D::ModelNode modelNode = Scene3D::ModelNode::DownCast(actor);
if(modelNode)
{
Dali::Scene3D::ModelNode GetBackPlaneNode(Dali::Scene3D::Panel panel)
{
Dali::Scene3D::ModelNode backPlaneNode;
- Dali::Actor panelNode;
+ Dali::Actor panelNode;
for(uint32_t i = 0; i < panel.GetChildCount(); ++i)
{
- Dali::Actor actor = panel.GetChildAt(i);
+ Dali::Actor actor = panel.GetChildAt(i);
Scene3D::ModelNode modelNode = Scene3D::ModelNode::DownCast(actor);
if(modelNode)
{
Dali::Scene3D::ModelNode GetDoubleSidedPlaneNode(Dali::Scene3D::Panel panel)
{
Dali::Scene3D::ModelNode backPlaneNode;
- Dali::Actor panelNode;
+ Dali::Actor panelNode;
for(uint32_t i = 0; i < panel.GetChildCount(); ++i)
{
- Dali::Actor actor = panel.GetChildAt(i);
+ Dali::Actor actor = panel.GetChildAt(i);
Scene3D::ModelNode modelNode = Scene3D::ModelNode::DownCast(actor);
if(modelNode)
{
return texture;
}
-}
+} // namespace
int UtcDaliPanelIBLWithSceneView(void)
{
bool isBackPlaneVisible;
bool isDoubleSided;
- isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
+ isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
contentPlaneAlphaMode = contentPlaneMaterial.GetProperty<Dali::Scene3D::Material::AlphaModeType>(Dali::Scene3D::Material::Property::ALPHA_MODE);
DALI_TEST_EQUALS(contentPlaneAlphaMode, isTransparent ? Dali::Scene3D::Material::AlphaModeType::BLEND : Dali::Scene3D::Material::AlphaModeType::OPAQUE, TEST_LOCATION);
isUsingBackFacePlane = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE);
isDoubleSided = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::DOUBLE_SIDED);
DALI_TEST_EQUALS(doubleSidedPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), isDoubleSided && !isBackPlaneVisible, TEST_LOCATION);
-
// Case 1. transparent false, double sided false, useBackFacePlane false;
// Front Material Alpha Mode : Opaque, Back Plane Visible : false, Front Material Double Sided : false
panel.SetProperty(Dali::Scene3D::Panel::Property::TRANSPARENT, false);
panel.SetProperty(Dali::Scene3D::Panel::Property::DOUBLE_SIDED, false);
panel.SetProperty(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE, false);
- isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
+ isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
contentPlaneAlphaMode = contentPlaneMaterial.GetProperty<Dali::Scene3D::Material::AlphaModeType>(Dali::Scene3D::Material::Property::ALPHA_MODE);
- isUsingBackFacePlane = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE);
- isBackPlaneVisible = !isTransparent && isUsingBackFacePlane;
- isDoubleSided = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::DOUBLE_SIDED);
+ isUsingBackFacePlane = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE);
+ isBackPlaneVisible = !isTransparent && isUsingBackFacePlane;
+ isDoubleSided = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::DOUBLE_SIDED);
DALI_TEST_EQUALS(contentPlaneAlphaMode, isTransparent ? Dali::Scene3D::Material::AlphaModeType::BLEND : Dali::Scene3D::Material::AlphaModeType::OPAQUE, TEST_LOCATION);
DALI_TEST_EQUALS(backPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), isBackPlaneVisible, TEST_LOCATION);
DALI_TEST_EQUALS(doubleSidedPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), isDoubleSided && !isBackPlaneVisible, TEST_LOCATION);
DALI_TEST_EQUALS(backPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), false, TEST_LOCATION);
DALI_TEST_EQUALS(doubleSidedPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), false, TEST_LOCATION);
-
// Case 2. transparent false, double sided false, useBackFacePlane true;
// Front Material Alpha Mode : Opaque, Back Plane Visible : true, Front Material Double Sided : false
panel.SetProperty(Dali::Scene3D::Panel::Property::TRANSPARENT, false);
panel.SetProperty(Dali::Scene3D::Panel::Property::DOUBLE_SIDED, false);
panel.SetProperty(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE, true);
- isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
+ isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
contentPlaneAlphaMode = contentPlaneMaterial.GetProperty<Dali::Scene3D::Material::AlphaModeType>(Dali::Scene3D::Material::Property::ALPHA_MODE);
DALI_TEST_EQUALS(contentPlaneAlphaMode, isTransparent ? Dali::Scene3D::Material::AlphaModeType::BLEND : Dali::Scene3D::Material::AlphaModeType::OPAQUE, TEST_LOCATION);
isUsingBackFacePlane = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE);
DALI_TEST_EQUALS(backPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), true, TEST_LOCATION);
DALI_TEST_EQUALS(doubleSidedPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), false, TEST_LOCATION);
-
// Case 2. transparent false, double sided true, useBackFacePlane false;
// Front Material Alpha Mode : Opaque, Back Plane Visible : false, Front Material Double Sided : true
panel.SetProperty(Dali::Scene3D::Panel::Property::TRANSPARENT, false);
panel.SetProperty(Dali::Scene3D::Panel::Property::DOUBLE_SIDED, true);
panel.SetProperty(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE, false);
- isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
+ isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
contentPlaneAlphaMode = contentPlaneMaterial.GetProperty<Dali::Scene3D::Material::AlphaModeType>(Dali::Scene3D::Material::Property::ALPHA_MODE);
DALI_TEST_EQUALS(contentPlaneAlphaMode, isTransparent ? Dali::Scene3D::Material::AlphaModeType::BLEND : Dali::Scene3D::Material::AlphaModeType::OPAQUE, TEST_LOCATION);
isUsingBackFacePlane = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE);
DALI_TEST_EQUALS(backPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), false, TEST_LOCATION);
DALI_TEST_EQUALS(doubleSidedPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), true, TEST_LOCATION);
-
// Case 2. transparent false, double sided true, useBackFacePlane true;
// Front Material Alpha Mode : Opaque, Back Plane Visible : true, Front Material Double Sided : false
panel.SetProperty(Dali::Scene3D::Panel::Property::TRANSPARENT, false);
panel.SetProperty(Dali::Scene3D::Panel::Property::DOUBLE_SIDED, true);
panel.SetProperty(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE, true);
- isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
+ isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
contentPlaneAlphaMode = contentPlaneMaterial.GetProperty<Dali::Scene3D::Material::AlphaModeType>(Dali::Scene3D::Material::Property::ALPHA_MODE);
DALI_TEST_EQUALS(contentPlaneAlphaMode, isTransparent ? Dali::Scene3D::Material::AlphaModeType::BLEND : Dali::Scene3D::Material::AlphaModeType::OPAQUE, TEST_LOCATION);
isUsingBackFacePlane = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE);
DALI_TEST_EQUALS(backPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), true, TEST_LOCATION);
DALI_TEST_EQUALS(doubleSidedPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), false, TEST_LOCATION);
-
// Case 1. transparent true, double sided false, useBackFacePlane false;
// Front Material Alpha Mode : Blend, Back Plane Visible : false, Front Material Double Sided : false
panel.SetProperty(Dali::Scene3D::Panel::Property::TRANSPARENT, true);
panel.SetProperty(Dali::Scene3D::Panel::Property::DOUBLE_SIDED, false);
panel.SetProperty(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE, false);
- isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
+ isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
contentPlaneAlphaMode = contentPlaneMaterial.GetProperty<Dali::Scene3D::Material::AlphaModeType>(Dali::Scene3D::Material::Property::ALPHA_MODE);
DALI_TEST_EQUALS(contentPlaneAlphaMode, isTransparent ? Dali::Scene3D::Material::AlphaModeType::BLEND : Dali::Scene3D::Material::AlphaModeType::OPAQUE, TEST_LOCATION);
isUsingBackFacePlane = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE);
DALI_TEST_EQUALS(backPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), false, TEST_LOCATION);
DALI_TEST_EQUALS(doubleSidedPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), false, TEST_LOCATION);
-
// Case 2. transparent true, double sided false, useBackFacePlane true;
// Front Material Alpha Mode : Blend, Back Plane Visible : false, Front Material Double Sided : false
panel.SetProperty(Dali::Scene3D::Panel::Property::TRANSPARENT, true);
panel.SetProperty(Dali::Scene3D::Panel::Property::DOUBLE_SIDED, false);
panel.SetProperty(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE, true);
- isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
+ isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
contentPlaneAlphaMode = contentPlaneMaterial.GetProperty<Dali::Scene3D::Material::AlphaModeType>(Dali::Scene3D::Material::Property::ALPHA_MODE);
DALI_TEST_EQUALS(contentPlaneAlphaMode, isTransparent ? Dali::Scene3D::Material::AlphaModeType::BLEND : Dali::Scene3D::Material::AlphaModeType::OPAQUE, TEST_LOCATION);
isUsingBackFacePlane = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE);
DALI_TEST_EQUALS(backPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), false, TEST_LOCATION);
DALI_TEST_EQUALS(doubleSidedPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), false, TEST_LOCATION);
-
// Case 2. transparent true, double sided true, useBackFacePlane false;
// Front Material Alpha Mode : Blend, Back Plane Visible : false, Front Material Double Sided : true
panel.SetProperty(Dali::Scene3D::Panel::Property::TRANSPARENT, true);
panel.SetProperty(Dali::Scene3D::Panel::Property::DOUBLE_SIDED, true);
panel.SetProperty(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE, false);
- isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
+ isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
contentPlaneAlphaMode = contentPlaneMaterial.GetProperty<Dali::Scene3D::Material::AlphaModeType>(Dali::Scene3D::Material::Property::ALPHA_MODE);
DALI_TEST_EQUALS(contentPlaneAlphaMode, isTransparent ? Dali::Scene3D::Material::AlphaModeType::BLEND : Dali::Scene3D::Material::AlphaModeType::OPAQUE, TEST_LOCATION);
isUsingBackFacePlane = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE);
DALI_TEST_EQUALS(backPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), false, TEST_LOCATION);
DALI_TEST_EQUALS(doubleSidedPlaneNode.GetProperty<bool>(Dali::Actor::Property::VISIBLE), true, TEST_LOCATION);
-
// Case 2. transparent true, double sided true, useBackFacePlane true;
// Front Material Alpha Mode : Blend, Back Plane Visible : false, Front Material Double Sided : true
panel.SetProperty(Dali::Scene3D::Panel::Property::TRANSPARENT, true);
panel.SetProperty(Dali::Scene3D::Panel::Property::DOUBLE_SIDED, true);
panel.SetProperty(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE, true);
- isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
+ isTransparent = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::TRANSPARENT);
contentPlaneAlphaMode = contentPlaneMaterial.GetProperty<Dali::Scene3D::Material::AlphaModeType>(Dali::Scene3D::Material::Property::ALPHA_MODE);
DALI_TEST_EQUALS(contentPlaneAlphaMode, isTransparent ? Dali::Scene3D::Material::AlphaModeType::BLEND : Dali::Scene3D::Material::AlphaModeType::OPAQUE, TEST_LOCATION);
isUsingBackFacePlane = panel.GetProperty<bool>(Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE);
for(uint32_t i = 0; i < panelRootLayer.GetChildCount(); ++i)
{
- Dali::Actor child = panelRootLayer.GetChildAt(i);
+ Dali::Actor child = panelRootLayer.GetChildAt(i);
Dali::Toolkit::Control childControl = Dali::Toolkit::Control::DownCast(child);
if(childControl)
{
for(uint32_t i = 0; i < panelRootLayer.GetChildCount(); ++i)
{
- Dali::Actor child = panelRootLayer.GetChildAt(i);
+ Dali::Actor child = panelRootLayer.GetChildAt(i);
Dali::Toolkit::Control childControl = Dali::Toolkit::Control::DownCast(child);
if(childControl)
{
ToolkitTestApplication application;
tet_infoline("UtcDaliPanelRenderTaskOrdering");
- Integration::Scene scene = application.GetScene();
- RenderTaskList taskList = scene.GetRenderTaskList();
+ Integration::Scene scene = application.GetScene();
+ RenderTaskList taskList = scene.GetRenderTaskList();
- uint32_t defaultTaskCount = taskList.GetTaskCount();
+ uint32_t defaultTaskCount = taskList.GetTaskCount();
RenderTask defaultRenderTask = taskList.GetTask(defaultTaskCount - 1);
tet_printf("default Task Cnt : %d\n", defaultTaskCount);
sceneView.UseFramebuffer(true);
scene.Add(sceneView);
- uint32_t afterSceneViewTaskCount = taskList.GetTaskCount();
- RenderTask sceneViewRenderTask = taskList.GetTask(afterSceneViewTaskCount - 1);
+ uint32_t afterSceneViewTaskCount = taskList.GetTaskCount();
+ RenderTask sceneViewRenderTask = taskList.GetTask(afterSceneViewTaskCount - 1);
tet_printf("after SceneView Task cnt : %d\n", afterSceneViewTaskCount);
DALI_TEST_CHECK(afterSceneViewTaskCount == defaultTaskCount + 1);
Scene3D::Panel panel = Scene3D::Panel::New();
sceneView.Add(panel);
- uint32_t afterPanelTaskCount = taskList.GetTaskCount();
- RenderTask panelRenderTask = taskList.GetTask(afterPanelTaskCount - 1);
+ uint32_t afterPanelTaskCount = taskList.GetTaskCount();
+ RenderTask panelRenderTask = taskList.GetTask(afterPanelTaskCount - 1);
tet_printf("after Panel Task cnt : %d\n", afterPanelTaskCount);
DALI_TEST_CHECK(afterPanelTaskCount == afterSceneViewTaskCount + 1);
Control control1 = Control::New();
control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
control1.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 1.0f));
- control1.SetRenderEffect(BackgroundBlurEffect::New());
+ control1.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
panel.Add(control1);
- uint32_t afterBlurEffectTaskCount = taskList.GetTaskCount();
- RenderTask blurSourceRenderTask = taskList.GetTask(afterBlurEffectTaskCount - 3);
+ uint32_t afterBlurEffectTaskCount = taskList.GetTaskCount();
+ RenderTask blurSourceRenderTask = taskList.GetTask(afterBlurEffectTaskCount - 3);
RenderTask blurHorizontalRenderTask = taskList.GetTask(afterBlurEffectTaskCount - 2);
- RenderTask blurVerticalRenderTask = taskList.GetTask(afterBlurEffectTaskCount - 1);
+ RenderTask blurVerticalRenderTask = taskList.GetTask(afterBlurEffectTaskCount - 1);
tet_printf("after blurEffect Task cnt : %d\n", afterBlurEffectTaskCount);
DALI_TEST_CHECK(afterBlurEffectTaskCount == afterPanelTaskCount + 3);
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
* These textures are based off version of Wave engine sample
* Take from https://github.com/WaveEngine/Samples
*
- * Copyright (c) 2024 Wave Coorporation
+ * Copyright (c) 2025 Wave Coorporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
Control control1 = Control::New();
control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
control1.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 1.0f));
- control1.SetRenderEffect(BackgroundBlurEffect::New());
+ control1.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
sceneView.Add(control1);
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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 handle;
}
+ RenderEffectImplPtr Clone() const override
+ {
+ return New();
+ }
+
OffScreenRenderable::Type GetOffScreenRenderableType() override
{
return OffScreenRenderable::Type::NONE;
}
void GetOffScreenRenderTasks(std::vector<Dali::RenderTask>& tasks, bool isForward) override
- {}
+ {
+ }
protected:
TestRenderEffectImpl()
Toolkit::TestRenderEffect testEffect = Toolkit::TestRenderEffect::New();
DALI_TEST_CHECK(testEffect);
- // Check that effect is not activate yet.
- Toolkit::Internal::TestRenderEffectImpl& impl = Toolkit::Internal::GetImplementation(testEffect);
- DALI_TEST_EQUALS(impl.IsActivated(), false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
+ // Check that effect prototype is not activated.
+ Toolkit::Internal::TestRenderEffectImpl& prototype = Toolkit::Internal::GetImplementation(testEffect);
+ DALI_TEST_EQUALS(prototype.IsActivated(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(prototype.mOnActivated, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(prototype.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
+
{
ToolkitTestApplication application;
tet_printf("Test effect set, and activate due to control scene on.\n");
control.SetRenderEffect(testEffect);
- DALI_TEST_EQUALS(impl.IsActivated(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), control, TEST_LOCATION);
+ Toolkit::Internal::TestRenderEffectImplPtr impl =
+ dynamic_cast<Toolkit::Internal::TestRenderEffectImpl*>(control.GetRenderEffect().GetObjectPtr());
+
+ { // Check that effect prototype is not activated,
+ DALI_TEST_EQUALS(impl == &prototype, false, TEST_LOCATION);
+
+ DALI_TEST_EQUALS(prototype.IsActivated(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(prototype.mOnActivated, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(prototype.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
+
+ // but the effect is set and activated.
+ DALI_TEST_EQUALS(impl->IsActivated(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl->mOnActivated, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl->GetOwnerControl(), control, TEST_LOCATION);
+ }
control.Unparent();
- DALI_TEST_EQUALS(impl.IsActivated(), false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), control, TEST_LOCATION);
+ {
+ DALI_TEST_EQUALS(impl->IsActivated(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl->mOnActivated, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl->GetOwnerControl(), control, TEST_LOCATION);
+ }
scene.Add(control);
- DALI_TEST_EQUALS(impl.IsActivated(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), control, TEST_LOCATION);
+ {
+ DALI_TEST_EQUALS(impl->IsActivated(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl->mOnActivated, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl->GetOwnerControl(), control, TEST_LOCATION);
+ }
// Control released.
-
control.Unparent();
control.Reset();
tet_printf("Test effect owner control is empty after control destructed.\n");
DALI_TEST_CHECK(testEffect);
- DALI_TEST_EQUALS(impl.IsActivated(), false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
+ {
+ DALI_TEST_EQUALS(impl->IsActivated(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl->mOnActivated, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl->GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
+ }
control = Control::New();
control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
tet_printf("Test effect set again.\n");
control.SetRenderEffect(testEffect);
- DALI_TEST_EQUALS(impl.IsActivated(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), control, TEST_LOCATION);
+ Toolkit::Internal::TestRenderEffectImplPtr impl2 =
+ dynamic_cast<Toolkit::Internal::TestRenderEffectImpl*>(control.GetRenderEffect().GetObjectPtr());
+ {
+ DALI_TEST_EQUALS(impl == impl2, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl->IsActivated(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl->mOnActivated, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl->GetOwnerControl(), Toolkit::Control(), TEST_LOCATION); // may be false?
+
+ DALI_TEST_EQUALS(impl2->IsActivated(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl2->mOnActivated, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl2->GetOwnerControl(), control, TEST_LOCATION);
+ }
// Terminate application.
}
- tet_printf("Test effect owner control is empty and deactivated after application destructed.\n");
- DALI_TEST_CHECK(testEffect);
-
- DALI_TEST_EQUALS(impl.IsActivated(), false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
-
END_TEST;
}
DALI_TEST_CHECK(testEffect);
// Check that effect is not activate yet.
- Toolkit::Internal::TestRenderEffectImpl& impl = Toolkit::Internal::GetImplementation(testEffect);
- DALI_TEST_EQUALS(impl.IsActivated(), false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
+ Toolkit::Internal::TestRenderEffectImpl& prototype = Toolkit::Internal::GetImplementation(testEffect);
+ DALI_TEST_EQUALS(prototype.IsActivated(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(prototype.mOnActivated, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(prototype.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
tet_printf("Test effect set, and activate due to control scene on.\n");
control1.SetRenderEffect(testEffect);
- DALI_TEST_EQUALS(impl.IsActivated(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), control1, TEST_LOCATION);
+ Toolkit::Internal::TestRenderEffectImpl& impl1 =
+ *(dynamic_cast<Toolkit::Internal::TestRenderEffectImpl*>(control1.GetRenderEffect().GetObjectPtr()));
+
+ DALI_TEST_EQUALS(&prototype == &impl1, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(prototype.IsActivated(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(prototype.mOnActivated, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(prototype.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
+
+ DALI_TEST_EQUALS(impl1.IsActivated(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl1.mOnActivated, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl1.GetOwnerControl(), control1, TEST_LOCATION);
tet_printf("Test effect set to another control\n");
control2.SetRenderEffect(testEffect);
- DALI_TEST_EQUALS(impl.IsActivated(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), control2, TEST_LOCATION);
+ Toolkit::Internal::TestRenderEffectImpl& impl2 =
+ *(dynamic_cast<Toolkit::Internal::TestRenderEffectImpl*>(control2.GetRenderEffect().GetObjectPtr()));
+ DALI_TEST_EQUALS(&impl1 == &impl2, false, TEST_LOCATION);
- tet_printf("Test control1 call ClearRenderEffect don't have any effort to effect\n");
+ DALI_TEST_EQUALS(impl2.IsActivated(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl2.mOnActivated, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl2.GetOwnerControl(), control2, TEST_LOCATION);
+
+ tet_printf("Test control1 call ClearRenderEffect don't have any effort to control2's effect\n");
control1.ClearRenderEffect();
- DALI_TEST_EQUALS(impl.IsActivated(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), control2, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl1.IsActivated(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl1.mOnActivated, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl1.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
+
+ DALI_TEST_EQUALS(impl2.IsActivated(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl2.mOnActivated, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl2.GetOwnerControl(), control2, TEST_LOCATION);
tet_printf("Test control2 call ClearRenderEffect\n");
control2.ClearRenderEffect();
- DALI_TEST_EQUALS(impl.IsActivated(), false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
+ DALI_TEST_EQUALS(impl2.IsActivated(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl2.mOnActivated, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl2.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
tet_printf("Reset control1 effect\n");
control1.SetRenderEffect(testEffect);
- DALI_TEST_EQUALS(impl.IsActivated(), true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, true, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), control1, TEST_LOCATION);
+ Toolkit::Internal::TestRenderEffectImpl& impl3 =
+ *(dynamic_cast<Toolkit::Internal::TestRenderEffectImpl*>(control1.GetRenderEffect().GetObjectPtr()));
+
+ DALI_TEST_EQUALS(&impl1 == &impl3, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl1.IsActivated(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl1.mOnActivated, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl1.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
+
+ DALI_TEST_EQUALS(impl3.IsActivated(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl3.mOnActivated, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(impl3.GetOwnerControl(), control1, TEST_LOCATION);
tet_printf("Test control1 call SetRenderEffect with empty handle\n");
control1.SetRenderEffect(Toolkit::RenderEffect());
-
- DALI_TEST_EQUALS(impl.IsActivated(), false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.mOnActivated, false, TEST_LOCATION);
- DALI_TEST_EQUALS(impl.GetOwnerControl(), Toolkit::Control(), TEST_LOCATION);
+ DALI_TEST_CHECK(!control1.GetRenderEffect());
END_TEST;
}
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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-toolkit-test-suite-utils.h>
#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/public-api/controls/render-effects/background-blur-effect.h>
+#include <dali-toolkit/public-api/controls/render-effects/render-effect.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
using namespace Dali;
ToolkitTestApplication application;
tet_infoline("UtcDaliRenderEffectNewP");
- BackgroundBlurEffect blurEffect = BackgroundBlurEffect::New();
+ RenderEffect blurEffect = RenderEffect::CreateBackgroundBlurEffect();
DALI_TEST_CHECK(blurEffect);
- BackgroundBlurEffect blurEffect2 = BackgroundBlurEffect::New(0.5f, 10);
+ RenderEffect blurEffect2 = RenderEffect::CreateBackgroundBlurEffect(0.5f, 10);
DALI_TEST_CHECK(blurEffect2);
END_TEST;
tet_printf("Check some invalid parameters clamp internally\n");
- BackgroundBlurEffect blurEffect = BackgroundBlurEffect::New(-0.5f, 10);
- BackgroundBlurEffect blurEffect2 = BackgroundBlurEffect::New(10.0f, 10);
- BackgroundBlurEffect blurEffect3 = BackgroundBlurEffect::New(0.5f, 0);
- BackgroundBlurEffect blurEffect4 = BackgroundBlurEffect::New(0.5f, 2147483647);
+ RenderEffect blurEffect = RenderEffect::CreateBackgroundBlurEffect(-0.5f, 10);
+ RenderEffect blurEffect2 = RenderEffect::CreateBackgroundBlurEffect(10.0f, 10);
+ RenderEffect blurEffect3 = RenderEffect::CreateBackgroundBlurEffect(0.5f, 0);
+ RenderEffect blurEffect4 = RenderEffect::CreateBackgroundBlurEffect(0.5f, 2147483647);
+
DALI_TEST_CHECK(blurEffect);
DALI_TEST_CHECK(blurEffect2);
DALI_TEST_CHECK(blurEffect3);
RenderTaskList taskList = scene.GetRenderTaskList();
DALI_TEST_EQUALS(1u, taskList.GetTaskCount(), TEST_LOCATION);
- childControl.SetRenderEffect(BackgroundBlurEffect::New());
+ childControl.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
taskList = scene.GetRenderTaskList();
DALI_TEST_EQUALS(4u, taskList.GetTaskCount(), TEST_LOCATION);
control.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 1.0f));
scene.Add(control);
- BackgroundBlurEffect blurEffect = BackgroundBlurEffect::New();
+ RenderEffect blurEffect = RenderEffect::CreateBackgroundBlurEffect();
control.SetRenderEffect(blurEffect);
RenderTaskList taskList = scene.GetRenderTaskList();
control2.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 1.0f));
scene.Add(control2);
- control2.SetRenderEffect(blurEffect);
+ control2.SetRenderEffect(blurEffect); // Clone effect
taskList = scene.GetRenderTaskList();
- DALI_TEST_EQUALS(4u, taskList.GetTaskCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(7u, taskList.GetTaskCount(), TEST_LOCATION);
END_TEST;
}
scene.Add(control);
uint32_t count = control.GetRendererCount();
- control.SetRenderEffect(BackgroundBlurEffect::New());
+ control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
RenderTaskList taskList = scene.GetRenderTaskList();
DALI_TEST_EQUALS(4u, taskList.GetTaskCount(), TEST_LOCATION);
control.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 1.0f));
scene.Add(control);
- BackgroundBlurEffect blurEffect = BackgroundBlurEffect::New();
+ RenderEffect blurEffect = RenderEffect::CreateBackgroundBlurEffect();
control.SetRenderEffect(blurEffect);
RenderTaskList taskList = scene.GetRenderTaskList();
control.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 1.0f));
scene.Add(control);
- BackgroundBlurEffect blurEffect = BackgroundBlurEffect::New();
+ RenderEffect blurEffect = RenderEffect::CreateBackgroundBlurEffect();
+ control.SetRenderEffect(blurEffect);
control.SetRenderEffect(blurEffect); // Duplicate actions will be ignored
control.SetRenderEffect(blurEffect); // Duplicate actions will be ignored
control.SetRenderEffect(blurEffect); // Duplicate actions will be ignored
Control control = Control::New();
control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
scene.Add(control);
- control.SetRenderEffect(BackgroundBlurEffect::New());
+ control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
application.SendNotification();
application.Render();
blackDimmerMap.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 30.0f);
blackDimmerMap.Insert(Toolkit::DevelVisual::Property::CORNER_SQUARENESS, 0.3f);
- RenderEffect effect = BackgroundBlurEffect::New(0.4f, 40);
+ RenderEffect effect = RenderEffect::CreateBackgroundBlurEffect();
Control control = Control::New();
DALI_TEST_CHECK(control.GetRendererCount() == 0u);
control.SetProperty(Actor::Property::SIZE_WIDTH, maxTextureSize + 1000.0f);
control.SetProperty(Actor::Property::SIZE_HEIGHT, maxTextureSize + 1000.0f);
scene.Add(control);
- control.SetRenderEffect(BackgroundBlurEffect::New(0.4f, 40));
+ control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect(0.4f, 40));
application.SendNotification();
application.Render();
uint32_t count = control.GetRendererCount();
// Add render effect during scene off.
- control.SetRenderEffect(BackgroundBlurEffect::New());
+ control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
RenderTaskList taskList = scene.GetRenderTaskList();
scene.Add(control);
// Add render effect during scene on.
- control.SetRenderEffect(BackgroundBlurEffect::New());
+ control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
RenderTaskList taskList = scene.GetRenderTaskList();
// Add render effect during invisible.
control.SetProperty(Actor::Property::VISIBLE, false);
- control.SetRenderEffect(BackgroundBlurEffect::New());
+ control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
RenderTaskList taskList = scene.GetRenderTaskList();
scene.Add(control);
// Add render effect during scene on.
- control.SetRenderEffect(BackgroundBlurEffect::New());
+ control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
RenderTaskList taskList = scene.GetRenderTaskList();
tet_printf("render task cnt : %d\n", taskList.GetTaskCount());
// Add render effect during scene on.
- control1.SetRenderEffect(BackgroundBlurEffect::New());
+ control1.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
tet_printf("render task cnt after set : %d\n", taskList.GetTaskCount());
DALI_TEST_EQUALS(1, taskList.GetTaskCount(), TEST_LOCATION);
tet_printf("render task cnt : %d\n", taskList.GetTaskCount());
// Add render effect during scene on.
- control2.SetRenderEffect(BackgroundBlurEffect::New());
+ control2.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
tet_printf("render task cnt after set : %d\n", taskList.GetTaskCount());
scene.Add(control);
// Add render effect during scene on.
- control.SetRenderEffect(BackgroundBlurEffect::New());
+ control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
application.SendNotification();
tet_printf("order : %d\n", taskList.GetTask(taskList.GetTaskCount() - 1).GetOrderIndex());
DALI_TEST_EQUALS(INT32_MIN + 2, taskList.GetTask(taskList.GetTaskCount() - 1).GetOrderIndex(), TEST_LOCATION);
- control.SetRenderEffect(BackgroundBlurEffect::New());
+ control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
application.SendNotification();
DALI_TEST_EQUALS(INT32_MIN + 2, taskList.GetTask(taskList.GetTaskCount() - 1).GetOrderIndex(), TEST_LOCATION);
END_TEST;
-}
\ No newline at end of file
+}
#include <dali-toolkit/public-api/styling/style-manager.h>
-#include <dali-toolkit/public-api/controls/render-effects/background-blur-effect.h>
#include <dali-toolkit/public-api/controls/render-effects/render-effect.h>
#include <dali-toolkit/public-api/text/text-enumerations.h>
mCounterClockwiseFocusableActorId(-1),
mStyleName(""),
mBackgroundColor(Color::TRANSPARENT),
+ mRenderEffect(nullptr),
mStartingPinchScale(nullptr),
mMargin(0, 0, 0, 0),
mPadding(0, 0, 0, 0),
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/internal/controls/render-effects/offscreen-rendering-context.h>
+#include <dali-toolkit/internal/controls/render-effects/render-effect-impl.h>
#include <dali-toolkit/internal/controls/tooltip/tooltip.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/render-effects/render-effect.h>
#include <dali/integration-api/debug.h>
#include <map>
#include <memory>
std::string mStyleName;
Vector4 mBackgroundColor; ///< The color of the background visual
- RenderEffect mRenderEffect; ///< The render effect on this control
+ RenderEffectImplPtr mRenderEffect; ///< The render effect on this control
Vector3* mStartingPinchScale; ///< The scale when a pinch gesture starts, TODO: consider removing this
Extents mMargin; ///< The margin values
Extents mPadding; ///< The padding values
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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 handle;
}
+RenderEffectImplPtr BlurEffectImpl::Clone() const
+{
+ BlurEffectImplPtr blurEffectImpl = new BlurEffectImpl(mDownscaleFactor, mPixelRadius, mIsBackground);
+ blurEffectImpl->Initialize();
+ return RenderEffectImplPtr(blurEffectImpl);
+}
+
OffScreenRenderable::Type BlurEffectImpl::GetOffScreenRenderableType()
{
return mSkipBlur ? OffScreenRenderable::NONE : OffScreenRenderable::BACKWARD;
#define DALI_TOOLKIT_INTERNAL_BLUR_EFFECT_H
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/render-effects/render-effect-impl.h>
-#include <dali-toolkit/public-api/controls/render-effects/background-blur-effect.h>
namespace Dali
{
*/
static BlurEffectImplPtr New(float downscaleFactor, uint32_t blurRadius, bool isBackground);
+ /**
+ * @copydoc Toolkit::Intenral::RenderEffectImpl::Clone
+ */
+ RenderEffectImplPtr Clone() const override;
+
/**
* @copydoc Toolkit::Internal::RenderEffectImpl::GetOffScreenRenderableType
*/
bool mIsBackground : 1;
};
} // namespace Internal
-
-inline Toolkit::Internal::BlurEffectImpl& GetImplementation(Toolkit::BackgroundBlurEffect& obj)
-{
- BaseObject& handle = obj.GetBaseObject();
- return static_cast<Toolkit::Internal::BlurEffectImpl&>(handle);
-}
-
-inline const Toolkit::Internal::BlurEffectImpl& GetImplementation(const Toolkit::BackgroundBlurEffect& obj)
-{
- const BaseObject& handle = obj.GetBaseObject();
- return static_cast<const Toolkit::Internal::BlurEffectImpl&>(handle);
-}
-
} // namespace Toolkit
} // namespace Dali
-#ifndef DALI_TOOLKIT_INTERNAL_BACKGROUND_EFFECT_H
-#define DALI_TOOLKIT_INTERNAL_BACKGROUND_EFFECT_H
+#ifndef DALI_TOOLKIT_INTERNAL_RENDER_EFFECT_H
+#define DALI_TOOLKIT_INTERNAL_RENDER_EFFECT_H
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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 IsActivated() const;
+ /**
+ * @brief Clones current instance.
+ * @return Clone implementation
+ */
+ virtual RenderEffectImplPtr Clone() const = 0;
+
/**
* @brief Retrieves OffScreenRenderableType of this RenderEffect.
*
} // namespace Toolkit
} // namespace Dali
-#endif // DALI_TOOLKIT_INTERNAL_BACKGROUND_EFFECT_H
+#endif // DALI_TOOLKIT_INTERNAL_RENDER_EFFECT_H
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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 Control::SetRenderEffect(Toolkit::RenderEffect effect)
{
- if(mImpl->mRenderEffect != effect)
+ if(effect)
{
+ Internal::RenderEffectImpl* object = dynamic_cast<Internal::RenderEffectImpl*>(effect.GetObjectPtr());
+ DALI_ASSERT_ALWAYS(object && "Not a valid RenderEffect set.");
+
ClearRenderEffect();
- mImpl->mRenderEffect = effect;
- if(effect)
- {
- Toolkit::Internal::RenderEffectImpl* object = dynamic_cast<Toolkit::Internal::RenderEffectImpl*>(mImpl->mRenderEffect.GetObjectPtr());
- DALI_ASSERT_ALWAYS(object && "Not a valid RenderEffect set.");
+ RenderEffectImplPtr clone = object->Clone();
- SetOffScreenRenderableType(object->GetOffScreenRenderableType());
+ SetOffScreenRenderableType(clone->GetOffScreenRenderableType());
- Dali::Toolkit::Control ownerControl(GetOwner());
- object->SetOwnerControl(ownerControl);
- }
+ Dali::Toolkit::Control ownerControl(GetOwner());
+ clone->SetOwnerControl(ownerControl);
+
+ mImpl->mRenderEffect = clone;
+ }
+ else
+ {
+ mImpl->mRenderEffect.Reset();
}
}
+RenderEffect Control::GetRenderEffect() const
+{
+ return RenderEffect(mImpl->mRenderEffect.Get());
+}
+
void Control::ClearRenderEffect()
{
if(mImpl->mRenderEffect)
{
- Toolkit::Internal::RenderEffectImpl* object = dynamic_cast<Toolkit::Internal::RenderEffectImpl*>(mImpl->mRenderEffect.GetObjectPtr());
-
- if(object)
- {
- object->ClearOwnerControl();
- }
+ mImpl->mRenderEffect.Get()->ClearOwnerControl();
mImpl->mRenderEffect.Reset();
}
SetOffScreenRenderableType(OffScreenRenderable::NONE);
{
if(mImpl->mRenderEffect)
{
- Toolkit::Internal::RenderEffectImpl* object = dynamic_cast<Toolkit::Internal::RenderEffectImpl*>(mImpl->mRenderEffect.GetObjectPtr());
-
- if(object)
- {
- object->GetOffScreenRenderTasks(tasks, isForward);
- }
+ mImpl->mRenderEffect->GetOffScreenRenderTasks(tasks, isForward);
}
}
#define DALI_TOOLKIT_CONTROL_IMPL_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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 SetRenderEffect(Toolkit::RenderEffect effect);
+ /**
+ * @copydoc Dali::Toolkit::Control::GetRenderEffect
+ */
+ RenderEffect GetRenderEffect() const;
+
/**
* @copydoc Dali::Toolkit::Control::ClearRenderEffect
*/
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
Internal::GetImplementation(*this).SetRenderEffect(effect);
}
+Toolkit::RenderEffect Control::GetRenderEffect() const
+{
+ return Internal::GetImplementation(*this).GetRenderEffect();
+}
+
void Control::ClearRenderEffect()
{
Internal::GetImplementation(*this).ClearRenderEffect();
#define DALI_TOOLKIT_CONTROL_H
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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 SetRenderEffect(Toolkit::RenderEffect effect);
+ /*
+ * @brief Retrieves control's render effect
+ * @SINCE_2_4.1
+ * @return RenderEffect set on this control
+ */
+ Toolkit::RenderEffect GetRenderEffect() const;
+
/**
* @brief Clears RenderEffect of this control, if exists.
* @SINCE_2_3.25
+++ /dev/null
-/*
- * 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.
- * 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.
- *
- */
-
-// CLASS HEADER
-#include <dali-toolkit/public-api/controls/render-effects/background-blur-effect.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/render-effects/blur-effect-impl.h>
-
-namespace Dali
-{
-namespace Toolkit
-{
-BackgroundBlurEffect::BackgroundBlurEffect() = default;
-
-BackgroundBlurEffect::BackgroundBlurEffect(const BackgroundBlurEffect& handle)
-: RenderEffect(handle)
-{
-}
-
-BackgroundBlurEffect::BackgroundBlurEffect(Internal::BlurEffectImpl* blurEffectImpl)
-: RenderEffect(blurEffectImpl)
-{
-}
-
-BackgroundBlurEffect::~BackgroundBlurEffect() = default;
-
-BackgroundBlurEffect BackgroundBlurEffect::New()
-{
- Internal::BlurEffectImplPtr internal = Internal::BlurEffectImpl::New(true);
- return BackgroundBlurEffect(internal.Get());
-}
-
-BackgroundBlurEffect BackgroundBlurEffect::New(float downscaleFactor, uint32_t blurRadius)
-{
- Internal::BlurEffectImplPtr internal = Internal::BlurEffectImpl::New(downscaleFactor, blurRadius, true);
- return BackgroundBlurEffect(internal.Get());
-}
-
-} // namespace Toolkit
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_TOOLKIT_BACKGROUND_BLUR_EFFECT_H
-#define DALI_TOOLKIT_BACKGROUND_BLUR_EFFECT_H
-
-/*
- * 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.
- * 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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/render-effects/render-effect.h>
-
-namespace Dali
-{
-namespace Toolkit
-{
-namespace Internal DALI_INTERNAL
-{
-class BlurEffectImpl;
-} // namespace DALI_INTERNAL
-
-/**
- * @brief BackgroundBlurEffect is a visual effect that blurs owner control's background.
- * This class is a concrete class from RenderEffect interface.
- * Add this effect to a control, clear manually to deactivate.
- *
- * Toolkit::Control control = Toolkit::Control::New();
- * parent.Add(control);
- * control.SetRenderEffect(BackgroundBlurEffect::New()); // Activate
- * ...
- * control.ClearRenderEffect(); // Deactivate
- *
- * Note that tree hierarchy matters for BackgroundBlurEffect. You should determine "what is the background".
- * Add() should preceed SetRenderEffect(), and the effect cannot have multiple owner controls.
- *
- * @SINCE_2_3.28
- */
-class DALI_TOOLKIT_API BackgroundBlurEffect : public RenderEffect
-{
-public:
- /**
- * @brief Creates an initialized BackgroundBlurEffect, using default settings. The default settings are:
- *
- * downscaleFactor = 0.4f
- * pixelRadius = 5u
- *
- * @SINCE_2_3.28
- * @return A handle to a newly allocated Dali resource
- */
- static BackgroundBlurEffect New();
-
- /**
- * @brief Creates an initialized BackgroundBlurEffect.
- * @param[in] downscaleFactor This value should reside in the range [0.0, 1.0].
- * @param[in] blurRadius The radius of Gaussian kernel.
- * @SINCE_2_3.28
- * @return A handle to a newly allocated Dali resource
- */
- static BackgroundBlurEffect New(float downscaleFactor, uint32_t blurRadius);
-
- /**
- * @brief Creates an uninitialized blur effect.
- * @SINCE_2_3.28
- */
- BackgroundBlurEffect();
-
- /**
- * @brief Copy constructor.
- * @SINCE_2_3.28
- */
- BackgroundBlurEffect(const BackgroundBlurEffect& handle);
-
- /**
- * @brief Destructor
- * @SINCE_2_3.28
- */
- ~BackgroundBlurEffect();
-
-public: // Not intended for use by Application developers
- ///@cond internal
- /**
- * @brief Creates a handle using the Toolkit::Internal implementation.
- * @SINCE_2_3.28
- * @param[in] blurEffectImpl The UI Control implementation.
- */
- explicit DALI_INTERNAL BackgroundBlurEffect(Internal::BlurEffectImpl* blurEffectImpl);
- ///@endcond
-};
-
-} // namespace Toolkit
-} // namespace Dali
-
-#endif //DALI_TOOLKIT_BACKGROUND_BLUR_EFFECT_H
#include <dali-toolkit/public-api/controls/render-effects/render-effect.h>
// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/render-effects/blur-effect-impl.h>
#include <dali-toolkit/internal/controls/render-effects/render-effect-impl.h>
namespace Dali
{
}
-RenderEffect::~RenderEffect() = default;
+RenderEffect RenderEffect::CreateBackgroundBlurEffect()
+{
+ Internal::BlurEffectImplPtr internal = Internal::BlurEffectImpl::New(true);
+ return RenderEffect(internal.Get());
+}
+
+RenderEffect RenderEffect::CreateBackgroundBlurEffect(float downscaleFactor, uint32_t blurRadius)
+{
+ Internal::BlurEffectImplPtr internal = Internal::BlurEffectImpl::New(downscaleFactor, blurRadius, true);
+ return RenderEffect(internal.Get());
+}
} // namespace Toolkit
} // namespace Dali
// EXTERNAL INCLUDES
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/render-tasks/render-task.h>
+#include <memory> // std::shared_ptr
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
{
class Control;
class RenderEffectImpl;
-} // namespace Internal DALI_INTERNAL
+} // namespace DALI_INTERNAL
/**
* @brief
*/
RenderEffect() = default;
+ /**
+ * @brief Destructor.
+ * This is non-virtual since derived Handle types must not contain data or virtual methods.
+ * @SINCE_2_3.28
+ */
+ ~RenderEffect() = default;
+
/**
* @brief Copy constructor. Creates another handle that points to the same real object.
* @SINCE_2_3.28
RenderEffect(const RenderEffect& handle);
/**
- * @brief Destructor.
- * This is non-virtual since derived Handle types must not contain data or virtual methods.
- * @SINCE_2_3.28
+ * @brief Creates background blur effect with default parameters.
+ * @SINCE_2_4.1
+ */
+ static RenderEffect CreateBackgroundBlurEffect();
+
+ /**
+ * @brief Creates background blur effect.
+ * @param[in] downscaleFactor Input texture downscaler for better performance.
+ * @param[in] blurRadius Gaussian kernel size.
+ * @SINCE_2_4.1
*/
- ~RenderEffect();
+ static RenderEffect CreateBackgroundBlurEffect(float downscaleFactor, uint32_t blurRadius);
public: // Not intended for Application developers
///@cond internal
${public_api_src_dir}/controls/model3d-view/model3d-view.cpp
${public_api_src_dir}/controls/progress-bar/progress-bar.cpp
${public_api_src_dir}/controls/render-effects/render-effect.cpp
- ${public_api_src_dir}/controls/render-effects/background-blur-effect.cpp
${public_api_src_dir}/controls/scrollable/item-view/default-item-layout.cpp
${public_api_src_dir}/controls/scrollable/item-view/item-layout.cpp
${public_api_src_dir}/controls/scrollable/item-view/item-view.cpp
SET( public_api_render_effects_header_files
${public_api_src_dir}/controls/render-effects/render-effect.h
- ${public_api_src_dir}/controls/render-effects/background-blur-effect.h
)
SET( public_api_scrollable_header_files