Merge branch 'devel/master' into tizen
authorWoochan Lee <wc0917.lee@samsung.com>
Tue, 28 Mar 2023 05:33:40 +0000 (14:33 +0900)
committerWoochan Lee <wc0917.lee@samsung.com>
Tue, 28 Mar 2023 05:33:40 +0000 (14:33 +0900)
48 files changed:
automated-tests/src/dali/utc-Dali-PixelData.cpp
automated-tests/src/dali/utc-Dali-Renderer.cpp
automated-tests/src/dali/utc-Dali-Texture.cpp
dali/devel-api/common/stage.cpp
dali/devel-api/common/stage.h
dali/devel-api/file.list
dali/graphics-api/graphics-types.h
dali/integration-api/file.list
dali/integration-api/pixel-data-integ.cpp [moved from dali/devel-api/images/pixel-data-devel.cpp with 58% similarity]
dali/integration-api/pixel-data-integ.h [moved from dali/devel-api/images/pixel-data-devel.h with 60% similarity]
dali/internal/common/image-attributes.cpp
dali/internal/common/image-attributes.h
dali/internal/common/owner-pointer.h
dali/internal/common/shader-data.h
dali/internal/event/events/actor-observer.cpp
dali/internal/event/events/actor-observer.h
dali/internal/event/images/pixel-data-impl.cpp
dali/internal/event/images/pixel-data-impl.h
dali/internal/file.list
dali/internal/render/common/render-manager.cpp
dali/internal/render/common/render-manager.h
dali/internal/render/renderers/render-renderer.cpp
dali/internal/render/renderers/render-texture.cpp
dali/internal/update/common/double-buffered.h
dali/internal/update/common/property-owner.h
dali/internal/update/common/renderer-resetter.h [new file with mode: 0644]
dali/internal/update/common/resetter-manager.h [new file with mode: 0644]
dali/internal/update/controllers/render-message-dispatcher.cpp
dali/internal/update/controllers/render-message-dispatcher.h
dali/internal/update/manager/render-instruction-processor.cpp
dali/internal/update/manager/update-manager.cpp
dali/internal/update/manager/update-manager.h
dali/internal/update/nodes/node.cpp
dali/internal/update/nodes/node.h
dali/internal/update/render-tasks/scene-graph-camera.cpp
dali/internal/update/render-tasks/scene-graph-camera.h
dali/internal/update/render-tasks/scene-graph-render-task-list.cpp
dali/internal/update/render-tasks/scene-graph-render-task-list.h
dali/internal/update/render-tasks/scene-graph-render-task.cpp
dali/internal/update/render-tasks/scene-graph-render-task.h
dali/internal/update/rendering/scene-graph-renderer.cpp
dali/internal/update/rendering/scene-graph-renderer.h
dali/internal/update/rendering/scene-graph-texture-set.cpp
dali/internal/update/rendering/scene-graph-texture-set.h
dali/internal/update/rendering/scene-graph-visual-renderer.cpp [new file with mode: 0644]
dali/internal/update/rendering/scene-graph-visual-renderer.h
dali/public-api/dali-core-version.cpp
packaging/dali.spec

index bf80314..5454954 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -20,6 +20,8 @@
 #include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/images/pixel.h>
 
+#include <dali/integration-api/pixel-data-integ.h>
+
 #include <cstdlib>
 
 using namespace Dali;
@@ -236,3 +238,64 @@ int UtcDaliPixelDataGetHeightNegative(void)
   }
   END_TEST;
 }
+
+int UtcDaliPixelDataReleasePixelDataBuffer(void)
+{
+  TestApplication application;
+
+  uint32_t width      = 10u;
+  uint32_t height     = 10u;
+  uint32_t stride     = 12u;
+  uint32_t bufferSize = stride * height * Pixel::GetBytesPerPixel(Pixel::L8);
+  uint8_t* buffer     = new uint8_t[bufferSize];
+  buffer[0]           = 'a';
+
+  PixelData pixelData = PixelData::New(buffer, bufferSize, width, height, stride, Pixel::L8, PixelData::DELETE_ARRAY);
+
+  DALI_TEST_CHECK(pixelData);
+  DALI_TEST_CHECK(pixelData.GetWidth() == width);
+  DALI_TEST_CHECK(pixelData.GetHeight() == height);
+  DALI_TEST_CHECK(pixelData.GetStride() == stride);
+  DALI_TEST_CHECK(pixelData.GetPixelFormat() == Pixel::L8);
+
+  Dali::Integration::PixelDataBuffer pixelDataBuffer = Dali::Integration::ReleasePixelDataBuffer(pixelData);
+
+  DALI_TEST_CHECK(!pixelData);
+
+  DALI_TEST_EQUALS(pixelDataBuffer.bufferSize, bufferSize, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelDataBuffer.buffer[0], static_cast<uint8_t>('a'), TEST_LOCATION);
+
+  // Release memory by our self.
+  delete[] pixelDataBuffer.buffer;
+
+  END_TEST;
+}
+
+int UtcDaliPixelDataGetPixelDataBuffer(void)
+{
+  TestApplication application;
+
+  uint32_t width      = 10u;
+  uint32_t height     = 10u;
+  uint32_t stride     = 12u;
+  uint32_t bufferSize = stride * height * Pixel::GetBytesPerPixel(Pixel::L8);
+  uint8_t* buffer     = new uint8_t[bufferSize];
+  buffer[0]           = 'a';
+
+  PixelData pixelData = PixelData::New(buffer, bufferSize, width, height, stride, Pixel::L8, PixelData::DELETE_ARRAY);
+
+  DALI_TEST_CHECK(pixelData);
+  DALI_TEST_CHECK(pixelData.GetWidth() == width);
+  DALI_TEST_CHECK(pixelData.GetHeight() == height);
+  DALI_TEST_CHECK(pixelData.GetStride() == stride);
+  DALI_TEST_CHECK(pixelData.GetPixelFormat() == Pixel::L8);
+
+  Dali::Integration::PixelDataBuffer pixelDataBuffer = Dali::Integration::GetPixelDataBuffer(pixelData);
+
+  DALI_TEST_CHECK(pixelData);
+
+  DALI_TEST_EQUALS(pixelDataBuffer.bufferSize, bufferSize, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelDataBuffer.buffer[0], static_cast<uint8_t>('a'), TEST_LOCATION);
+
+  END_TEST;
+}
index 763fa67..b99feb0 100644 (file)
@@ -4255,3 +4255,56 @@ int utcDaliRendererPartialUpdateAddRemoveRenderer(void)
 
   END_TEST;
 }
+
+int utcDaliRendererDoNotSkipRenderIfTextureSetChanged(void)
+{
+  TestApplication application;
+  tet_infoline("Check to not skip rendering in case of the TextureSet Changed");
+
+  TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
+  drawTrace.Enable(true);
+  drawTrace.Reset();
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::SIZE, Vector3(80.0f, 80.0f, 0.0f));
+  application.GetScene().Add(actor);
+
+  // Make any animation to skip rendering.
+  // Delay duration must be bigger than 0.0f
+  Animation animation = Animation::New(2.0f);
+  animation.AnimateTo(Property(actor, Actor::Property::POSITION_X), 1.0f, TimePeriod(1.0f, 1.0f));
+  animation.Play();
+
+  DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+  Renderer renderer = actor.GetRendererAt(0u);
+
+  Texture    image      = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGB888, 64, 64);
+  TextureSet textureSet = CreateTextureSet(image);
+
+  // Render at least 2 frames
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+  application.Render();
+
+  drawTrace.Reset();
+
+  application.SendNotification();
+  application.Render();
+
+  // Skip rendering
+  DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION);
+
+  // Change TextureSet
+  renderer.SetTextures(textureSet);
+
+  application.SendNotification();
+  application.Render(16u);
+
+  // Should not Skip rendering!
+  DALI_TEST_GREATER(drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION);
+
+  END_TEST;
+}
\ No newline at end of file
index 36ae1d3..3b63aa5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -16,7 +16,6 @@
  */
 
 #include <dali-test-suite-utils.h>
-#include <dali/devel-api/images/pixel-data-devel.h>
 #include <dali/devel-api/rendering/texture-devel.h>
 #include <dali/public-api/dali-core.h>
 #include <test-native-image.h>
index f554064..02f361f 100644 (file)
@@ -38,9 +38,9 @@ Stage::Stage(const Stage& handle) = default;
 
 Stage& Stage::operator=(const Stage& rhs) = default;
 
-Stage::Stage(Stage&& handle) = default;
+Stage::Stage(Stage&& handle) noexcept = default;
 
-Stage& Stage::operator=(Stage&& rhs) = default;
+Stage& Stage::operator=(Stage&& rhs) noexcept = default;
 
 Stage::Stage(Internal::Stage* internal)
 : BaseHandle(internal)
index 86d17c4..cf271cf 100644 (file)
@@ -140,7 +140,7 @@ public:
    *
    * @param[in] handle A reference to the moved handle
    */
-  Stage(Stage&& handle);
+  Stage(Stage&& handle) noexcept;
 
   /**
    * @brief This move assignment operator is required for (smart) pointer semantics.
@@ -148,7 +148,7 @@ public:
    * @param[in] rhs A reference to the moved handle
    * @return A reference to this
    */
-  Stage& operator=(Stage&& rhs);
+  Stage& operator=(Stage&& rhs) noexcept;
 
   // Containment
 
index ab12aaf..a4947e6 100644 (file)
@@ -28,7 +28,6 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/events/touch-point.cpp
   ${devel_api_src_dir}/events/wheel-event-devel.cpp
   ${devel_api_src_dir}/images/distance-field.cpp
