Refactor RenderEffect 89/317289/6
authorjmm <j0064423.lee@samsung.com>
Mon, 30 Dec 2024 05:40:12 +0000 (14:40 +0900)
committerjmm <j0064423.lee@samsung.com>
Thu, 2 Jan 2025 11:10:57 +0000 (20:10 +0900)
Change-Id: I96c8cfe681aba1c4f76310202d1023e554a8216f
Signed-off-by: jmm <j0064423.lee@samsung.com>
19 files changed:
automated-tests/src/dali-scene3d/utc-Dali-Panel.cpp
automated-tests/src/dali-scene3d/utc-Dali-SceneView.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-RenderEffect-internal.cpp
automated-tests/src/dali-toolkit/utc-Dali-RenderEffect.cpp
dali-toolkit/dali-toolkit.h
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h
dali-toolkit/internal/controls/render-effects/blur-effect-impl.cpp
dali-toolkit/internal/controls/render-effects/blur-effect-impl.h
dali-toolkit/internal/controls/render-effects/render-effect-impl.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
dali-toolkit/public-api/controls/control.cpp
dali-toolkit/public-api/controls/control.h
dali-toolkit/public-api/controls/render-effects/background-blur-effect.cpp [deleted file]
dali-toolkit/public-api/controls/render-effects/background-blur-effect.h [deleted file]
dali-toolkit/public-api/controls/render-effects/render-effect.cpp
dali-toolkit/public-api/controls/render-effects/render-effect.h
dali-toolkit/public-api/file.list

index f7b035cefdb2ebef4492c1f0009ba180ed0825ca..17da66658efa33206c6e2a32724bd77bce0a74ae 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -199,13 +199,12 @@ int UtcDaliPanelSetPanelResolution02(void)
 
 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
@@ -237,10 +236,10 @@ void        OnResourceReady(Control control)
 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)
     {
@@ -266,10 +265,10 @@ Dali::Scene3D::ModelNode GetContentPlaneNode(Dali::Scene3D::Panel panel)
 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)
     {
@@ -295,10 +294,10 @@ Dali::Scene3D::ModelNode GetBackPlaneNode(Dali::Scene3D::Panel panel)
 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)
     {
@@ -364,7 +363,7 @@ Dali::Texture GetSpecularTexture(Dali::Scene3D::Panel panel)
 
   return texture;
 }
-}
+} // namespace
 
 int UtcDaliPanelIBLWithSceneView(void)
 {
@@ -459,7 +458,7 @@ int UtcDaliPanelSetGetProperty(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);
@@ -468,18 +467,17 @@ int UtcDaliPanelSetGetProperty(void)
   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);
@@ -488,14 +486,13 @@ int UtcDaliPanelSetGetProperty(void)
   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);
@@ -508,14 +505,13 @@ int UtcDaliPanelSetGetProperty(void)
   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);
@@ -528,14 +524,13 @@ int UtcDaliPanelSetGetProperty(void)
   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);
@@ -548,14 +543,13 @@ int UtcDaliPanelSetGetProperty(void)
   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);
@@ -568,14 +562,13 @@ int UtcDaliPanelSetGetProperty(void)
   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);
@@ -588,14 +581,13 @@ int UtcDaliPanelSetGetProperty(void)
   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);
@@ -608,14 +600,13 @@ int UtcDaliPanelSetGetProperty(void)
   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);
@@ -666,7 +657,7 @@ int UtcDaliPanelSetGetContent(void)
 
   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)
     {
@@ -700,7 +691,7 @@ int UtcDaliPanelSetGetContent(void)
 
   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)
     {
@@ -753,10 +744,10 @@ int UtcDaliPanelRenderTaskOrdering(void)
   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);
 
@@ -764,30 +755,30 @@ int UtcDaliPanelRenderTaskOrdering(void)
   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);
 
index 37090fcd3d253f8fa979f90f935376428d4efa0f..5c51751acfc459d70c35767f2988b861f36effcf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -54,7 +54,7 @@ const char* TEST_GLTF_FILE_NAME = TEST_RESOURCE_DIR "/AnimatedCube.gltf";
  * 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
@@ -1671,7 +1671,7 @@ int UtcDaliSceneViewRenderTaskOrdering(void)
   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);
 
index d468ac765e0e3cfbfadc0abaecf66f7813c756e8..bfa78dfb31476d380929287862866e84eebfef86 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -62,13 +62,19 @@ public:
     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()
@@ -148,11 +154,12 @@ int UtcDaliInternalRenderEffectGetOwnerControl01(void)
   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;
 
@@ -166,33 +173,50 @@ int UtcDaliInternalRenderEffectGetOwnerControl01(void)
     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);
@@ -202,20 +226,22 @@ int UtcDaliInternalRenderEffectGetOwnerControl01(void)
     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;
 }
 
@@ -240,52 +266,73 @@ int UtcDaliInternalRenderEffectGetOwnerControl02(void)
   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;
 }
index d84bedd4e06c56425daa7b8f5132845816229da0..98154a8874fd17b9c3b2d5042f2908c195fb3156 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -17,7 +17,7 @@
 
 #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;
@@ -28,10 +28,10 @@ int UtcDaliRenderEffectNewP(void)
   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;
@@ -44,10 +44,11 @@ int UtcDaliRenderEffectNewN(void)
 
   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);
@@ -76,7 +77,7 @@ int UtcDaliRenderEffectActivateP01(void)
   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);
@@ -96,7 +97,7 @@ int UtcDaliRenderEffectActivateP02(void)
   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();
@@ -107,9 +108,9 @@ int UtcDaliRenderEffectActivateP02(void)
   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;
 }
@@ -127,7 +128,7 @@ int UtcDaliRenderEffectDeactivateP(void)
   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);
@@ -173,7 +174,7 @@ int UtcDaliRenderEffectActivateDeactivateInplace(void)
   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();
@@ -200,7 +201,8 @@ int UtcDaliRenderEffectReassign(void)
   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
@@ -219,7 +221,7 @@ int UtcDaliRenderEffectResize(void)
   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();
@@ -249,7 +251,7 @@ int UtcDaliRenderEffectSynchronizeBackgroundCornerRadius(void)
   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);
@@ -299,7 +301,7 @@ int UtcDaliRenderEffectInvalidTargetSize(void)
   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();
@@ -329,7 +331,7 @@ int UtcDaliRenderEffectControlSceneOnAndSceneOff01(void)
   uint32_t count = control.GetRendererCount();
 
   // Add render effect during scene off.
-  control.SetRenderEffect(BackgroundBlurEffect::New());
+  control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
 
   RenderTaskList taskList = scene.GetRenderTaskList();
 
@@ -384,7 +386,7 @@ int UtcDaliRenderEffectControlSceneOnAndSceneOff02(void)
   scene.Add(control);
 
   // Add render effect during scene on.
-  control.SetRenderEffect(BackgroundBlurEffect::New());
+  control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
 
   RenderTaskList taskList = scene.GetRenderTaskList();
 
@@ -435,7 +437,7 @@ int UtcDaliRenderEffectControlVisiblityChanged01(void)
 
   // Add render effect during invisible.
   control.SetProperty(Actor::Property::VISIBLE, false);
-  control.SetRenderEffect(BackgroundBlurEffect::New());
+  control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
 
   RenderTaskList taskList = scene.GetRenderTaskList();
 
@@ -500,7 +502,7 @@ int UtcDaliRenderEffectControlVisiblityChanged02(void)
   scene.Add(control);
 
   // Add render effect during scene on.
-  control.SetRenderEffect(BackgroundBlurEffect::New());
+  control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
 
   RenderTaskList taskList = scene.GetRenderTaskList();
 
@@ -550,7 +552,7 @@ int UtcDaliRenderEffectRenderTaskOrdering(void)
   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);
@@ -589,7 +591,7 @@ int UtcDaliRenderEffectRenderTaskOrdering(void)
   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());
 
@@ -790,7 +792,7 @@ int UtcDaliRenderEffectReInitialize(void)
   scene.Add(control);
 
   // Add render effect during scene on.
-  control.SetRenderEffect(BackgroundBlurEffect::New());
+  control.SetRenderEffect(RenderEffect::CreateBackgroundBlurEffect());
 
   application.SendNotification();
 
@@ -801,7 +803,7 @@ int UtcDaliRenderEffectReInitialize(void)
   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();
 
@@ -811,4 +813,4 @@ int UtcDaliRenderEffectReInitialize(void)
   DALI_TEST_EQUALS(INT32_MIN + 2, taskList.GetTask(taskList.GetTaskCount() - 1).GetOrderIndex(), TEST_LOCATION);
 
   END_TEST;
-}
\ No newline at end of file
+}
index f80d0ac93d786d8f0ab37420746d1690c690dc6c..d848256c177991efd0e8993d8f09272b87a85c1b 100644 (file)
@@ -61,7 +61,6 @@
 
 #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>
index 480d834ed6c2921ed3ec8aaf057f84ecd1bb03ff..326f90ea8a15379f11da4805598be6b409a9b511 100644 (file)
@@ -390,6 +390,7 @@ Control::Impl::Impl(Control& controlImpl)
   mCounterClockwiseFocusableActorId(-1),
   mStyleName(""),
   mBackgroundColor(Color::TRANSPARENT),
+  mRenderEffect(nullptr),
   mStartingPinchScale(nullptr),
   mMargin(0, 0, 0, 0),
   mPadding(0, 0, 0, 0),
index 202e3e4caeaa52253b27a883faabdea8e23be372..8248a5cd3df0705ca1e730ca70e082cb2985b0b9 100644 (file)
@@ -28,9 +28,9 @@
 // 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>
@@ -479,7 +479,7 @@ public:
 
   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
index 7e3cabc26f8ab4a9e92d60d2fc0d35b3038c8a04..b7ea03f201be7530c456ba350351b60bfce95cc8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -142,6 +142,13 @@ BlurEffectImplPtr BlurEffectImpl::New(float downscaleFactor, uint32_t blurRadius
   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;
index 647e4b2892aba1edbdb19a6b03fc3b9f5e20b59e..e24f3521765f145ecb9c5e9a79650265bb378d32 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -30,7 +30,6 @@
 
 // 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
 {
@@ -69,6 +68,11 @@ public:
    */
   static BlurEffectImplPtr New(float downscaleFactor, uint32_t blurRadius, bool isBackground);
 
+  /**
+   * @copydoc Toolkit::Intenral::RenderEffectImpl::Clone
+   */
+  RenderEffectImplPtr Clone() const override;
+
   /**
    * @copydoc Toolkit::Internal::RenderEffectImpl::GetOffScreenRenderableType
    */
@@ -206,19 +210,6 @@ private:
   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
 
index d7656bdb578774d1abdd9c3fb758d0d9334628fb..07e805544e7338825ee9bf6fb464a4976a733bb9 100644 (file)
@@ -1,8 +1,8 @@
-#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.
@@ -60,6 +60,12 @@ public:
    */
   bool IsActivated() const;
 
+  /**
+   * @brief Clones current instance.
+   * @return Clone implementation
+   */
+  virtual RenderEffectImplPtr Clone() const = 0;
+
   /**
    * @brief Retrieves OffScreenRenderableType of this RenderEffect.
    *
@@ -197,4 +203,4 @@ inline const Toolkit::Internal::RenderEffectImpl& GetImplementation(const Toolki
 
 } // namespace Toolkit
 } // namespace Dali
-#endif // DALI_TOOLKIT_INTERNAL_BACKGROUND_EFFECT_H
+#endif // DALI_TOOLKIT_INTERNAL_RENDER_EFFECT_H
index 827a3955ba14630a4b78d1250b57a1017882703e..5cce72d5b8e1e6988013467305fd97320845e6a6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -170,34 +170,38 @@ void Control::ClearBackground()
 
 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);
@@ -653,12 +657,7 @@ void Control::GetOffScreenRenderTasks(std::vector<Dali::RenderTask>& tasks, bool
 {
   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);
   }
 }
 
index 616aa4897d5267bcf76cf7f0f75d34e572fd06c6..13a3490e6b762106c291d9f12f31372cfedd122c 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -119,6 +119,11 @@ public:
    */
   void SetRenderEffect(Toolkit::RenderEffect effect);
 
+  /**
+   * @copydoc Dali::Toolkit::Control::GetRenderEffect
+   */
+  RenderEffect GetRenderEffect() const;
+
   /**
    * @copydoc Dali::Toolkit::Control::ClearRenderEffect
    */
index c163378933b25b570d661c413f7fcf6169277546..0efe3e726b07dbaab6308e804a340ae894be59c4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -120,6 +120,11 @@ void Control::SetRenderEffect(Toolkit::RenderEffect effect)
   Internal::GetImplementation(*this).SetRenderEffect(effect);
 }
 
+Toolkit::RenderEffect Control::GetRenderEffect() const
+{
+  return Internal::GetImplementation(*this).GetRenderEffect();
+}
+
 void Control::ClearRenderEffect()
 {
   Internal::GetImplementation(*this).ClearRenderEffect();
index 7da13e86bf0caeee9ba2480e17f61a7a4f088745..9fa0b7ee7f86db7c11138aee50a1f19bdb2acc52 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -392,6 +392,13 @@ public:
    */
   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
diff --git a/dali-toolkit/public-api/controls/render-effects/background-blur-effect.cpp b/dali-toolkit/public-api/controls/render-effects/background-blur-effect.cpp
deleted file mode 100644 (file)
index f02f276..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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
diff --git a/dali-toolkit/public-api/controls/render-effects/background-blur-effect.h b/dali-toolkit/public-api/controls/render-effects/background-blur-effect.h
deleted file mode 100644 (file)
index 414d4fa..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-#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
index 9964e13370ec01e5cc48a1cf35e3cb48a42c4dec..fddf530006ea6b01864e09763d4a0aa012156dc0 100644 (file)
@@ -19,6 +19,7 @@
 #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
@@ -35,6 +36,16 @@ RenderEffect::RenderEffect(Internal::RenderEffectImpl* renderEffectImpl)
 {
 }
 
-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
index 085fa88cdbf81b01a91b0e0bfc233867be67642b..cce28774516dcada7668f066552bd95e7c81d885 100644 (file)
@@ -21,6 +21,7 @@
 // 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>
@@ -34,7 +35,7 @@ namespace Internal DALI_INTERNAL
 {
 class Control;
 class RenderEffectImpl;
-} // namespace Internal DALI_INTERNAL
+} // namespace DALI_INTERNAL
 
 /**
  * @brief
@@ -57,6 +58,13 @@ public:
    */
   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
@@ -64,11 +72,18 @@ public:
   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
index 951ad525f5cc2f45dcb06ad162a8539912f967b2..4e0acdd53800da9ca9a8bd13acf92cc8ca631719 100644 (file)
@@ -15,7 +15,6 @@ SET( public_api_src_files
   ${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
@@ -108,7 +107,6 @@ SET( public_api_progress_bar_header_files
 
 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