-  ${devel_api_src_dir}/images/pixel-data-devel.cpp
   ${devel_api_src_dir}/object/handle-devel.cpp
   ${devel_api_src_dir}/object/csharp-type-registry.cpp
   ${devel_api_src_dir}/rendering/frame-buffer-devel.cpp
@@ -99,7 +98,6 @@ SET( devel_api_core_events_header_files
 
 SET( devel_api_core_images_header_files
   ${devel_api_src_dir}/images/distance-field.h
-  ${devel_api_src_dir}/images/pixel-data-devel.h
 )
 
 
index e75e449..3d0f0f5 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_TYPES
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -24,6 +24,7 @@
 #include <utility>
 #include <vector>
 
+#include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/signals/callback.h>
 
 namespace Dali
@@ -961,6 +962,7 @@ struct TextureUpdateSourceInfo
   {
     BUFFER,
     MEMORY,
+    PIXEL_DATA,
     TEXTURE
   };
 
@@ -976,6 +978,11 @@ struct TextureUpdateSourceInfo
     void* memory;
   } memorySource;
 
+  struct PixelDataSource
+  {
+    Dali::PixelData pixelData;
+  } pixelDataSource;
+
   struct TextureSource
   {
     Texture* texture;
index 3de0f98..3e4f3d1 100644 (file)
@@ -7,46 +7,50 @@ SET( platform_abstraction_src_files
    ${platform_abstraction_src_dir}/bitmap.cpp
    ${platform_abstraction_src_dir}/core.cpp
    ${platform_abstraction_src_dir}/debug.cpp
-   ${platform_abstraction_src_dir}/trace.cpp
-   ${platform_abstraction_src_dir}/profiling.cpp
    ${platform_abstraction_src_dir}/input-options.cpp
    ${platform_abstraction_src_dir}/lockless-buffer.cpp
+   ${platform_abstraction_src_dir}/pixel-data-integ.cpp
+   ${platform_abstraction_src_dir}/profiling.cpp
    ${platform_abstraction_src_dir}/render-task-list-integ.cpp
    ${platform_abstraction_src_dir}/scene.cpp
+   ${platform_abstraction_src_dir}/trace.cpp
+)
+
+SET( platform_abstraction_events_src_files
    ${platform_abstraction_src_dir}/events/event.cpp
    ${platform_abstraction_src_dir}/events/hover-event-integ.cpp
    ${platform_abstraction_src_dir}/events/key-event-integ.cpp
-   ${platform_abstraction_src_dir}/events/wheel-event-integ.cpp
    ${platform_abstraction_src_dir}/events/multi-point-event-integ.cpp
    ${platform_abstraction_src_dir}/events/point.cpp
-   ${platform_abstraction_src_dir}/events/touch-event-integ.cpp
    ${platform_abstraction_src_dir}/events/touch-event-combiner.cpp
+   ${platform_abstraction_src_dir}/events/touch-event-integ.cpp
    ${platform_abstraction_src_dir}/events/touch-integ.cpp
+   ${platform_abstraction_src_dir}/events/wheel-event-integ.cpp
 )
 
-
 SET( platform_abstraction_header_files
    ${platform_abstraction_src_dir}/addon-manager.h
+   ${platform_abstraction_src_dir}/bitmap.h
+   ${platform_abstraction_src_dir}/context-notifier.h
    ${platform_abstraction_src_dir}/core.h
    ${platform_abstraction_src_dir}/core-enumerations.h
-   ${platform_abstraction_src_dir}/context-notifier.h
    ${platform_abstraction_src_dir}/debug.h
-   ${platform_abstraction_src_dir}/trace.h
-   ${platform_abstraction_src_dir}/profiling.h
-   ${platform_abstraction_src_dir}/input-options.h
-   ${platform_abstraction_src_dir}/bitmap.h
-   ${platform_abstraction_src_dir}/resource-policies.h
-   ${platform_abstraction_src_dir}/resource-types.h
    ${platform_abstraction_src_dir}/gl-abstraction.h
-   ${platform_abstraction_src_dir}/gl-defines.h
    ${platform_abstraction_src_dir}/gl-context-helper-abstraction.h
+   ${platform_abstraction_src_dir}/gl-defines.h
    ${platform_abstraction_src_dir}/graphics-sync-abstraction.h
-   ${platform_abstraction_src_dir}/render-controller.h
+   ${platform_abstraction_src_dir}/input-options.h
+   ${platform_abstraction_src_dir}/lockless-buffer.h
+   ${platform_abstraction_src_dir}/pixel-data-integ.h
    ${platform_abstraction_src_dir}/platform-abstraction.h
+   ${platform_abstraction_src_dir}/profiling.h
    ${platform_abstraction_src_dir}/processor-interface.h
-   ${platform_abstraction_src_dir}/lockless-buffer.h
+   ${platform_abstraction_src_dir}/render-controller.h
    ${platform_abstraction_src_dir}/render-task-list-integ.h
+   ${platform_abstraction_src_dir}/resource-policies.h
+   ${platform_abstraction_src_dir}/resource-types.h
    ${platform_abstraction_src_dir}/scene.h
+   ${platform_abstraction_src_dir}/trace.h
 )
 
 
@@ -54,17 +58,18 @@ SET( platform_abstraction_events_header_files
    ${platform_abstraction_src_dir}/events/event.h
    ${platform_abstraction_src_dir}/events/hover-event-integ.h
    ${platform_abstraction_src_dir}/events/key-event-integ.h
-   ${platform_abstraction_src_dir}/events/wheel-event-integ.h
    ${platform_abstraction_src_dir}/events/multi-point-event-integ.h
    ${platform_abstraction_src_dir}/events/point.h
    ${platform_abstraction_src_dir}/events/touch-event-combiner.h
    ${platform_abstraction_src_dir}/events/touch-event-integ.h
    ${platform_abstraction_src_dir}/events/touch-integ.h
+   ${platform_abstraction_src_dir}/events/wheel-event-integ.h
 )
 
 
 SET( SOURCES ${SOURCES}
   ${platform_abstraction_src_files}
+  ${platform_abstraction_events_src_files}
 )
 
 SET( INTEGRATION_API_HEADERS ${INTEGRATION_API_HEADERS}
similarity index 58%
rename from dali/devel-api/images/pixel-data-devel.cpp
rename to dali/integration-api/pixel-data-integ.cpp
index 6a3c495..2e7888c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
  */
 
 // FILE HEADER
-#include <dali/devel-api/images/pixel-data-devel.h>
+#include <dali/integration-api/pixel-data-integ.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/event/images/pixel-data-impl.h>
 
-namespace Dali
+namespace Dali::Integration
 {
-namespace DevelPixelData
-{
-PixelDataBuffer ReleasePixelDataBuffer(PixelData& pixelData)
+PixelDataBuffer ReleasePixelDataBuffer(Dali::PixelData& pixelData)
 {
   Internal::PixelData& pixelDataImpl   = GetImplementation(pixelData);
-  PixelDataBuffer      pixelDataBuffer = pixelDataImpl.ReleaseBuffer();
+  PixelDataBuffer      pixelDataBuffer = pixelDataImpl.ReleasePixelDataBuffer();
   pixelData.Reset();
   return pixelDataBuffer;
 }
 
-} // namespace DevelPixelData
-
-} // namespace Dali
+PixelDataBuffer GetPixelDataBuffer(const Dali::PixelData& pixelData)
+{
+  const Internal::PixelData& pixelDataImpl   = GetImplementation(pixelData);
+  PixelDataBuffer            pixelDataBuffer = pixelDataImpl.GetPixelDataBuffer();
+  return pixelDataBuffer;
+}
+} // namespace Dali::Integration
similarity index 60%
rename from dali/devel-api/images/pixel-data-devel.h
rename to dali/integration-api/pixel-data-integ.h
index 52af2e2..cd7358f 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef DALI_PIXEL_DATA_DEVEL_H
-#define DALI_PIXEL_DATA_DEVEL_H
+#ifndef DALI_PIXEL_DATA_INTEG_H
+#define DALI_PIXEL_DATA_INTEG_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -25,9 +25,7 @@
 #include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/images/pixel.h>
 
-namespace Dali
-{
-namespace DevelPixelData
+namespace Dali::Integration
 {
 /**
  * Struct to keep the buffer pointer and the allocation method.
@@ -38,13 +36,13 @@ namespace DevelPixelData
  */
 struct PixelDataBuffer
 {
-  uint8_t*                   buffer;
-  uint32_t                   bufferSize;
-  PixelData::ReleaseFunction releaseFunction;
+  uint8_t*                         buffer;
+  uint32_t                         bufferSize;
+  Dali::PixelData::ReleaseFunction releaseFunction;
 
-  PixelDataBuffer(uint8_t*                   buffer,
-                  uint32_t                   bufferSize,
-                  PixelData::ReleaseFunction releaseFunction)
+  PixelDataBuffer(uint8_t*                         buffer,
+                  uint32_t                         bufferSize,
+                  Dali::PixelData::ReleaseFunction releaseFunction)
   : buffer(buffer),
     bufferSize(bufferSize),
     releaseFunction(releaseFunction)
@@ -58,10 +56,15 @@ struct PixelDataBuffer
  * @param[in,out] pixelData The pixel data object to take the buffer from
  * @return the buffer and the data release mechanism
  */
-DALI_CORE_API PixelDataBuffer ReleasePixelDataBuffer(PixelData& pixelData);
+DALI_CORE_API PixelDataBuffer ReleasePixelDataBuffer(Dali::PixelData& pixelData);
 
-} // namespace DevelPixelData
+/**
+ * Get the buffer from a pixel data object.
+ * @param[in] pixelData The pixel data object to get the buffer from
+ * @return the buffer of pixelData.
+ */
+DALI_CORE_API PixelDataBuffer GetPixelDataBuffer(const Dali::PixelData& pixelData);
 
-} // namespace Dali
+} // namespace Dali::Integration
 
-#endif // DALI_PIXEL_DATA_DEVEL_H
+#endif // DALI_PIXEL_DATA_INTEG_H
index cdce973..3a3b12e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -25,8 +25,6 @@ namespace Dali
 {
 namespace Internal
 {
-const ImageAttributes ImageAttributes::DEFAULT_ATTRIBUTES;
-
 struct ImageAttributes::ImageAttributesImpl
 {
   ImageAttributesImpl()
index 3a0dc21..5d04147 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_IMAGE_ATTRIBUTES_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -91,8 +91,6 @@ public:
    */
   using FilterMode = Dali::SamplingMode::Type;
 
-  static const ImageAttributes DEFAULT_ATTRIBUTES; ///< Default attributes have no size
-
   /**
    * @brief Default constructor, initializes to default values.
    */
index 28fe69e..b821205 100644 (file)
@@ -64,7 +64,7 @@ public:
    * Move constructor. Passes the ownership of a pointer to another.
    * @param[in] other The pointer that gives away the ownership.
    */
-  OwnerPointer(OwnerPointer&& other)
+  OwnerPointer(OwnerPointer&& other) noexcept
   : mObject(nullptr)
   {
     Swap(other);
@@ -91,7 +91,7 @@ public:
    * Move assignment operator. Passes the ownership of a pointer to another.
    * @param[in] other The pointer that gives away the ownership.
    */
-  OwnerPointer& operator=(OwnerPointer&& other)
+  OwnerPointer& operator=(OwnerPointer&& other) noexcept
   {
     // Reuse operator=
     return operator=(other);
index 3d50cfa..81992b1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SHADER_DATA_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -36,8 +36,6 @@ using ShaderDataPtr = IntrusivePtr<ShaderData>;
 
 namespace
 {
-static const std::vector<char> emptyShader;
-
 inline std::vector<char> StringToVector(const std::string& str)
 {
   auto retval = std::vector<char>{};
@@ -150,6 +148,7 @@ public: // API
     else
     {
       //      DALI_LOG_ERROR("Unsupported shader stage\n");
+      static const std::vector<char> emptyShader;
       return emptyShader;
     }
   }
index aa8395e..f1da6e0 100644 (file)
@@ -52,13 +52,13 @@ ActorObserver::~ActorObserver()
   delete mRemoveCallback;
 }
 
-ActorObserver::ActorObserver(ActorObserver&& other)
+ActorObserver::ActorObserver(ActorObserver&& other) noexcept
 : ActorObserver(nullptr)
 {
   operator=(std::move(other));
 }
 
-ActorObserver& ActorObserver::operator=(ActorObserver&& other)
+ActorObserver& ActorObserver::operator=(ActorObserver&& other) noexcept
 {
   if(this != &other)
   {
index 329930a..032d891 100644 (file)
@@ -71,7 +71,7 @@ public:
    * @note The other's actor is appropriately disconnected.
    * @note Ownership of callback is passed onto this class.
    */
-  ActorObserver(ActorObserver&& other);
+  ActorObserver(ActorObserver&& other) noexcept;
 
   /**
    * Move assignment operator.
@@ -81,7 +81,7 @@ public:
    * @note The other's actor is appropriately disconnected.
    * @note Ownership of callback is passed onto this class.
    */
-  ActorObserver& operator=(ActorObserver&& other);
+  ActorObserver& operator=(ActorObserver&& other) noexcept;
 
   // Not copyable
 
index 745896a..4dc28bf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -108,13 +108,19 @@ uint32_t PixelData::GetBufferSize() const
   return mBufferSize;
 }
 
-DevelPixelData::PixelDataBuffer PixelData::ReleaseBuffer()
+Dali::Integration::PixelDataBuffer PixelData::ReleasePixelDataBuffer()
 {
-  DevelPixelData::PixelDataBuffer pixelDataBuffer(mBuffer, mBufferSize, mReleaseFunction);
+  Dali::Integration::PixelDataBuffer pixelDataBuffer(mBuffer, mBufferSize, mReleaseFunction);
   mBuffer = nullptr;
   return pixelDataBuffer;
 }
 
+Dali::Integration::PixelDataBuffer PixelData::GetPixelDataBuffer() const
+{
+  Dali::Integration::PixelDataBuffer pixelDataBuffer(mBuffer, mBufferSize, mReleaseFunction);
+  return pixelDataBuffer;
+}
+
 uint32_t PixelData::GetStride() const
 {
   return mStride;
index 746d347..a5b26c5 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_PIXEL_DATA_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -19,8 +19,8 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/images/pixel-data-devel.h>
 #include <dali/integration-api/debug.h>
+#include <dali/integration-api/pixel-data-integ.h>
 #include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/object/base-object.h>
 
@@ -115,7 +115,13 @@ public:
    * Return the buffer pointer and reset the internal buffer to zero.
    * @return The buffer pointer and associated data.
    */
-  DevelPixelData::PixelDataBuffer ReleaseBuffer();
+  Dali::Integration::PixelDataBuffer ReleasePixelDataBuffer();
+
+  /**
+   * Return the buffer pointer.
+   * @return The buffer pointer.
+   */
+  Dali::Integration::PixelDataBuffer GetPixelDataBuffer() const;
 
   /**
    * @copydoc PixelData::GetStride()
index a12bdbd..f96636a 100644 (file)
@@ -166,6 +166,7 @@ SET( internal_src_files
   ${internal_src_dir}/update/render-tasks/scene-graph-render-task-list.cpp
   ${internal_src_dir}/update/rendering/scene-graph-texture-set.cpp
   ${internal_src_dir}/update/rendering/scene-graph-renderer.cpp
+  ${internal_src_dir}/update/rendering/scene-graph-visual-renderer.cpp
 )
 
 SET( SOURCES ${SOURCES}
index 4f8e236..9a895fc 100644 (file)
@@ -177,6 +177,7 @@ struct RenderManager::Impl
   std::unique_ptr<Dali::ThreadPool> threadPool;            ///< The thread pool
   Vector<Graphics::Texture*>        boundTextures;         ///< The textures bound for rendering
   Vector<Graphics::Texture*>        textureDependencyList; ///< The dependency list of bound textures
+  Vector<Render::TextureKey>        updatedTextures{};     ///< The updated texture list
 
   uint32_t    frameCount{0u};                                                    ///< The current frame count
   BufferIndex renderBufferIndex{SceneGraphBuffers::INITIAL_UPDATE_BUFFER_INDEX}; ///< The index of the buffer to read from; this is opposite of the "update" buffer
@@ -247,6 +248,7 @@ void RenderManager::AddTexture(const Render::TextureKey& textureKey)
 
   textureKey->Initialize(mImpl->graphicsController);
   mImpl->textureContainer.PushBack(textureKey);
+  mImpl->updatedTextures.PushBack(textureKey);
 }
 
 void RenderManager::RemoveTexture(const Render::TextureKey& textureKey)
@@ -267,12 +269,24 @@ void RenderManager::UploadTexture(const Render::TextureKey& textureKey, PixelDat
 {
   DALI_ASSERT_DEBUG(textureKey && "Trying to upload to empty texture key");
   textureKey->Upload(pixelData, params);
+
+  mImpl->updatedTextures.PushBack(textureKey);
 }
 
 void RenderManager::GenerateMipmaps(const Render::TextureKey& textureKey)
 {
   DALI_ASSERT_DEBUG(textureKey && "Trying to generate mipmaps on empty texture key");
   textureKey->GenerateMipmaps();
+
+  mImpl->updatedTextures.PushBack(textureKey);
+}
+
+void RenderManager::SetTextureUpdated(const Render::TextureKey& textureKey)
+{
+  DALI_ASSERT_DEBUG(textureKey && "Trying to set updated on empty texture key");
+  textureKey->SetUpdated(true);
+
+  mImpl->updatedTextures.PushBack(textureKey);
 }
 
 void RenderManager::SetFilterMode(Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode)
@@ -999,11 +1013,12 @@ void RenderManager::PostRender()
     iter->OnRenderFinished();
   }
 
-  // Notify RenderTexture that rendering has finished
-  for(auto&& iter : mImpl->textureContainer)
+  // Notify updated RenderTexture that rendering has finished
+  for(auto&& iter : mImpl->updatedTextures)
   {
     iter->OnRenderFinished();
   }
+  mImpl->updatedTextures.Clear();
 
   mImpl->UpdateTrackers();
 
index cf40117..6bd9a3d 100644 (file)
@@ -254,6 +254,12 @@ public:
   void GenerateMipmaps(const Render::TextureKey& texture);
 
   /**
+   * Sets the updated flag of a texture
+   * @param[in] texture The updated texture
+   */
+  void SetTextureUpdated(const Render::TextureKey& textureKey);
+
+  /**
    * Adds a framebuffer to the render manager
    * @param[in] frameBuffer The framebuffer to add
    */
index 7a19c6b..c6e4b24 100644 (file)
@@ -169,7 +169,11 @@ namespace Render
 {
 namespace
 {
-MemoryPoolObjectAllocator<Renderer> gRenderRendererMemoryPool;
+MemoryPoolObjectAllocator<Renderer>& GetRenderRendererMemoryPool()
+{
+  static MemoryPoolObjectAllocator<Renderer> gRenderRendererMemoryPool;
+  return gRenderRendererMemoryPool;
+}
 }
 
 void Renderer::PrepareCommandBuffer()
@@ -191,8 +195,8 @@ RendererKey Renderer::NewKey(SceneGraph::RenderDataProvider* dataProvider,
                              DepthFunction::Type             depthFunction,
                              StencilParameters&              stencilParameters)
 {
-  void* ptr = gRenderRendererMemoryPool.AllocateRawThreadSafe();
-  auto  key = gRenderRendererMemoryPool.GetKeyFromPtr(static_cast<Renderer*>(ptr));
+  void* ptr = GetRenderRendererMemoryPool().AllocateRawThreadSafe();
+  auto  key = GetRenderRendererMemoryPool().GetKeyFromPtr(static_cast<Renderer*>(ptr));
 
   // Use placement new to construct renderer.
   new(ptr) Renderer(dataProvider, geometry, blendingBitmask, blendColor, faceCullingMode, preMultipliedAlphaEnabled, depthWriteMode, depthTestMode, depthFunction, stencilParameters);
@@ -245,12 +249,12 @@ Renderer::~Renderer() = default;
 
 void Renderer::operator delete(void* ptr)
 {
-  gRenderRendererMemoryPool.FreeThreadSafe(static_cast<Renderer*>(ptr));
+  GetRenderRendererMemoryPool().FreeThreadSafe(static_cast<Renderer*>(ptr));
 }
 
 Renderer* Renderer::Get(RendererKey::KeyType rendererKey)
 {
-  return gRenderRendererMemoryPool.GetPtrFromKey(rendererKey);
+  return GetRenderRendererMemoryPool().GetPtrFromKey(rendererKey);
 }
 
 void Renderer::SetGeometry(Render::Geometry* geometry)
index 2a455fd..6adf66f 100644 (file)
@@ -37,7 +37,11 @@ Debug::Filter* gTextureFilter = Debug::Filter::New(Debug::Concise, false, "LOG_T
 #endif
 
 // Memory pool used to allocate new textures. Memory used by this pool will be released when shutting down DALi
-MemoryPoolObjectAllocator<Texture> gTextureMemoryPool;
+MemoryPoolObjectAllocator<Texture>& GetTextureMemoryPool()
+{
+  static MemoryPoolObjectAllocator<Texture> gTextureMemoryPool;
+  return gTextureMemoryPool;
+}
 
 /**
  * Converts DALi pixel format to Graphics::Format
@@ -211,8 +215,8 @@ constexpr Graphics::TextureType ConvertType(Texture::Type type)
 
 TextureKey Texture::NewKey(Type type, Pixel::Format format, ImageDimensions size)
 {
-  void* ptr = gTextureMemoryPool.AllocateRawThreadSafe();
-  auto  key = gTextureMemoryPool.GetKeyFromPtr(static_cast<Texture*>(ptr));
+  void* ptr = GetTextureMemoryPool().AllocateRawThreadSafe();
+  auto  key = GetTextureMemoryPool().GetKeyFromPtr(static_cast<Texture*>(ptr));
   new(ptr) Texture(type, format, size);
 
   return TextureKey(key);
@@ -220,8 +224,8 @@ TextureKey Texture::NewKey(Type type, Pixel::Format format, ImageDimensions size
 
 TextureKey Texture::NewKey(NativeImageInterfacePtr nativeImageInterface)
 {
-  void* ptr = gTextureMemoryPool.AllocateRawThreadSafe();
-  auto  key = gTextureMemoryPool.GetKeyFromPtr(static_cast<Texture*>(ptr));
+  void* ptr = GetTextureMemoryPool().AllocateRawThreadSafe();
+  auto  key = GetTextureMemoryPool().GetKeyFromPtr(static_cast<Texture*>(ptr));
   new(ptr) Texture(nativeImageInterface);
 
   return TextureKey(key);
@@ -259,12 +263,12 @@ Texture::~Texture() = default;
 
 void Texture::operator delete(void* ptr)
 {
-  gTextureMemoryPool.FreeThreadSafe(static_cast<Texture*>(ptr));
+  GetTextureMemoryPool().FreeThreadSafe(static_cast<Texture*>(ptr));
 }
 
 Render::Texture* Texture::Get(TextureKey::KeyType key)
 {
-  return gTextureMemoryPool.GetPtrFromKey(key);
+  return GetTextureMemoryPool().GetPtrFromKey(key);
 }
 
 void Texture::Initialize(Graphics::Controller& graphicsController)
@@ -375,8 +379,8 @@ void Texture::Upload(PixelDataPtr pixelData, const Internal::Texture::UploadPara
   info.srcFormat    = ConvertPixelFormat(pixelData->GetPixelFormat());
 
   Graphics::TextureUpdateSourceInfo updateSourceInfo{};
-  updateSourceInfo.sourceType          = Graphics::TextureUpdateSourceInfo::Type::MEMORY;
-  updateSourceInfo.memorySource.memory = pixelData->GetBuffer();
+  updateSourceInfo.sourceType                = Graphics::TextureUpdateSourceInfo::Type::PIXEL_DATA;
+  updateSourceInfo.pixelDataSource.pixelData = Dali::PixelData(pixelData.Get());
 
   mGraphicsController->UpdateTextures({info}, {updateSourceInfo});
 
index 65f7cd6..8b71487 100644 (file)
@@ -132,8 +132,8 @@ public:
   };
 
   DoubleBuffered()
-  : mValue1(NULL),
-    mValue2(NULL)
+  : mValue1(nullptr),
+    mValue2(nullptr)
   {
   }
 
index 9eb16d0..769dc35 100644 (file)
@@ -35,6 +35,7 @@ namespace Internal
 namespace SceneGraph
 {
 class PropertyOwner;
+class ResetterManager;
 
 using OwnedPropertyContainer = OwnerContainer<PropertyBase*>;
 using OwnedPropertyIter      = OwnedPropertyContainer::Iterator;
@@ -220,6 +221,17 @@ public:
     return true;
   }
 
+  /**
+   * @brief Install custom resetter messages to resetter manager.
+   * @pre ConnectToSceneGraph() Should be called before this API.
+   *
+   * @param[in] manager ResetterManager to add resetter.
+   */
+  virtual void AddInitializeResetter(ResetterManager& manager) const
+  {
+    // Do nothing
+  }
+
 protected:
   /**
    * Protected constructor.
diff --git a/dali/internal/update/common/renderer-resetter.h b/dali/internal/update/common/renderer-resetter.h
new file mode 100644 (file)
index 0000000..2883440
--- /dev/null
@@ -0,0 +1,164 @@
+#ifndef DALI_INTERNAL_SCENEGRAPH_RENDERER_RESETTER_H
+#define DALI_INTERNAL_SCENEGRAPH_RENDERER_RESETTER_H
+
+/*
+ * Copyright (c) 2023 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.
+ */
+
+// EXTERNAL INCLDUES
+#include <cstdint> // int8_t
+
+#include <dali/internal/update/animation/property-accessor.h>
+#include <dali/internal/update/animation/property-component-accessor.h>
+#include <dali/internal/update/common/property-owner.h>
+#include <dali/internal/update/rendering/scene-graph-renderer.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace SceneGraph
+{
+/**
+ * Class to reset the renderer's properties to their base values. Used by UpdateManager
+ * to reset the renderer properties after the renderer is created.
+ */
+class RendererResetter : public PropertyOwner::Observer
+{
+public:
+  /**
+   * New method.
+   * @param[in] renderer The renderer
+   * @return the new renderer resetter
+   */
+  static RendererResetter* New(const Renderer& renderer)
+  {
+    return new RendererResetter(const_cast<Renderer*>(&renderer));
+  }
+
+  /**
+   * Virtual Destructor
+   */
+  ~RendererResetter() override
+  {
+    if(mRenderer != nullptr)
+    {
+      mRenderer->RemoveObserver(*this);
+    }
+  }
+
+  /**
+   * Initialize.
+   *
+   * Watches the renderer to track if it's destroyed or not.
+   */
+  void Initialize()
+  {
+    mRenderer->AddObserver(*this);
+  }
+
+  /**
+   * Reset the renderer properties to their base values if the renderer is still alive and on stage
+   * @param[in] updateBufferIndex the current buffer index
+   */
+  void ResetToBaseValue(BufferIndex updateBufferIndex)
+  {
+    if(mRenderer != nullptr && mActive)
+    {
+      // Start aging the renderer properties.
+      // We need to reset the renderer properties for only one frames to ensure
+      // initialized case.
+      --mActive;
+
+      mRenderer->ResetToBaseValues(updateBufferIndex);
+    }
+  };
+
+  /**
+   * Called when the renderer is connected to the scene graph.
+   *
+   * Note, SceneGraph::Renderer don't call this API.
+   *
+   * @param[in] owner The property owner
+   */
+  void PropertyOwnerConnected(PropertyOwner& owner) override
+  {
+  }
+
+  /**
+   * Called when mPropertyOwner is disconnected from the scene graph.
+   *
+   * Note, SceneGraph::Renderer don't call this API.
+   *
+   * @param[in] bufferIndex the current buffer index
+   * @param[in] owner The property owner
+   */
+  void PropertyOwnerDisconnected(BufferIndex bufferIndex, PropertyOwner& owner) override
+  {
+  }
+
+  /**
+   * Called shortly before the propertyOwner is destroyed
+   * @param[in] owner The property owner
+   */
+  void PropertyOwnerDestroyed(PropertyOwner& owner) override
+  {
+    mRenderer = nullptr;
+
+    // Don't need to wait another frame as the properties are being destroyed
+    mActive = STOPPED;
+  }
+
+  /**
+   * Determine if the renderer resetter has finished.
+   *
+   * @return true if the renderer resetter has finished.
+   */
+  virtual bool IsFinished()
+  {
+    return mActive <= STOPPED;
+  }
+
+protected:
+  enum
+  {
+    STOPPED = 0,
+    AGING   = 1,
+    ACTIVE  = 2,
+  };
+
+  /**
+   * Constructor
+   *
+   * @param[in] renderer The renderer storing the base properties
+   */
+  RendererResetter(Renderer* renderer)
+  : mRenderer(renderer),
+    mActive(AGING) // Since we make this resetter only initialize case now.
+  {
+    mRenderer->MarkAsDirty();
+  }
+
+  Renderer* mRenderer; ///< The renderer that owns the properties
+  int8_t    mActive;   ///< 2 if active, 1 if aging, 0 if stopped
+};
+
+} // namespace SceneGraph
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif //DALI_INTERNAL_SCENEGRAPH_RENDERER_RESETTER_H
diff --git a/dali/internal/update/common/resetter-manager.h b/dali/internal/update/common/resetter-manager.h
new file mode 100644 (file)
index 0000000..66f31f2
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef DALI_INTERNAL_SCENEGRAPH_RESETTER_MANAGER_H
+#define DALI_INTERNAL_SCENEGRAPH_RESETTER_MANAGER_H
+
+/*
+ * Copyright (c) 2023 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 INCLDUES
+#include <dali/internal/common/owner-pointer.h>
+#include <dali/internal/update/common/property-resetter.h>
+
+namespace Dali::Internal::SceneGraph
+{
+class Node;
+class Renderer;
+
+/**
+ * Abstract interface for passing a Resetter object add.
+ */
+class ResetterManager
+{
+public:
+  /**
+   * Add a property resetter. ResetterManager takes ownership of the object.
+   * It will be killed by ResetterManager when the associated animator or
+   * constraint has finished; or the property owner of the property is destroyed.
+   */
+  virtual void AddPropertyResetter(OwnerPointer<PropertyResetterBase>& propertyResetter) = 0;
+
+  /**
+   * Add a node resetter. ResetterManager takes ownership of the object.
+   * It will be killed by ResetterManager when the node is disconnected from the scene graph;
+   * or when the node is destroyed.
+   */
+  virtual void AddNodeResetter(const Node& node) = 0;
+
+  /**
+   * Add a renderer resetter. ResetterManager takes ownership of the object.
+   * It will be killed by ResetterManager when the renderer is destroyed
+   */
+  virtual void AddRendererResetter(const Renderer& renderer) = 0;
+
+protected:
+  /**
+   * Destructor. Protected as no derived class should ever be deleted
+   * through a reference to this pure abstract interface.
+   */
+  virtual ~ResetterManager() = default;
+};
+
+} // namespace Dali::Internal::SceneGraph
+
+#endif //DALI_INTERNAL_SCENEGRAPH_RESETTER_MANAGER_H
index c0d7b20..df1fa69 100644 (file)
@@ -84,6 +84,16 @@ void RenderMessageDispatcher::RemoveRenderTracker(Render::RenderTracker& renderT
   new(slot) DerivedType(&mRenderManager, &RenderManager::RemoveRenderTracker, &renderTracker);
 }
 
+RenderManager& RenderMessageDispatcher::GetRenderManager()
+{
+  return mRenderManager;
+}
+
+uint32_t* RenderMessageDispatcher::ReserveMessageSlot(std::size_t size)
+{
+  return mRenderQueue.ReserveMessageSlot(mBuffers.GetUpdateBufferIndex(), size);
+}
+
 } // namespace SceneGraph
 
 } // namespace Internal
index 59a6e81..4242c13 100644 (file)
@@ -82,6 +82,19 @@ public:
    */
   void RemoveRenderTracker(Render::RenderTracker& renderTracker);
 
+  /**
+   * Return the render manager.
+   * @return A reference to the render manager.
+   */
+  RenderManager& GetRenderManager();
+
+  /**
+   * Reserve space for another message in the queue.
+   * @param[in] size The message size with respect to the size of type "char".
+   * @return A pointer to the first char allocated for the message.
+   */
+  uint32_t* ReserveMessageSlot(std::size_t size);
+
 private:
   RenderManager& mRenderManager;
   RenderQueue&   mRenderQueue;
index 87c3c98..dcae779 100644 (file)
@@ -506,7 +506,7 @@ inline void RenderInstructionProcessor::SortRenderItems(BufferIndex bufferIndex,
   for(uint32_t index = 0; index < renderableCount; ++index, ++renderListIter)
   {
     *renderListIter = mSortingHelper[index].renderItem;
-    DALI_LOG_INFO(gRenderListLogFilter, Debug::Verbose, "  sortedList[%d] = %x\n", index, mSortingHelper[index].renderItem->mRenderer);
+    DALI_LOG_INFO(gRenderListLogFilter, Debug::Verbose, "  sortedList[%d] = node : %x renderer : %x\n", index, mSortingHelper[index].renderItem->mNode, mSortingHelper[index].renderItem->mRenderer.Get());
   }
 }
 
@@ -565,6 +565,10 @@ void RenderInstructionProcessor::Prepare(BufferIndex                 updateBuffe
         // We only use the clipping version of the sort comparitor if any clipping nodes exist within the RenderList.
         SortRenderItems(updateBufferIndex, *renderList, layer, hasClippingNodes, isOrthographicCamera);
       }
+      else
+      {
+        renderList->SetHasColorRenderItems(true);
+      }
 
       isRenderListAdded = true;
     }
@@ -589,6 +593,10 @@ void RenderInstructionProcessor::Prepare(BufferIndex                 updateBuffe
         // Clipping hierarchy is irrelevant when sorting overlay items, so we specify using the non-clipping version of the sort comparitor.
         SortRenderItems(updateBufferIndex, *renderList, layer, false, isOrthographicCamera);
       }
+      else
+      {
+        renderList->SetHasColorRenderItems(false);
+      }
 
       isRenderListAdded = true;
     }
index d47185a..4a2f1bb 100644 (file)
@@ -281,6 +281,7 @@ struct UpdateManager::Impl
 
   ResetterContainer<PropertyResetterBase> propertyResetters; ///< A container of property resetters
   ResetterContainer<NodeResetter>         nodeResetters;     ///< A container of node resetters
+  ResetterContainer<RendererResetter>     rendererResetters; ///< A container of renderer resetters
 
   OwnerContainer<Animation*>            animations;            ///< A container of owned animations
   OwnerContainer<PropertyNotification*> propertyNotifications; ///< A container of owner property notifications.
@@ -356,7 +357,7 @@ void UpdateManager::InstallRoot(OwnerPointer<Layer>& layer)
   rootLayer->CreateTransform(&mImpl->transformManager);
   rootLayer->SetRoot(true);
 
-  AddNodeResetter(*rootLayer);
+  rootLayer->AddInitializeResetter(*this);
 
   mImpl->scenes.emplace_back(new Impl::SceneInfo(rootLayer));
 }
@@ -408,7 +409,7 @@ void UpdateManager::ConnectNode(Node* parent, Node* node)
 
   parent->ConnectChild(node);
 
-  AddNodeResetter(*node);
+  node->AddInitializeResetter(*this);
 
   // Inform the frame-callback-processor, if set, about the node-hierarchy changing
   if(mImpl->frameCallbackProcessor)
@@ -501,7 +502,7 @@ void UpdateManager::RemoveObject(PropertyOwner* object)
 void UpdateManager::AddRenderTaskList(OwnerPointer<RenderTaskList>& taskList)
 {
   RenderTaskList* taskListPointer = taskList.Release();
-  taskListPointer->SetRenderMessageDispatcher(&mImpl->renderMessageDispatcher);
+  taskListPointer->Initialize(*this, mImpl->renderMessageDispatcher);
 
   mImpl->scenes.back()->taskList = taskListPointer;
 }
@@ -613,6 +614,13 @@ void UpdateManager::AddNodeResetter(const Node& node)
   mImpl->nodeResetters.PushBack(nodeResetter.Release());
 }
 
+void UpdateManager::AddRendererResetter(const Renderer& renderer)
+{
+  OwnerPointer<SceneGraph::RendererResetter> rendererResetter = SceneGraph::RendererResetter::New(renderer);
+  rendererResetter->Initialize();
+  mImpl->rendererResetters.PushBack(rendererResetter.Release());
+}
+
 void UpdateManager::AddPropertyNotification(OwnerPointer<PropertyNotification>& propertyNotification)
 {
   mImpl->propertyNotifications.PushBack(propertyNotification.Release());
@@ -663,6 +671,8 @@ void UpdateManager::AddRenderer(const RendererKey& rendererKey)
   DALI_LOG_INFO(gLogFilter, Debug::General, "[%x] AddRenderer\n", renderer);
 
   renderer->ConnectToSceneGraph(*mImpl->sceneController, mSceneGraphBuffers.GetUpdateBufferIndex());
+  renderer->AddInitializeResetter(*this);
+
   mImpl->renderers.PushBack(rendererKey);
 }
 
@@ -691,6 +701,7 @@ void UpdateManager::SetPanGestureProcessor(PanGesture* panGestureProcessor)
 
 void UpdateManager::AddTextureSet(OwnerPointer<TextureSet>& textureSet)
 {
+  textureSet->SetRenderMessageDispatcher(&mImpl->renderMessageDispatcher);
   mImpl->textureSets.PushBack(textureSet.Release());
 }
 
@@ -737,6 +748,9 @@ void UpdateManager::ResetProperties(BufferIndex bufferIndex)
   // Reset node properties
   mImpl->nodeResetters.ResetToBaseValues(bufferIndex);
 
+  // Reset renderer properties
+  mImpl->rendererResetters.ResetToBaseValues(bufferIndex);
+
   // Reset all animating / constrained properties
   mImpl->propertyResetters.ResetToBaseValues(bufferIndex);
 
index aacfe23..908f827 100644 (file)
@@ -36,6 +36,8 @@
 #include <dali/internal/update/animation/scene-graph-animation.h>
 #include <dali/internal/update/common/node-resetter.h>
 #include <dali/internal/update/common/property-resetter.h>
+#include <dali/internal/update/common/renderer-resetter.h>
+#include <dali/internal/update/common/resetter-manager.h>
 #include <dali/internal/update/common/scene-graph-buffers.h>
 #include <dali/internal/update/common/scene-graph-property-notification.h>
 #include <dali/internal/update/common/scene-graph-scene.h>
@@ -97,7 +99,7 @@ class VertexBuffer;
  * It also maintains the lifecycle of nodes and other property owners that are
  * disconnected from the scene graph.
  */
-class UpdateManager : public ShaderSaver
+class UpdateManager : public ShaderSaver, public ResetterManager
 {
 public:
   /**
@@ -242,19 +244,22 @@ public:
    */
   bool IsAnimationRunning() const;
 
+  // ResetterManager
+
+  /**
+   * @copydoc Dali::Internal::SceneGraph::ResetterManager::AddPropertyResetter()
+   */
+  void AddPropertyResetter(OwnerPointer<PropertyResetterBase>& propertyResetter) override;
+
   /**
-   * Add a property resetter. UpdateManager takes ownership of the object.
-   * It will be killed by UpdateManager when the associated animator or
-   * constraint has finished; or the property owner of the property is destroyed.
+   * @copydoc Dali::Internal::SceneGraph::ResetterManager::AddNodeResetter()
    */
-  void AddPropertyResetter(OwnerPointer<PropertyResetterBase>& propertyResetter);
+  void AddNodeResetter(const Node& node) override;
 
   /**
-   * Add a node resetter. UpdateManager takes ownership of the object.
-   * It will be killed by UpdateManager when the node is disconnected from the scene graph;
-   * or when the node is destroyed.
+   * @copydoc Dali::Internal::SceneGraph::ResetterManager::AddRendererResetter()
    */
-  void AddNodeResetter(const Node& node);
+  void AddRendererResetter(const Renderer& renderer) override;
 
   // Property Notification
 
index 5dc2e99..e999b1b 100644 (file)
@@ -25,6 +25,8 @@
 #include <dali/public-api/common/constants.h>
 #include <dali/public-api/common/dali-common.h>
 
+#include <dali/internal/update/common/resetter-manager.h> ///< For AddInitializeResetter
+
 namespace
 {
 // Memory pool used to allocate new nodes. Memory used by this pool will be released when process dies
@@ -162,6 +164,11 @@ bool Node::IsAnimationPossible() const
   return mIsConnectedToSceneGraph;
 }
 
+void Node::AddInitializeResetter(ResetterManager& manager) const
+{
+  manager.AddNodeResetter(*this);
+}
+
 void Node::ConnectChild(Node* childNode)
 {
   DALI_ASSERT_ALWAYS(this != childNode);
index a99129b..79f16a1 100644 (file)
@@ -58,6 +58,7 @@ namespace SceneGraph
 class Layer;
 class RenderTask;
 class UpdateManager;
+class ResetterManager;
 class Node;
 
 // Flags which require the scene renderable lists to be updated
@@ -906,6 +907,11 @@ public:
   bool IsAnimationPossible() const override;
 
   /**
+   * @copydoc Dali::Internal::SceneGraph::PropertyOwner::AddInitializeResetter
+   */
+  void AddInitializeResetter(ResetterManager& manager) const override;
+
+  /**
    * Called by UpdateManager when the node is added.
    * Creates a new transform component in the transform manager and initialize all the properties
    * related to the transformation
index 4557c4c..f714fb4 100644 (file)
@@ -29,6 +29,9 @@
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/math/math-utils.h>
 
+#include <dali/internal/update/common/property-resetter.h>
+#include <dali/internal/update/common/resetter-manager.h> ///< For AddInitializeResetter
+
 namespace // unnamed namespace
 {
 const uint32_t UPDATE_COUNT         = 2u; // Update projection or view matrix this many frames after a change
@@ -577,6 +580,19 @@ bool Camera::IsProjectionMatrixAnimated() const
          !mAspectRatio.IsClean();
 }
 
+void Camera::AddInitializeResetter(ResetterManager& manager) const
+{
+  // Call base class initialize resetter
+  Node::AddInitializeResetter(manager);
+
+  OwnerPointer<SceneGraph::PropertyResetterBase> resetterFieldOvView      = SceneGraph::BakerResetter::New(*this, mFieldOfView, SceneGraph::BakerResetter::Lifetime::BAKE);
+  OwnerPointer<SceneGraph::PropertyResetterBase> resetterOrthographicSize = SceneGraph::BakerResetter::New(*this, mOrthographicSize, SceneGraph::BakerResetter::Lifetime::BAKE);
+  OwnerPointer<SceneGraph::PropertyResetterBase> resetterAspectRatio      = SceneGraph::BakerResetter::New(*this, mAspectRatio, SceneGraph::BakerResetter::Lifetime::BAKE);
+  manager.AddPropertyResetter(resetterFieldOvView);
+  manager.AddPropertyResetter(resetterOrthographicSize);
+  manager.AddPropertyResetter(resetterAspectRatio);
+}
+
 uint32_t Camera::UpdateViewMatrix(BufferIndex updateBufferIndex)
 {
   uint32_t retval(mUpdateViewFlag);
index e779f49..016c809 100644 (file)
@@ -334,6 +334,12 @@ public:
    */
   bool IsProjectionMatrixAnimated() const;
 
+public:
+  /**
+   * @copydoc Dali::Internal::SceneGraph::PropertyOwner::AddInitializeResetter
+   */
+  void AddInitializeResetter(ResetterManager& manager) const override;
+
 private:
   /**
    * Constructor
index 080e2f0..255b1b0 100644 (file)
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/common/memory-pool-object-allocator.h>
+#include <dali/internal/update/common/resetter-manager.h> ///< For AddInitializeResetter
 
 namespace //Unnamed namespace
 {
@@ -44,6 +45,7 @@ RenderTaskList* RenderTaskList::New()
 
 RenderTaskList::RenderTaskList()
 : mNotificationObject(nullptr),
+  mResetterManager(nullptr),
   mRenderMessageDispatcher(nullptr),
   mOverlayRenderTask(nullptr)
 {
@@ -56,9 +58,10 @@ void RenderTaskList::operator delete(void* ptr)
   GetRenderTaskListMemoryPool().FreeThreadSafe(static_cast<RenderTaskList*>(ptr));
 }
 
-void RenderTaskList::SetRenderMessageDispatcher(RenderMessageDispatcher* renderMessageDispatcher)
+void RenderTaskList::Initialize(ResetterManager& resetterManager, RenderMessageDispatcher& renderMessageDispatcher)
 {
-  mRenderMessageDispatcher = renderMessageDispatcher;
+  mResetterManager         = &resetterManager;
+  mRenderMessageDispatcher = &renderMessageDispatcher;
 }
 
 void RenderTaskList::AddTask(OwnerPointer<RenderTask>& newTask)
@@ -66,7 +69,7 @@ void RenderTaskList::AddTask(OwnerPointer<RenderTask>& newTask)
   DALI_ASSERT_DEBUG(newTask && "SceneGraph RenderTask is null");
   DALI_ASSERT_DEBUG(mRenderMessageDispatcher != NULL && "RenderMessageDispatcher is null");
 
-  newTask->Initialize(*mRenderMessageDispatcher);
+  newTask->Initialize(*mResetterManager, *mRenderMessageDispatcher);
 
   if(mOverlayRenderTask && mRenderTasks[mRenderTasks.Size() - 1] == mOverlayRenderTask)
   {
index 625cead..dd78e0c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_LIST_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -34,6 +34,7 @@ namespace SceneGraph
 {
 class RenderMessageDispatcher;
 class RenderTask;
+class ResetterManager;
 
 /**
  * An ordered list of render-tasks.
@@ -61,10 +62,11 @@ public:
   void operator delete(void* ptr);
 
   /**
-   * Set the renderMessageDispatcher to send message.
+   * Set the resetterManager and renderMessageDispatcher to send message.
+   * @param[in] resetterManager to send resetter
    * @param[in] renderMessageDispatcher The renderMessageDispatcher to send messages.
    */
-  void SetRenderMessageDispatcher(RenderMessageDispatcher* renderMessageDispatcher);
+  void Initialize(ResetterManager& resetterManager, RenderMessageDispatcher& renderMessageDispatcher);
 
   /**
    * Add a new RenderTask to the list.
@@ -133,6 +135,7 @@ private:
 
 private:
   CompleteNotificationInterface* mNotificationObject;      ///< object to pass in to the complete notification
+  ResetterManager*               mResetterManager;         ///< for sending bake resetter if rendertask initalized
   RenderMessageDispatcher*       mRenderMessageDispatcher; ///< for sending messages to render thread
   RenderTaskContainer            mRenderTasks;             ///< A container of owned RenderTasks
   RenderTask*                    mOverlayRenderTask;       ///< OverlayRenderTask.
index d49af14..1d1027e 100644 (file)
@@ -25,6 +25,9 @@
 #include <dali/internal/update/nodes/node.h>
 #include <dali/public-api/math/matrix.h>
 
+#include <dali/internal/update/common/property-resetter.h>
+#include <dali/internal/update/common/resetter-manager.h> ///< For AddInitializeResetter
+
 #include <dali/internal/update/render-tasks/scene-graph-render-task-debug.h>
 
 namespace Dali
@@ -58,8 +61,9 @@ RenderTask::~RenderTask()
   }
 }
 
-void RenderTask::Initialize(RenderMessageDispatcher& renderMessageDispatcher)
+void RenderTask::Initialize(ResetterManager& resetterManager, RenderMessageDispatcher& renderMessageDispatcher)
 {
+  mResetterManager         = &resetterManager;
   mRenderMessageDispatcher = &renderMessageDispatcher;
 }
 
@@ -475,10 +479,21 @@ void RenderTask::PropertyOwnerDestroyed(PropertyOwner& owner)
   }
 }
 
+void RenderTask::AddInitializeResetter(ResetterManager& manager) const
+{
+  OwnerPointer<SceneGraph::PropertyResetterBase> resetterViewportPosition = SceneGraph::BakerResetter::New(*this, mViewportPosition, SceneGraph::BakerResetter::Lifetime::BAKE);
+  OwnerPointer<SceneGraph::PropertyResetterBase> resetterViewportSize     = SceneGraph::BakerResetter::New(*this, mViewportSize, SceneGraph::BakerResetter::Lifetime::BAKE);
+  OwnerPointer<SceneGraph::PropertyResetterBase> resetterClearColor       = SceneGraph::BakerResetter::New(*this, mClearColor, SceneGraph::BakerResetter::Lifetime::BAKE);
+  manager.AddPropertyResetter(resetterViewportPosition);
+  manager.AddPropertyResetter(resetterViewportSize);
+  manager.AddPropertyResetter(resetterClearColor);
+}
+
 RenderTask::RenderTask()
 : mViewportPosition(Vector2::ZERO),
   mViewportSize(Vector2::ZERO),
   mClearColor(Dali::RenderTask::DEFAULT_CLEAR_COLOR),
+  mResetterManager(nullptr),
   mRenderMessageDispatcher(nullptr),
   mRenderSyncTracker(nullptr),
   mSourceNode(nullptr),
@@ -504,11 +519,19 @@ RenderTask::RenderTask()
 
 void RenderTask::SetActiveStatus()
 {
+  bool oldActive = mActive;
+
   // must have a source and camera both connected to scene
   mActive = (mSourceNode && mSourceNode->ConnectedToScene() &&
              mCameraNode && mCameraNode->ConnectedToScene() && mCamera);
   TASK_LOG_FMT(Debug::General, " Source node(%x) active %d.  Frame counter: %d\n", mSourceNode, mSourceNode && mSourceNode->ConnectedToScene(), mFrameCounter);
   TASK_LOG_FMT(Debug::General, " Camera node(%x) active %d\n", mCameraNode, mCameraNode && mCameraNode->ConnectedToScene());
+
+  if(!oldActive && mActive)
+  {
+    // Send resetter only if newly activated
+    AddInitializeResetter(*mResetterManager);
+  }
 }
 
 } // namespace SceneGraph
index 13947f8..d244882 100644 (file)
@@ -41,6 +41,7 @@ class Node;
 class Camera;
 class RenderInstruction;
 class RenderMessageDispatcher;
+class ResetterManager;
 
 /**
  * RenderTasks describe how the Dali scene should be rendered.
@@ -68,9 +69,10 @@ public:
 
   /**
    * Initialize the render task. Called in update thread
+   * @param[in] resetterManager to send resetter
    * @param[in] renderMessageDispatcher to send messages to render thread
    */
-  void Initialize(RenderMessageDispatcher& renderMessageDispatcher);
+  void Initialize(ResetterManager& resetterManager, RenderMessageDispatcher& renderMessageDispatcher);
 
   /**
    * Set the nodes to be rendered.
@@ -367,6 +369,12 @@ private: // from PropertyOwner::Observer
    */
   void PropertyOwnerDestroyed(PropertyOwner& owner) override;
 
+public:
+  /**
+   * @copydoc Dali::Internal::SceneGraph::PropertyOwner::AddInitializeResetter
+   */
+  void AddInitializeResetter(ResetterManager& manager) const override;
+
 private:
   void SetActiveStatus();
 
@@ -385,6 +393,7 @@ public:                                          // Animatable Properties
   AnimatableProperty<Vector4> mClearColor;       ///< clearColor
 
 private:
+  ResetterManager*         mResetterManager;
   RenderMessageDispatcher* mRenderMessageDispatcher;
   Render::RenderTracker*   mRenderSyncTracker;
   Node*                    mSourceNode;
index 1b666a4..b8ad3ae 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 // CLASS HEADER
-#include "scene-graph-renderer.h"
+#include <dali/internal/update/rendering/scene-graph-renderer.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/common/blending-options.h>
@@ -32,6 +32,9 @@
 #include <dali/internal/update/nodes/node.h>
 #include <dali/internal/update/rendering/scene-graph-texture-set.h>
 
+#include <dali/internal/update/common/property-resetter.h>
+#include <dali/internal/update/common/resetter-manager.h> ///< For AddInitializeResetter
+
 #include <dali/integration-api/debug.h>
 
 namespace Dali
@@ -143,7 +146,7 @@ RendererKey Renderer::GetKey(Renderer* renderer)
 
 bool Renderer::PrepareRender(BufferIndex updateBufferIndex)
 {
-  bool rendererUpdated        = mResendFlag || mRenderingBehavior == DevelRenderer::Rendering::CONTINUOUSLY || mUpdateDecay > 0;
+  bool rendererUpdated        = mDirtyFlag || mResendFlag || mRenderingBehavior == DevelRenderer::Rendering::CONTINUOUSLY || mUpdateDecay > 0;
   auto shaderMapChangeCounter = mShader ? mShader->GetUniformMap().GetChangeCounter() : 0u;
   bool shaderMapChanged       = mShader && (mShaderMapChangeCounter != shaderMapChangeCounter);
   if(shaderMapChanged)
@@ -364,6 +367,7 @@ void Renderer::SetGeometry(Render::Geometry* geometry)
   DALI_ASSERT_DEBUG(geometry != NULL && "Geometry pointer is NULL");
   mGeometry = geometry;
 
+  mDirtyFlag = true;
   if(mRenderer)
   {
     mResendFlag |= RESEND_GEOMETRY;
@@ -589,6 +593,8 @@ float Renderer::GetOpacity(BufferIndex updateBufferIndex) const
 void Renderer::SetRenderingBehavior(DevelRenderer::Rendering::Type renderingBehavior)
 {
   mRenderingBehavior = renderingBehavior;
+
+  mDirtyFlag = true;
   SetUpdated(true);
 }
 
@@ -758,6 +764,24 @@ void Renderer::ResetDirtyFlag()
   SetUpdated(false);
 }
 
+void Renderer::ResetToBaseValues(BufferIndex updateBufferIndex)
+{
+  mOpacity.ResetToBaseValue(updateBufferIndex);
+  if(mVisualProperties)
+  {
+    mVisualProperties->ResetToBaseValues(updateBufferIndex);
+  }
+}
+
+void Renderer::MarkAsDirty()
+{
+  mOpacity.MarkAsDirty();
+  if(mVisualProperties)
+  {
+    mVisualProperties->MarkAsDirty();
+  }
+}
+
 uint32_t Renderer::GetMemoryPoolCapacity()
 {
   return GetRendererMemoryPool().GetCapacity();
@@ -769,6 +793,11 @@ void Renderer::OnMappingChanged()
   mRegenerateUniformMap = true; // Should remain true until this renderer is added to a RenderList.
 }
 
+void Renderer::AddInitializeResetter(ResetterManager& manager) const
+{
+  manager.AddRendererResetter(*this);
+}
+
 const CollectedUniformMap& Renderer::GetCollectedUniformMap() const
 {
   return mCollectedUniformMap;
index 153ff85..a1787aa 100644 (file)
@@ -476,6 +476,18 @@ public:
   void ResetDirtyFlag();
 
   /**
+   * @brief Reset to base values of all animatable properties.
+   *
+   * @param[in] updateBufferIndex the current buffer index
+   */
+  void ResetToBaseValues(BufferIndex updateBufferIndex);
+
+  /**
+   * @brief Mark all animatable properties as dirty.
+   */
+  void MarkAsDirty();
+
+  /**
    * Get the capacity of the memory pools
    * @return the capacity of the memory pools
    */
@@ -493,6 +505,11 @@ public: // PropertyOwner implementation
    */
   virtual void ResetDefaultProperties(BufferIndex updateBufferIndex){};
 
+  /**
+   * @copydoc Dali::Internal::SceneGraph::PropertyOwner::AddInitializeResetter
+   */
+  void AddInitializeResetter(ResetterManager& manager) const override;
+
 public: // From UniformMapDataProvider
   /**
    * @copydoc UniformMapDataProvider::GetCollectedUniformMap
index 106b711..338c335 100644 (file)
@@ -20,7 +20,9 @@
 // INTERNAL HEADERS
 #include <dali/internal/common/internal-constants.h>
 #include <dali/internal/common/memory-pool-object-allocator.h>
+#include <dali/internal/render/common/render-manager.h>
 #include <dali/internal/render/renderers/render-texture.h>
+#include <dali/internal/update/controllers/render-message-dispatcher.h>
 #include <dali/internal/update/rendering/scene-graph-renderer.h>
 
 namespace //Unnamed namespace
@@ -75,7 +77,14 @@ void TextureSet::SetSampler(uint32_t index, Render::Sampler* sampler)
 
   if(index < static_cast<uint32_t>(mTextures.Size()))
   {
-    mTextures[index]->SetUpdated(true);
+    // Send a message to the RenderManagerReserveMessageSlot
+    using DerivedType = MessageValue1<RenderManager, Render::TextureKey>;
+
+    // Reserve some memory inside the render queue
+    uint32_t* slot = mRenderMessageDispatcher->ReserveMessageSlot(sizeof(DerivedType));
+
+    // Construct message in the render queue memory; note that delete should not be called on the return value
+    new(slot) DerivedType(&mRenderMessageDispatcher->GetRenderManager(), &RenderManager::SetTextureUpdated, mTextures[index]);
   }
 }
 
@@ -108,7 +117,15 @@ void TextureSet::SetTexture(uint32_t index, const Render::TextureKey& texture)
   if(texture)
   {
     mHasAlpha |= texture->HasAlphaChannel();
-    texture->SetUpdated(true);
+
+    // Send a message to the RenderManagerReserveMessageSlot
+    using DerivedType = MessageValue1<RenderManager, Render::TextureKey>;
+
+    // Reserve some memory inside the render queue
+    uint32_t* slot = mRenderMessageDispatcher->ReserveMessageSlot(sizeof(DerivedType));
+
+    // Construct message in the render queue memory; note that delete should not be called on the return value
+    new(slot) DerivedType(&mRenderMessageDispatcher->GetRenderManager(), &RenderManager::SetTextureUpdated, texture);
   }
 }
 
@@ -117,6 +134,11 @@ bool TextureSet::HasAlpha() const
   return mHasAlpha;
 }
 
+void TextureSet::SetRenderMessageDispatcher(RenderMessageDispatcher* renderMessageDispatcher)
+{
+  mRenderMessageDispatcher = renderMessageDispatcher;
+}
+
 uint32_t TextureSet::GetMemoryPoolCapacity()
 {
   return GetTextureSetMemoryPool().GetCapacity();
index 8f58ce2..25336fd 100644 (file)
@@ -37,6 +37,7 @@ class Texture;
 namespace SceneGraph
 {
 class Renderer;
+class RenderMessageDispatcher;
 
 class TextureSet
 {
@@ -94,6 +95,12 @@ public:
   }
 
   /**
+   * Set the renderMessageDispatcher to send message.
+   * @param[in] renderMessageDispatcher The renderMessageDispatcher to send messages.
+   */
+  void SetRenderMessageDispatcher(RenderMessageDispatcher* renderMessageDispatcher);
+
+  /**
    * Get the capacity of the memory pools
    * @return the capacity of the memory pools
    */
@@ -106,9 +113,10 @@ private:
   TextureSet();
 
 private:
-  Vector<Render::Sampler*>   mSamplers; ///< List of samplers used by each texture. Not owned
-  Vector<Render::TextureKey> mTextures; ///< List of Textures. Not owned
-  bool                       mHasAlpha; ///< if any of the textures has an alpha channel
+  Vector<Render::Sampler*>   mSamplers;                         ///< List of samplers used by each texture. Not owned
+  Vector<Render::TextureKey> mTextures;                         ///< List of Textures. Not owned
+  RenderMessageDispatcher*   mRenderMessageDispatcher{nullptr}; ///< for sending messages to render thread. Not owned
+  bool                       mHasAlpha;                         ///< if any of the textures has an alpha channel
 };
 
 inline void SetTextureMessage(EventThreadServices& eventThreadServices, const TextureSet& textureSet, uint32_t index, const Render::TextureKey& textureKey)
diff --git a/dali/internal/update/rendering/scene-graph-visual-renderer.cpp b/dali/internal/update/rendering/scene-graph-visual-renderer.cpp
new file mode 100644 (file)
index 0000000..234edd9
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2023 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/internal/update/rendering/scene-graph-visual-renderer.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/update/common/property-resetter.h>
+#include <dali/internal/update/rendering/scene-graph-renderer.h>
+
+namespace Dali::Internal::SceneGraph::VisualRenderer
+{
+void AnimatableVisualProperties::ResetToBaseValues(BufferIndex updateBufferIndex)
+{
+  mTransformOffset.ResetToBaseValue(updateBufferIndex);
+  mTransformSize.ResetToBaseValue(updateBufferIndex);
+  mTransformOrigin.ResetToBaseValue(updateBufferIndex);
+  mTransformAnchorPoint.ResetToBaseValue(updateBufferIndex);
+  mTransformOffsetSizeMode.ResetToBaseValue(updateBufferIndex);
+  mExtraSize.ResetToBaseValue(updateBufferIndex);
+  mMixColor.ResetToBaseValue(updateBufferIndex);
+  mPreMultipliedAlpha.ResetToBaseValue(updateBufferIndex);
+  if(mExtendedProperties)
+  {
+    auto* decoratedVisualProperties = static_cast<VisualRenderer::AnimatableDecoratedVisualProperties*>(mExtendedProperties);
+    decoratedVisualProperties->ResetToBaseValues(updateBufferIndex);
+  }
+}
+
+void AnimatableVisualProperties::MarkAsDirty()
+{
+  mTransformOffset.MarkAsDirty();
+  mTransformSize.MarkAsDirty();
+  mTransformOrigin.MarkAsDirty();
+  mTransformAnchorPoint.MarkAsDirty();
+  mTransformOffsetSizeMode.MarkAsDirty();
+  mExtraSize.MarkAsDirty();
+  mMixColor.MarkAsDirty();
+  mPreMultipliedAlpha.MarkAsDirty();
+  if(mExtendedProperties)
+  {
+    auto* decoratedVisualProperties = static_cast<VisualRenderer::AnimatableDecoratedVisualProperties*>(mExtendedProperties);
+    decoratedVisualProperties->MarkAsDirty();
+  }
+}
+
+void AnimatableDecoratedVisualProperties::ResetToBaseValues(BufferIndex updateBufferIndex)
+{
+  mCornerRadius.ResetToBaseValue(updateBufferIndex);
+  mCornerRadiusPolicy.ResetToBaseValue(updateBufferIndex);
+  mBorderlineWidth.ResetToBaseValue(updateBufferIndex);
+  mBorderlineColor.ResetToBaseValue(updateBufferIndex);
+  mBorderlineOffset.ResetToBaseValue(updateBufferIndex);
+  mBlurRadius.ResetToBaseValue(updateBufferIndex);
+}
+
+void AnimatableDecoratedVisualProperties::MarkAsDirty()
+{
+  mCornerRadius.MarkAsDirty();
+  mCornerRadiusPolicy.MarkAsDirty();
+  mBorderlineWidth.MarkAsDirty();
+  mBorderlineColor.MarkAsDirty();
+  mBorderlineOffset.MarkAsDirty();
+  mBlurRadius.MarkAsDirty();
+}
+
+} // namespace Dali::Internal::SceneGraph::VisualRenderer
\ No newline at end of file
index 610aee0..888131f 100644 (file)
@@ -49,6 +49,18 @@ struct AnimatableVisualProperties
     }
   }
 
+public: // Public API
+  /**
+   * @copydoc Dali::Internal::SceneGraph::Renderer::ResetToBaseValues
+   */
+  void ResetToBaseValues(BufferIndex updateBufferIndex);
+
+  /**
+   * @copydoc Dali::Internal::SceneGraph::Renderer::MarkAsDirty
+   */
+  void MarkAsDirty();
+
+public:
   /**
    * @brief Cached coefficient value when we calculate visual transformed update size.
    * It can reduce complexity of calculate the vertex position.
@@ -110,6 +122,7 @@ struct AnimatableDecoratedVisualProperties
   {
   }
 
+public: // Public API
   // Delete function of AnimatableDecoratedVisualProperties* converted as void*
   static void DeleteFunction(void* data)
   {
@@ -117,6 +130,17 @@ struct AnimatableDecoratedVisualProperties
   }
 
   /**
+   * @copydoc Dali::Internal::SceneGraph::Renderer::ResetToBaseValues
+   */
+  void ResetToBaseValues(BufferIndex updateBufferIndex);
+
+  /**
+   * @copydoc Dali::Internal::SceneGraph::Renderer::MarkAsDirty
+   */
+  void MarkAsDirty();
+
+public:
+  /**
    * @brief Cached coefficient value when we calculate visual transformed update size.
    * It can reduce complexity of calculate the vertex position.
    *
index 18d47ab..4a726d2 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 {
 const uint32_t    CORE_MAJOR_VERSION = 2;
 const uint32_t    CORE_MINOR_VERSION = 2;
-const uint32_t    CORE_MICRO_VERSION = 18;
+const uint32_t    CORE_MICRO_VERSION = 19;
 const char* const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 4f9f909..019ea4b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2
 Summary:    DALi 3D Engine
-Version:    2.2.18
+Version:    2.2.19
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT