Merge branch 'devel/master' into tizen
authortscholb <scholb.kim@samsung.com>
Wed, 2 Nov 2022 07:45:16 +0000 (16:45 +0900)
committertscholb <scholb.kim@samsung.com>
Wed, 2 Nov 2022 07:45:16 +0000 (16:45 +0900)
Change-Id: I14c583151e3011d7160184434e2a6aa63d3111f1

86 files changed:
automated-tests/resources/invalid.gif [new file with mode: 0644]
automated-tests/src/dali-adaptor-internal/utc-Dali-FontClient.cpp
automated-tests/src/dali-adaptor/utc-Dali-EncodedImageBuffer.cpp
automated-tests/src/dali-adaptor/utc-Dali-GifLoading.cpp
automated-tests/src/dali-adaptor/utc-Dali-PixelBuffer.cpp
automated-tests/src/dali-adaptor/utc-Dali-Window.cpp
dali/devel-api/adaptor-framework/animated-image-loading.h
dali/devel-api/adaptor-framework/color-controller.cpp
dali/devel-api/adaptor-framework/color-controller.h
dali/devel-api/adaptor-framework/offscreen-window.cpp
dali/devel-api/adaptor-framework/offscreen-window.h
dali/devel-api/adaptor-framework/pixel-buffer.cpp
dali/devel-api/adaptor-framework/pixel-buffer.h
dali/devel-api/adaptor-framework/style-monitor.cpp
dali/devel-api/adaptor-framework/style-monitor.h
dali/devel-api/adaptor-framework/video-player.cpp
dali/devel-api/adaptor-framework/video-player.h
dali/devel-api/adaptor-framework/web-engine/web-engine.cpp
dali/devel-api/adaptor-framework/web-engine/web-engine.h
dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/devel-api/text-abstraction/font-client.cpp
dali/devel-api/text-abstraction/font-client.h
dali/integration-api/adaptor-framework/render-surface-interface.h
dali/integration-api/adaptor-framework/scene-holder-impl.cpp
dali/integration-api/adaptor-framework/scene-holder-impl.h
dali/internal/accessibility/bridge/bridge-accessible.cpp
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/graphics/gles-impl/egl-graphics-controller.cpp
dali/internal/graphics/gles-impl/egl-graphics-controller.h
dali/internal/graphics/gles-impl/file.list
dali/internal/graphics/gles-impl/gles-context.cpp
dali/internal/graphics/gles-impl/gles-context.h
dali/internal/graphics/gles-impl/gles-graphics-texture.h
dali/internal/graphics/gles-impl/gles-sync-pool.cpp [new file with mode: 0644]
dali/internal/graphics/gles-impl/gles-sync-pool.h [new file with mode: 0644]
dali/internal/graphics/gles-impl/gles-texture-dependency-checker.cpp [new file with mode: 0644]
dali/internal/graphics/gles-impl/gles-texture-dependency-checker.h [new file with mode: 0644]
dali/internal/graphics/gles/egl-graphics.cpp
dali/internal/imaging/android/native-image-source-impl-android.cpp
dali/internal/imaging/android/native-image-source-impl-android.h
dali/internal/imaging/common/gif-loading.cpp
dali/internal/imaging/common/image-operations.cpp
dali/internal/imaging/common/pixel-buffer-impl.cpp
dali/internal/imaging/common/pixel-buffer-impl.h
dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp
dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h
dali/internal/imaging/windows/native-image-source-impl-win.cpp
dali/internal/imaging/windows/native-image-source-impl-win.h
dali/internal/network/common/network-performance-server.cpp
dali/internal/text/text-abstraction/bidirectional-support-impl.cpp
dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.cpp
dali/internal/trace/tizen/trace-manager-impl-tizen.cpp
dali/internal/window-system/android/window-base-android.cpp
dali/internal/window-system/android/window-base-android.h
dali/internal/window-system/common/gl-window-impl.cpp
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/common/window-render-surface.cpp
dali/internal/window-system/common/window-render-surface.h
dali/internal/window-system/macos/window-base-mac.h
dali/internal/window-system/macos/window-base-mac.mm
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h
dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h
dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp
dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h
dali/internal/window-system/windows/window-base-win.cpp
dali/internal/window-system/windows/window-base-win.h
dali/internal/window-system/x11/pixmap-render-surface-x.cpp
dali/internal/window-system/x11/pixmap-render-surface-x.h
dali/internal/window-system/x11/window-base-x.cpp
dali/internal/window-system/x11/window-base-x.h
dali/public-api/adaptor-framework/encoded-image-buffer.cpp
dali/public-api/adaptor-framework/encoded-image-buffer.h
dali/public-api/adaptor-framework/window.cpp
dali/public-api/adaptor-framework/window.h
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

diff --git a/automated-tests/resources/invalid.gif b/automated-tests/resources/invalid.gif
new file mode 100644 (file)
index 0000000..8ec84ae
Binary files /dev/null and b/automated-tests/resources/invalid.gif differ
index 208deb1..4868e3c 100644 (file)
@@ -230,6 +230,20 @@ int UtcDaliFontClientAtlasLimitationDisabled(void)
   DALI_TEST_GREATER(1024u, glyphBufferData2000.width, TEST_LOCATION);  //924u
   DALI_TEST_GREATER(glyphBufferData2000.height, 1024u, TEST_LOCATION); //1148u
 
+  // Test GlyphBufferData move
+  TextAbstraction::FontClient::GlyphBufferData movedGlyphBufferData2000 = std::move(glyphBufferData2000);
+
+  for(int i = 0; i < 50; ++i)
+  {
+    TextAbstraction::FontClient::GlyphBufferData dummy = std::move(movedGlyphBufferData2000);
+    movedGlyphBufferData2000                           = std::move(dummy);
+
+    // Test moved GlyphBufferData destruct well
+  }
+
+  DALI_TEST_GREATER(1024u, movedGlyphBufferData2000.width, TEST_LOCATION);  //924u
+  DALI_TEST_GREATER(movedGlyphBufferData2000.height, 1024u, TEST_LOCATION); //1148u
+
   END_TEST;
 }
 
index 36b3f4f..5b2da93 100644 (file)
@@ -82,6 +82,31 @@ int UtcDaliEncodedImageBufferAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliEncodedImageBufferMoveConstructor(void)
+{
+  EncodedImageBuffer buffer      = EncodedImageBuffer::New(tinybuffer());
+  EncodedImageBuffer bufferMoved = std::move(buffer);
+
+  DALI_TEST_EQUALS((bool)buffer, false, TEST_LOCATION);
+  DALI_TEST_EQUALS((bool)bufferMoved, true, TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliEncodedImageBufferMoveAssignmentOperator(void)
+{
+  EncodedImageBuffer buffer = EncodedImageBuffer::New(tinybuffer());
+
+  EncodedImageBuffer buffer2;
+  DALI_TEST_EQUALS((bool)buffer, true, TEST_LOCATION);
+  DALI_TEST_EQUALS((bool)buffer2, false, TEST_LOCATION);
+
+  buffer2 = std::move(buffer);
+  DALI_TEST_EQUALS((bool)buffer, false, TEST_LOCATION);
+  DALI_TEST_EQUALS((bool)buffer2, true, TEST_LOCATION);
+
+  END_TEST;
+}
+
 int UtcDaliEncodedImageBufferGetRawBuffer(void)
 {
   EncodedImageBuffer::RawBufferType originBuffer = tinybuffer();
index b71cedd..784d76b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,6 +30,9 @@ static const char* gGif_100_None = TEST_RESOURCE_DIR "/canvas-none.gif";
 // this image if not exist, for negative test
 static const char* gGifNonExist = "non-exist.gif";
 
+// this image exists but it is not a gif file.
+static const char* gGifInvalid = TEST_RESOURCE_DIR "/invalid.gif";
+
 } // namespace
 
 void utc_dali_animated_image_loader_startup(void)
@@ -42,6 +45,36 @@ void utc_dali_animated_image_loader_cleanup(void)
   test_return_value = TET_PASS;
 }
 
+int UtcDaliAnimatedImageLoadingCopyMoveP(void)
+{
+  Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New(gGif_100_None, true);
+
+  Dali::AnimatedImageLoading copied = animatedImageLoading;
+
+  DALI_TEST_EQUALS((bool)animatedImageLoading, true, TEST_LOCATION);
+  DALI_TEST_EQUALS((bool)copied, true, TEST_LOCATION);
+
+  Dali::AnimatedImageLoading moved = std::move(animatedImageLoading);
+
+  DALI_TEST_EQUALS((bool)animatedImageLoading, false, TEST_LOCATION);
+  DALI_TEST_EQUALS((bool)copied, true, TEST_LOCATION);
+  DALI_TEST_EQUALS((bool)moved, true, TEST_LOCATION);
+
+  Dali::AnimatedImageLoading copiedAssign;
+  copiedAssign = copied;
+
+  Dali::AnimatedImageLoading movedAssign;
+  movedAssign = std::move(moved);
+
+  DALI_TEST_EQUALS((bool)animatedImageLoading, false, TEST_LOCATION);
+  DALI_TEST_EQUALS((bool)copied, true, TEST_LOCATION);
+  DALI_TEST_EQUALS((bool)moved, false, TEST_LOCATION);
+  DALI_TEST_EQUALS((bool)copiedAssign, true, TEST_LOCATION);
+  DALI_TEST_EQUALS((bool)movedAssign, true, TEST_LOCATION);
+
+  END_TEST;
+}
+
 int UtcDaliAnimatedImageLoadingGetImageSizeP(void)
 {
   Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New(gGif_100_None, true);
@@ -65,3 +98,14 @@ int UtcDaliAnimatedImageLoadingGetImageSizeN(void)
 
   END_TEST;
 }
+
+int UtcDaliAnimatedImageLoadingInvalidGif(void)
+{
+  Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New(gGifInvalid, true);
+  Dali::Devel::PixelBuffer   pixelBuffer          = animatedImageLoading.LoadFrame(0);
+
+  // The pixel buffer should be empty.
+  DALI_TEST_CHECK(!pixelBuffer);
+
+  END_TEST;
+}
index bed76e1..2c74145 100644 (file)
@@ -196,6 +196,45 @@ int UtcDaliPixelBufferNew01P(void)
   END_TEST;
 }
 
+int UtcDaliPixelBufferConstructor01P(void)
+{
+  TestApplication    application;
+  Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New(10, 10, Pixel::RGBA8888);
+
+  Devel::PixelBuffer copiedBuf = pixbuf;
+  DALI_TEST_CHECK(pixbuf);
+  DALI_TEST_CHECK(copiedBuf);
+  DALI_TEST_CHECK(pixbuf.GetBuffer() != NULL);
+  DALI_TEST_CHECK(copiedBuf.GetBuffer() != NULL);
+
+  Devel::PixelBuffer movedBuf = std::move(pixbuf);
+  DALI_TEST_CHECK(!pixbuf);
+  DALI_TEST_CHECK(movedBuf);
+  DALI_TEST_CHECK(movedBuf.GetBuffer() != NULL);
+  END_TEST;
+}
+
+int UtcDaliPixelBufferAssign01P(void)
+{
+  TestApplication    application;
+  Devel::PixelBuffer pixbuf = Devel::PixelBuffer::New(10, 10, Pixel::RGBA8888);
+
+  Devel::PixelBuffer copiedBuf;
+  copiedBuf = pixbuf;
+  DALI_TEST_CHECK(pixbuf);
+  DALI_TEST_CHECK(copiedBuf);
+  DALI_TEST_CHECK(pixbuf.GetBuffer() != NULL);
+  DALI_TEST_CHECK(copiedBuf.GetBuffer() != NULL);
+
+  Devel::PixelBuffer movedBuf;
+  DALI_TEST_CHECK(!movedBuf);
+  movedBuf = std::move(pixbuf);
+  DALI_TEST_CHECK(!pixbuf);
+  DALI_TEST_CHECK(movedBuf);
+  DALI_TEST_CHECK(movedBuf.GetBuffer() != NULL);
+  END_TEST;
+}
+
 int UtcDaliPixelBufferNew01N(void)
 {
   TestApplication    application;
index db45460..1873913 100644 (file)
@@ -445,7 +445,7 @@ int UtcDaliWindowSetPositionNegative(void)
   Dali::Window instance;
   try
   {
-    Dali::Uint16Pair arg1;
+    Dali::Window::WindowPosition arg1;
     instance.SetPosition(arg1);
     DALI_TEST_CHECK(false); // Should not get here
   }
index da72e3f..4becd1f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_ANIMATED_IMAGE_LOADING_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -95,6 +95,21 @@ public:
   AnimatedImageLoading& operator=(const AnimatedImageLoading& rhs) = default;
 
   /**
+   * @brief Move constructor.
+   *
+   * @param[in] move The AnimatedImageLoading to move
+   */
+  AnimatedImageLoading(AnimatedImageLoading&& move) = default;
+
+  /**
+   * @brief Move assignment operator
+   *
+   * @param[in] rhs The AnimatedImageLoading to move
+   * @return A reference to this
+   */
+  AnimatedImageLoading& operator=(AnimatedImageLoading&& rhs) = default;
+
+  /**
    * @brief Destructor
    */
   ~AnimatedImageLoading();
index 3f8f14a..82518e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -27,16 +27,13 @@ ColorController::ColorController()
 {
 }
 
-ColorController::ColorController(const ColorController& controller)
-: BaseHandle(controller)
-{
-}
+ColorController::ColorController(const ColorController& controller) = default;
 
-ColorController& ColorController::operator=(const ColorController& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+ColorController& ColorController::operator=(const ColorController& rhs) = default;
+
+ColorController::ColorController(ColorController&& controller) = default;
+
+ColorController& ColorController::operator=(ColorController&& rhs) = default;
 
 ColorController ColorController::Get()
 {
index 49ad666..1a12cc6 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_COLOR_CONTROLLER_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -67,6 +67,22 @@ public:
   ColorController& operator=(const ColorController& rhs);
 
   /**
+   * @brief Creates a move of the handle.
+   *
+   * The move will point to the same implementation as the original.
+   * @param[in]  colorController  The Color Controller to move from.
+   */
+  ColorController(ColorController&& colorController);
+
+  /**
+   * @brief This move assignment operator is required for (smart) pointer semantics.
+   *
+   * @param [in] rhs  A reference to the moved handle
+   * @return A reference to this
+   */
+  ColorController& operator=(ColorController&& rhs);
+
+  /**
    * @brief Retrieve the initialized instance of the ColorController.
    *
    * @return Handle to ColorController.
index 42cc8eb..b6e6876 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -51,6 +51,10 @@ OffscreenWindow::OffscreenWindow(const OffscreenWindow& window) = default;
 
 OffscreenWindow& OffscreenWindow::operator=(const OffscreenWindow& window) = default;
 
+OffscreenWindow::OffscreenWindow(OffscreenWindow&& window) = default;
+
+OffscreenWindow& OffscreenWindow::operator=(OffscreenWindow&& window) = default;
+
 OffscreenWindow::~OffscreenWindow() = default;
 
 void OffscreenWindow::Add(Actor actor)
index 1c2e144..2ba8838 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_OFFSCREEN_WINDOW_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -85,6 +85,21 @@ public:
   OffscreenWindow& operator=(const OffscreenWindow& window);
 
   /**
+   * @brief Move constructor
+   *
+   * @param [in] window A reference to the moved handle
+   */
+  OffscreenWindow(OffscreenWindow&& window);
+
+  /**
+   * @brief Move assignment operator
+   *
+   * @param [in] window A reference to the moved handle
+   * @return A reference to this
+   */
+  OffscreenWindow& operator=(OffscreenWindow&& window);
+
+  /**
    * @brief Destructor
    */
   ~OffscreenWindow();
index e033afa..e391463 100644 (file)
@@ -28,8 +28,8 @@ namespace Dali
 {
 namespace Devel
 {
-PixelBuffer PixelBuffer::New(unsigned int        width,
-                             unsigned int        height,
+PixelBuffer PixelBuffer::New(uint32_t            width,
+                             uint32_t            height,
                              Dali::Pixel::Format pixelFormat)
 {
   Internal::Adaptor::PixelBufferPtr internal =
@@ -63,28 +63,25 @@ PixelBuffer::PixelBuffer(Internal::Adaptor::PixelBuffer* internal)
 {
 }
 
-PixelBuffer::PixelBuffer(const PixelBuffer& handle)
-: BaseHandle(handle)
-{
-}
+PixelBuffer::PixelBuffer(const PixelBuffer& handle) = default;
 
-PixelBuffer& PixelBuffer::operator=(const PixelBuffer& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+PixelBuffer& PixelBuffer::operator=(const PixelBuffer& rhs) = default;
+
+PixelBuffer::PixelBuffer(PixelBuffer&& handle) = default;
+
+PixelBuffer& PixelBuffer::operator=(PixelBuffer&& rhs) = default;
 
-unsigned int PixelBuffer::GetWidth() const
+uint32_t PixelBuffer::GetWidth() const
 {
   return GetImplementation(*this).GetWidth();
 }
 
-unsigned int PixelBuffer::GetHeight() const
+uint32_t PixelBuffer::GetHeight() const
 {
   return GetImplementation(*this).GetHeight();
 }
 
-unsigned int PixelBuffer::GetStride() const
+uint32_t PixelBuffer::GetStride() const
 {
   return GetImplementation(*this).GetStride();
 }
@@ -94,12 +91,12 @@ Pixel::Format PixelBuffer::GetPixelFormat() const
   return GetImplementation(*this).GetPixelFormat();
 }
 
-unsigned char* PixelBuffer::GetBuffer()
+uint8_t* PixelBuffer::GetBuffer()
 {
   return GetImplementation(*this).GetBuffer();
 }
 
-const unsigned char* const PixelBuffer::GetBuffer() const
+const uint8_t* PixelBuffer::GetBuffer() const
 {
   return GetImplementation(*this).GetConstBuffer();
 }
index 51c6739..40f3eae 100644 (file)
@@ -61,8 +61,8 @@ public:
   /**
    * Create a PixelBuffer with it's own data buffer.
    */
-  static PixelBuffer New(unsigned int        width,
-                         unsigned int        height,
+  static PixelBuffer New(uint32_t            width,
+                         uint32_t            height,
                          Dali::Pixel::Format pixelFormat);
 
   /**
@@ -98,6 +98,23 @@ public:
   PixelBuffer& operator=(const PixelBuffer& rhs);
 
   /**
+   * @brief This move constructor is required for (smart) pointer semantics.
+   *
+   * @SINCE_2_1.45
+   * @param[in] handle A reference to the moved handle
+   */
+  PixelBuffer(PixelBuffer&& handle);
+
+  /**
+   * @brief This move assignment operator is required for (smart) pointer semantics.
+   *
+   * @SINCE_2_1.45
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this object
+   */
+  PixelBuffer& operator=(PixelBuffer&& rhs);
+
+  /**
    * Convert to a pixel data and release the pixelBuffer's object.
    * This handle is left empty.
    *
@@ -127,7 +144,7 @@ public:
    * @SINCE_1_2.46
    * @return The pixel buffer, or NULL.
    */
-  unsigned char* GetBuffer();
+  uint8_t* GetBuffer();
 
   /**
    * @brief Gets the pixel buffer. This is a pointer to the internal
@@ -138,7 +155,7 @@ public:
    *
    * @return The pixel buffer, or NULL.
    */
-  const unsigned char* const GetBuffer() const;
+  const uint8_t* GetBuffer() const;
 
   /**
    * @brief Gets the width of the buffer in pixels.
@@ -146,7 +163,7 @@ public:
    * @SINCE_1_2.46
    * @return The width of the buffer in pixels
    */
-  unsigned int GetWidth() const;
+  uint32_t GetWidth() const;
 
   /**
    * @brief Gets the height of the buffer in pixels.
@@ -154,7 +171,7 @@ public:
    * @SINCE_1_2.46
    * @return The height of the buffer in pixels
    */
-  unsigned int GetHeight() const;
+  uint32_t GetHeight() const;
 
   /**
    * @brief Gets the stride of the buffer in pixels.
@@ -162,7 +179,7 @@ public:
    * @SINCE_2_1.17
    * @return The stride of the buffer in pixels. 0 means the buffer is tightly packed.
    */
-  unsigned int GetStride() const;
+  uint32_t GetStride() const;
 
   /**
    * @brief Gets the pixel format.
index 0ceeaa3..233505a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -27,10 +27,13 @@ StyleMonitor::StyleMonitor()
 {
 }
 
-StyleMonitor::StyleMonitor(const StyleMonitor& monitor)
-: BaseHandle(monitor)
-{
-}
+StyleMonitor::StyleMonitor(const StyleMonitor& monitor) = default;
+
+StyleMonitor& StyleMonitor::operator=(const StyleMonitor& monitor) = default;
+
+StyleMonitor::StyleMonitor(StyleMonitor&& monitor) = default;
+
+StyleMonitor& StyleMonitor::operator=(StyleMonitor&& monitor) = default;
 
 StyleMonitor StyleMonitor::StyleMonitor::Get()
 {
@@ -81,15 +84,6 @@ StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal()
   return GetImplementation(*this).StyleChangeSignal();
 }
 
-StyleMonitor& StyleMonitor::operator=(const StyleMonitor& monitor)
-{
-  if(*this != monitor)
-  {
-    BaseHandle::operator=(monitor);
-  }
-  return *this;
-}
-
 StyleMonitor::StyleMonitor(Internal::Adaptor::StyleMonitor* internal)
 : BaseHandle(internal)
 {
index d6196b8..2708eec 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_STYLE_MONITOR_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -68,6 +68,32 @@ public: // Creation & Destruction
   StyleMonitor(const StyleMonitor& monitor);
 
   /**
+   * @brief Assignment operator.
+   *
+   * The handle points to the same implementation as the one being copied from.
+   * @param[in]  monitor  The Style Monitor to copy from.
+   * @return reference to this object
+   */
+  StyleMonitor& operator=(const StyleMonitor& monitor);
+
+  /**
+   * @brief Creates a move of the handle.
+   *
+   * The move will point to the same implementation as the original.
+   * @param[in]  monitor  The Style Monitor to move from.
+   */
+  StyleMonitor(StyleMonitor&& monitor);
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * The handle points to the same implementation as the one being moved from.
+   * @param[in]  monitor  The Style Monitor to move from.
+   * @return reference to this object
+   */
+  StyleMonitor& operator=(StyleMonitor&& monitor);
+
+  /**
    * @brief Retrieve the initialized instance of the StyleMonitor.
    * @return Handle to StyleMonitor.
    */
@@ -145,16 +171,6 @@ public: // Signals
    */
   StyleChangeSignalType& StyleChangeSignal();
 
-public: // Operators
-  /**
-   * @brief Assignment operator.
-   *
-   * The handle points to the same implementation as the one being copied from.
-   * @param[in]  monitor  The Style Monitor to copy from.
-   * @return reference to this object
-   */
-  StyleMonitor& operator=(const StyleMonitor& monitor);
-
 public: // Not intended for application developers
   /**
    * @brief This constructor is used internally to create a handle from an object pointer.
index f98b50a..597ad02 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -64,19 +64,13 @@ VideoPlayer VideoPlayer::New(Dali::Actor actor, VideoSyncMode syncMode)
   return VideoPlayer(player.Get());
 }
 
-VideoPlayer::VideoPlayer(const VideoPlayer& player)
-: BaseHandle(player)
-{
-}
+VideoPlayer::VideoPlayer(const VideoPlayer& player) = default;
 
-VideoPlayer& VideoPlayer::operator=(const VideoPlayer& player)
-{
-  if(*this != player)
-  {
-    BaseHandle::operator=(player);
-  }
-  return *this;
-}
+VideoPlayer& VideoPlayer::operator=(const VideoPlayer& player) = default;
+
+VideoPlayer::VideoPlayer(VideoPlayer&& player) = default;
+
+VideoPlayer& VideoPlayer::operator=(VideoPlayer&& player) = default;
 
 VideoPlayer VideoPlayer::DownCast(BaseHandle handle)
 {
index 6daae85..8af206e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_VIDEO_PLAYER_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -93,6 +93,23 @@ public:
   VideoPlayer& operator=(const VideoPlayer& player);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_2_1.45
+   * @param[in] player VideoPlayer to move. The moved player will point at the same implementation
+   */
+  VideoPlayer(VideoPlayer&& player);
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_2_1.45
+   * @param[in] player The VideoPlayer to move assign from.
+   * @return The updated VideoPlayer.
+   */
+  VideoPlayer& operator=(VideoPlayer&& player);
+
+  /**
    * @brief Downcast a handle to VideoPlayer handle.
    *
    * If handle points to a VideoPlayer the downcast produces valid
index bba76f0..9cb82e2 100755 (executable)
@@ -67,19 +67,13 @@ Dali::WebEngineCookieManager* WebEngine::GetCookieManager()
   return Internal::Adaptor::WebEngine::GetCookieManager();
 }
 
-WebEngine::WebEngine(const WebEngine& webEngine)
-: BaseHandle(webEngine)
-{
-}
+WebEngine::WebEngine(const WebEngine& webEngine) = default;
 
-WebEngine& WebEngine::operator=(const WebEngine& webEngine)
-{
-  if(*this != webEngine)
-  {
-    BaseHandle::operator=(webEngine);
-  }
-  return *this;
-}
+WebEngine& WebEngine::operator=(const WebEngine& webEngine) = default;
+
+WebEngine::WebEngine(WebEngine&& webEngine) = default;
+
+WebEngine& WebEngine::operator=(WebEngine&& webEngine) = default;
 
 WebEngine WebEngine::DownCast(BaseHandle handle)
 {
index cdc5b21..1c98c00 100755 (executable)
@@ -87,6 +87,21 @@ public:
   WebEngine& operator=(const WebEngine& WebEngine);
 
   /**
+   * @brief Move constructor.
+   *
+   * @param[in] WebEngine WebEngine to move. The moved WebEngine will point at the same implementation
+   */
+  WebEngine(WebEngine&& WebEngine);
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @param[in] WebEngine The WebEngine to assign from.
+   * @return The updated WebEngine.
+   */
+  WebEngine& operator=(WebEngine&& WebEngine);
+
+  /**
    * @brief Downcast a handle to WebEngine handle.
    *
    * If handle points to a WebEngine the downcast produces valid
index df1d3a5..10a1642 100644 (file)
@@ -136,11 +136,6 @@ Window GetParent(Window window)
   return GetImplementation(window).GetParent();
 }
 
-Window DownCast(BaseHandle handle)
-{
-  return Window(dynamic_cast<Dali::Internal::Adaptor::Window*>(handle.GetObjectPtr()));
-}
-
 WindowOrientation GetCurrentOrientation(Window window)
 {
   return GetImplementation(window).GetCurrentOrientation();
index 6a64084..81cc05c 100644 (file)
@@ -46,7 +46,7 @@ typedef Signal<void()>
 typedef Signal<void(const std::string&, const std::string&, const Property::Array&)> AuxiliaryMessageSignalType;              ///< Auxiliary message signal type
 typedef Signal<void(Window, bool)>                                                   AccessibilityHighlightSignalType;        ///< Accessibility Highlight signal type
 typedef Signal<bool(const KeyEvent&)>                                                InterceptKeyEventSignalType;             ///< Intercept Key event signal type
-typedef Signal<void(Window, Window::WindowPosition)>                                 MovedSignalType;                         ///< Window Moved signal type
+typedef Signal<void(Window, Dali::Window::WindowPosition)>                           MovedSignalType;                         ///< Window Moved signal type
 
 /**
  * @brief Creates an initialized handle to a new Window.
@@ -218,14 +218,6 @@ DALI_ADAPTOR_API void Unparent(Window window);
 DALI_ADAPTOR_API Window GetParent(Window window);
 
 /**
- * @brief Downcast sceneHolder to window
- *
- * @param[in] handle The handle need to downcast
- * @return The window cast from SceneHolder
- */
-DALI_ADAPTOR_API Window DownCast(BaseHandle handle);
-
-/**
  * @brief Gets current orientation of the window.
  *
  * @param[in] window The window instance
@@ -538,7 +530,7 @@ DALI_ADAPTOR_API InterceptKeyEventSignalType& InterceptKeyEventSignal(Window win
  *
  * A callback of the following type may be connected:
  * @code
- *   void YourCallbackName( Window window, Uint16Pair position );
+ *   void YourCallbackName( Window window, Dali::Window::WindowPosition position );
  * @endcode
  * The parameters are the moved x and y coordinates.
  * and window means this signal was called from what window
@@ -548,7 +540,6 @@ DALI_ADAPTOR_API InterceptKeyEventSignalType& InterceptKeyEventSignal(Window win
  */
 DALI_ADAPTOR_API MovedSignalType& MovedSignal(Window window);
 
-
 } // namespace DevelWindow
 
 } // namespace Dali
index a778346..27c9160 100644 (file)
@@ -58,7 +58,7 @@ FontClient::GlyphBufferData::GlyphBufferData()
   outlineOffsetX{0},
   outlineOffsetY{0},
   format{Pixel::A8},
-  compressionType(CompressionType::NO_COMPRESSION),
+  compressionType{CompressionType::NO_COMPRESSION},
   isColorEmoji{false},
   isColorBitmap{false},
   isBufferOwned{false}
@@ -73,6 +73,43 @@ FontClient::GlyphBufferData::~GlyphBufferData()
   }
 }
 
+FontClient::GlyphBufferData::GlyphBufferData(FontClient::GlyphBufferData&& rhs) noexcept
+: buffer{rhs.buffer},
+  width{rhs.width},
+  height{rhs.height},
+  outlineOffsetX{rhs.outlineOffsetX},
+  outlineOffsetY{rhs.outlineOffsetY},
+  format{rhs.format},
+  compressionType{rhs.compressionType},
+  isColorEmoji{rhs.isColorEmoji},
+  isColorBitmap{rhs.isColorBitmap},
+  isBufferOwned{rhs.isBufferOwned}
+{
+  // Remove moved data
+  rhs.buffer        = nullptr;
+  rhs.isBufferOwned = false;
+}
+
+FontClient::GlyphBufferData& FontClient::GlyphBufferData::operator=(FontClient::GlyphBufferData&& rhs) noexcept
+{
+  buffer          = rhs.buffer;
+  width           = rhs.width;
+  height          = rhs.height;
+  outlineOffsetX  = rhs.outlineOffsetX;
+  outlineOffsetY  = rhs.outlineOffsetY;
+  format          = rhs.format;
+  compressionType = rhs.compressionType;
+  isColorEmoji    = rhs.isColorEmoji;
+  isColorBitmap   = rhs.isColorBitmap;
+  isBufferOwned   = rhs.isBufferOwned;
+
+  // Remove moved data
+  rhs.buffer        = nullptr;
+  rhs.isBufferOwned = false;
+
+  return *this;
+}
+
 size_t FontClient::GlyphBufferData::Compress(const uint8_t* const __restrict__ inBuffer, GlyphBufferData& __restrict__ outBufferData)
 {
   size_t bufferSize                       = 0u;
@@ -81,7 +118,7 @@ size_t FontClient::GlyphBufferData::Compress(const uint8_t* const __restrict__ i
   {
     case TextAbstraction::FontClient::GlyphBufferData::CompressionType::NO_COMPRESSION:
     {
-      bufferSize = outBufferData.width * outBufferData.height * Pixel::GetBytesPerPixel(outBufferData.format);
+      bufferSize = static_cast<size_t>(outBufferData.width) * static_cast<size_t>(outBufferData.height) * static_cast<size_t>(Pixel::GetBytesPerPixel(outBufferData.format));
 
       compressedBuffer = (uint8_t*)malloc(bufferSize);
       if(DALI_UNLIKELY(compressedBuffer == nullptr))
@@ -101,7 +138,7 @@ size_t FontClient::GlyphBufferData::Compress(const uint8_t* const __restrict__ i
       const bool     considerPadding = (widthByte & 1) ? true : false;
 
       // For BIT_PER_PIXEL_4 type, we can know final compressed buffer size immediatly.
-      bufferSize       = outBufferData.height * (componentCount + (considerPadding ? 1 : 0));
+      bufferSize       = static_cast<size_t>(outBufferData.height) * static_cast<size_t>(componentCount + (considerPadding ? 1 : 0));
       compressedBuffer = (uint8_t*)malloc(bufferSize);
       if(DALI_UNLIKELY(compressedBuffer == nullptr))
       {
@@ -592,16 +629,13 @@ FontClient::~FontClient()
 {
 }
 
-FontClient::FontClient(const FontClient& handle)
-: BaseHandle(handle)
-{
-}
+FontClient::FontClient(const FontClient& handle) = default;
 
-FontClient& FontClient::operator=(const FontClient& handle)
-{
-  BaseHandle::operator=(handle);
-  return *this;
-}
+FontClient& FontClient::operator=(const FontClient& handle) = default;
+
+FontClient::FontClient(FontClient&& handle) = default;
+
+FontClient& FontClient::operator=(FontClient&& handle) = default;
 
 void FontClient::ClearCache()
 {
index 0644ddf..2f75e8c 100644 (file)
@@ -95,6 +95,21 @@ public:
      */
     ~GlyphBufferData();
 
+    /**
+     * @brief Move constructor.
+     *
+     * @param[in] rhs moved data.
+     */
+    GlyphBufferData(GlyphBufferData&& rhs) noexcept;
+
+    /**
+     * @brief Move assign operator.
+     *
+     * @param[in] rhs moved data.
+     * @return A reference to this.
+     */
+    GlyphBufferData& operator=(GlyphBufferData&& rhs) noexcept;
+
     // Compression method of buffer. Each buffer compressed line by line
     enum class CompressionType
     {
@@ -138,6 +153,12 @@ public:
      */
     static void DecompressScanline(const GlyphBufferData& inBufferData, uint8_t* outBuffer, uint32_t& offset);
 
+  private:
+    // Delete copy operation.
+    GlyphBufferData(const GlyphBufferData& rhs) = delete;
+    GlyphBufferData& operator=(const GlyphBufferData& rhs) = delete;
+
+  public:
     uint8_t*        buffer;            ///< The glyph's bitmap buffer data.
     uint32_t        width;             ///< The width of the bitmap.
     uint32_t        height;            ///< The height of the bitmap.
@@ -196,6 +217,21 @@ public:
    */
   FontClient& operator=(const FontClient& handle);
 
+  /**
+   * @brief This move constructor is required for (smart) pointer semantics.
+   *
+   * @param[in] handle A reference to the moved handle.
+   */
+  FontClient(FontClient&& handle);
+
+  /**
+   * @brief This move assignment operator is required for (smart) pointer semantics.
+   *
+   * @param [in] handle  A reference to the moved handle.
+   * @return A reference to this.
+   */
+  FontClient& operator=(FontClient&& handle);
+
   ////////////////////////////////////////
   // Font management and validation.
   ////////////////////////////////////////
index a3303a4..6f0e471 100644 (file)
@@ -81,7 +81,6 @@ public:
     mDisplayConnection(nullptr),
     mScene(),
     mFullSwapNextFrame(true),
-    mIsResizing(false),
     mDepthBufferRequired(Integration::DepthBufferAvailable::FALSE),
     mStencilBufferRequired(Integration::StencilBufferAvailable::FALSE)
   {
@@ -112,7 +111,13 @@ public:
    * @brief Return the orientation of the surface.
    * @return The orientation
    */
-  virtual int GetOrientation() const = 0;
+  virtual int GetSurfaceOrientation() const = 0;
+
+  /**
+   * @brief Return the orientation of the screen.
+   * @return The screen orientation
+   */
+  virtual int GetScreenOrientation() const = 0;
 
   /**
    * @brief InitializeGraphics the platform specific graphics surface interfaces
@@ -233,14 +238,6 @@ public:
     mFullSwapNextFrame = true;
   }
 
-  /**
-   * @brief Sets whether this surface is being resized.
-   */
-  void SetIsResizing(bool isResizing)
-  {
-    mIsResizing = isResizing;
-  }
-
 private:
   /**
    * @brief Undefined copy constructor. RenderSurface cannot be copied
@@ -258,7 +255,6 @@ protected:
   Dali::DisplayConnection*                          mDisplayConnection;
   WeakHandle<Dali::Integration::Scene>              mScene;
   bool                                              mFullSwapNextFrame; ///< Whether the full surface swap is required
-  bool                                              mIsResizing;        ///< Whether the surface is being resized
 
 private:
   Integration::DepthBufferAvailable   mDepthBufferRequired;   ///< Whether the depth buffer is required
index 13b93d7..aa033eb 100644 (file)
@@ -153,7 +153,9 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface)
 
   mScene.SurfaceReplaced();
 
-  SurfaceResized();
+  PositionSize surfacePositionSize = surface->GetPositionSize();
+
+  SurfaceResized(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height));
 
   InitializeDpi();
 
@@ -166,10 +168,9 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface)
   OnSurfaceSet(surface);
 }
 
-void SceneHolder::SurfaceResized()
+void SceneHolder::SurfaceResized(float width, float height)
 {
-  PositionSize surfacePositionSize = mSurface->GetPositionSize();
-  mScene.SurfaceResized(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height));
+  mScene.SurfaceResized(width, height);
 
   mSurface->SetFullSwapNextFrame();
 
@@ -211,8 +212,10 @@ void SceneHolder::SetAdaptor(Dali::Adaptor& adaptor)
 
   // Create the scene
   PositionSize surfacePositionSize = mSurface->GetPositionSize();
-  int          orientation         = mSurface->GetOrientation();
-  mScene                           = Dali::Integration::Scene::New(Size(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height)), orientation);
+  int          windowOrientation         = mSurface->GetSurfaceOrientation();
+  int          screenOrientation         = mSurface->GetScreenOrientation();
+
+  mScene                           = Dali::Integration::Scene::New(Size(static_cast<float>(surfacePositionSize.width), static_cast<float>(surfacePositionSize.height)), windowOrientation, screenOrientation);
 
   Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
   mAdaptor                                = &adaptorImpl;
@@ -256,9 +259,9 @@ void SceneHolder::Resume()
   OnResume();
 }
 
-void SceneHolder::SurfaceRotated(float width, float height, int orientation)
+void SceneHolder::SurfaceRotated(float width, float height, int32_t windowOrientation, int32_t screenOrientation)
 {
-  mScene.SurfaceRotated(width, height, orientation);
+  mScene.SurfaceRotated(width, height, windowOrientation, screenOrientation);
 }
 
 void SceneHolder::SetRotationCompletedAcknowledgement()
index 196e0d9..8868d52 100644 (file)
@@ -115,8 +115,10 @@ public:
 
   /**
    * @brief Called when the surface set is resized.
+   * @param[in] width the resized window's width
+   * @param[in] height the resized window's height
    */
-  void SurfaceResized();
+  void SurfaceResized(float width, float height);
 
   /**
    * @brief Get the render surface
@@ -165,9 +167,10 @@ public:
    *
    * @param[in] width The width of rotated surface
    * @param[in] height The height of rotated surface
-   * @param[in] orientation The orientation of rotated surface
+   * @param[in] windowOrientation the current window orientation
+   * @param[in] screenOrientation the current screen orientation
    */
-  void SurfaceRotated(float width, float height, int orientation);
+  void SurfaceRotated(float width, float height, int32_t windowOrientation, int32_t screenOrientation);
 
   /**
    * @brief Send message to acknowledge window rotation with current window orientation.
index 1236647..31443ff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,6 +19,8 @@
 #include <dali/internal/accessibility/bridge/bridge-accessible.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/math/math-utils.h>
+
 #include <algorithm>
 #include <iostream>
 
@@ -60,7 +62,7 @@ std::vector<std::vector<Component*>> SplitLines(const std::vector<Component*>& c
   // Find first with non-zero area
   auto first = std::find_if(children.begin(), children.end(), [](Component* child) -> bool {
     auto extents = child->GetExtents(CoordinateType::WINDOW);
-    return extents.height != 0.0f && extents.width != 0.0f;
+    return !Dali::EqualsZero(extents.height) && !Dali::EqualsZero(extents.width);
   });
 
   if(first == children.end())
@@ -78,7 +80,7 @@ std::vector<std::vector<Component*>> SplitLines(const std::vector<Component*>& c
     auto child = *it;
 
     rect = child->GetExtents(CoordinateType::WINDOW);
-    if(rect.height == 0.0f || rect.width == 0.0f)
+    if(Dali::EqualsZero(rect.height) || Dali::EqualsZero(rect.width))
     {
       // Zero area, ignore
       continue;
@@ -156,7 +158,7 @@ static bool IsObjectZeroSize(Component* obj)
     return false;
   }
   auto extents = obj->GetExtents(CoordinateType::WINDOW);
-  return extents.height == 0 || extents.width == 0;
+  return Dali::EqualsZero(extents.height) || Dali::EqualsZero(extents.width);
 }
 
 static bool IsObjectAcceptable(Component* obj)
@@ -266,7 +268,6 @@ static std::string MakeIndent(unsigned int maxRecursionDepth)
   return std::string(GET_NAVIGABLE_AT_POINT_MAX_RECURSION_DEPTH - maxRecursionDepth, ' ');
 }
 
-
 static bool IsRoleAcceptableWhenNavigatingNextPrev(Accessible* obj)
 {
   if(!obj)
index d884b92..a9fbcfe 100644 (file)
@@ -34,6 +34,7 @@
 #include <dali/integration-api/input-options.h>
 #include <dali/integration-api/processor-interface.h>
 #include <dali/integration-api/profiling.h>
+#include <dali/integration-api/trace.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/events/wheel-event.h>
 #include <dali/public-api/object/any.h>
@@ -91,6 +92,7 @@ namespace
 {
 thread_local Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer to allow Adaptor::Get
 
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false);
 } // unnamed namespace
 
 Dali::Adaptor* Adaptor::New(Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions, ThreadMode threadMode)
@@ -302,7 +304,6 @@ void Adaptor::Initialize(GraphicsFactory& graphicsFactory)
     if(0 != dir_err && errno != EEXIST)
     {
       DALI_LOG_ERROR("Error creating system cache directory: %s!\n", systemCachePath.c_str());
-      exit(1);
     }
   }
 
@@ -913,15 +914,11 @@ void Adaptor::ProcessCoreEvents()
       mPerformanceInterface->AddMarker(PerformanceInterface::PROCESS_EVENTS_START);
     }
 
-#if !defined(DALI_PROFILE_UBUNTU) && !defined(DALI_PROFILE_LIBUV_X11) && !defined(DALI_PROFILE_GLIB_X11)
-    DALI_LOG_RELEASE_INFO("Start ProcessEvents\n");
-#endif
+    DALI_TRACE_BEGIN(gTraceFilter, "DALI_PROCESS_CORE_EVENTS");
 
     mCore->ProcessEvents();
 
-#if !defined(DALI_PROFILE_UBUNTU) && !defined(DALI_PROFILE_LIBUV_X11) && !defined(DALI_PROFILE_GLIB_X11)
-    DALI_LOG_RELEASE_INFO("End ProcessEvents\n");
-#endif
+    DALI_TRACE_END(gTraceFilter, "DALI_PROCESS_CORE_EVENTS");
 
     if(mPerformanceInterface)
     {
index 350ab2a..ed56e9f 100644 (file)
@@ -683,8 +683,6 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       WindowContainer windows;
       mAdaptorInterfaces.GetWindowContainerInterface(windows);
 
-      bool sceneSurfaceResized;
-
       for(auto&& window : windows)
       {
         Dali::Integration::Scene      scene         = window->GetScene();
@@ -694,9 +692,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
         {
           Integration::RenderStatus windowRenderStatus;
 
-          // Get Surface Resized flag
-          sceneSurfaceResized = scene.IsSurfaceRectChanged();
-          windowSurface->SetIsResizing(sceneSurfaceResized);
+          const bool sceneSurfaceResized = scene.IsSurfaceRectChanged();
 
           // clear previous frame damaged render items rects, buffer history is tracked on surface level
           mDamagedRects.clear();
index b903c0c..8717f7f 100644 (file)
@@ -109,6 +109,12 @@ const uint32_t TEXTURE_UPLOAD_MAX_BUFER_SIZE_MB = 1;
 
 } // namespace
 
+EglGraphicsController::EglGraphicsController()
+: mTextureDependencyChecker(*this),
+  mSyncPool(*this)
+{
+}
+
 EglGraphicsController::~EglGraphicsController()
 {
   while(!mPresentationCommandBuffers.empty())
@@ -190,6 +196,12 @@ void EglGraphicsController::ResolvePresentRenderTarget(GLES::RenderTarget* rende
   }
 }
 
+void EglGraphicsController::PostRender()
+{
+  mTextureDependencyChecker.Reset();
+  mSyncPool.AgeSyncObjects();
+}
+
 Integration::GlAbstraction& EglGraphicsController::GetGlAbstraction()
 {
   DALI_ASSERT_DEBUG(mGlAbstraction && "Graphics controller not initialized");
@@ -451,17 +463,17 @@ void EglGraphicsController::ProcessCommandBuffer(const GLES::CommandBuffer& comm
       }
       case GLES::CommandType::DRAW:
       {
-        mCurrentContext->Flush(false, cmd.draw);
+        mCurrentContext->Flush(false, cmd.draw, mTextureDependencyChecker);
         break;
       }
       case GLES::CommandType::DRAW_INDEXED:
       {
-        mCurrentContext->Flush(false, cmd.draw);
+        mCurrentContext->Flush(false, cmd.draw, mTextureDependencyChecker);
         break;
       }
       case GLES::CommandType::DRAW_INDEXED_INDIRECT:
       {
-        mCurrentContext->Flush(false, cmd.draw);
+        mCurrentContext->Flush(false, cmd.draw, mTextureDependencyChecker);
         break;
       }
       case GLES::CommandType::SET_SCISSOR: // @todo Consider correcting for orientation here?
@@ -557,12 +569,15 @@ void EglGraphicsController::ProcessCommandBuffer(const GLES::CommandBuffer& comm
         }
 
         mCurrentContext->BeginRenderPass(cmd.beginRenderPass);
+
         break;
       }
       case GLES::CommandType::END_RENDERPASS:
       {
-        mCurrentContext->EndRenderPass();
+        mCurrentContext->EndRenderPass(mTextureDependencyChecker);
 
+        // This sync object is to enable cpu to wait for rendering to complete, not gpu.
+        // It's only needed for reading the framebuffer texture in the client.
         auto syncObject = const_cast<GLES::SyncObject*>(static_cast<const GLES::SyncObject*>(cmd.endRenderPass.syncObject));
         if(syncObject)
         {
index 8999a06..44f52ff 100644 (file)
@@ -35,6 +35,8 @@
 #include <dali/internal/graphics/gles-impl/gles-graphics-shader.h>
 #include <dali/internal/graphics/gles-impl/gles-graphics-texture.h>
 #include <dali/internal/graphics/gles-impl/gles-graphics-types.h>
+#include <dali/internal/graphics/gles-impl/gles-sync-pool.h>
+#include <dali/internal/graphics/gles-impl/gles-texture-dependency-checker.h>
 #include <dali/internal/graphics/gles-impl/gles2-graphics-memory.h>
 
 namespace Dali
@@ -51,6 +53,8 @@ namespace GLES
 {
 class CommandBuffer;
 class PipelineCache;
+class SyncPool;
+class TextureDependencyChecker;
 } // namespace GLES
 
 /**
@@ -62,9 +66,9 @@ class EglGraphicsController : public Graphics::Controller
 {
 public:
   /**
-   * @brief Deault constructor
+   * @brief Constructor
    */
-  EglGraphicsController() = default;
+  EglGraphicsController();
 
   /**
    * @brief Destructor
@@ -722,6 +726,11 @@ public:
   void ResolvePresentRenderTarget(GLES::RenderTarget* renderTarget);
 
   /**
+   * Invoked after all rendering has finished. Used to clean up sync resources
+   */
+  void PostRender();
+
+  /**
    * Creates a GLES context for the given render surface
    *
    * @param[in] surface The surface whose GLES context to be created.
@@ -767,6 +776,11 @@ public:
     return mSharedContext;
   }
 
+  GLES::SyncPool& GetSyncPool()
+  {
+    return mSyncPool;
+  }
+
 private:
   Integration::GlAbstraction*              mGlAbstraction{nullptr};
   Integration::GlContextHelperAbstraction* mGlContextHelperAbstraction{nullptr};
@@ -812,6 +826,9 @@ private:
   std::queue<const GLES::CommandBuffer*> mPresentationCommandBuffers{}; ///< Queue of reusable command buffers used by presentation engine
 
   void* mSharedContext{nullptr}; ///< Shared EGL context
+
+  GLES::TextureDependencyChecker mTextureDependencyChecker; // Checks if FBO textures need syncing
+  GLES::SyncPool                 mSyncPool;
 };
 
 } // namespace Graphics
index 1b0af65..2fa21f0 100644 (file)
@@ -20,6 +20,8 @@ SET( adaptor_graphics_gles_src_files ${adaptor_graphics_gles_src_files}
     ${adaptor_graphics_dir}/gles-impl/gles-graphics-texture.cpp
     ${adaptor_graphics_dir}/gles-impl/gles-graphics-pipeline-cache.cpp
     ${adaptor_graphics_dir}/gles-impl/gles-context.cpp
+    ${adaptor_graphics_dir}/gles-impl/gles-sync-pool.cpp
     ${adaptor_graphics_dir}/gles-impl/gles-sync-object.cpp
     ${adaptor_graphics_dir}/gles-impl/gles-framebuffer-state-cache.cpp
+    ${adaptor_graphics_dir}/gles-impl/gles-texture-dependency-checker.cpp
 )
index 06de56a..1d981bc 100644 (file)
 
 #include "gles-context.h"
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
+#include <dali/integration-api/debug.h>
 #include <dali/integration-api/gl-abstraction.h>
 #include <dali/integration-api/gl-defines.h>
 #include <dali/internal/graphics/common/graphics-interface.h>
+#include <dali/public-api/math/math-utils.h>
 
 #include "egl-graphics-controller.h"
 #include "gles-graphics-buffer.h"
@@ -27,6 +29,7 @@
 #include "gles-graphics-program.h"
 #include "gles-graphics-render-pass.h"
 #include "gles-graphics-render-target.h"
+#include "gles-texture-dependency-checker.h"
 
 #include <EGL/egl.h>
 #include <EGL/eglext.h>
@@ -231,7 +234,7 @@ Context::~Context()
   }
 }
 
-void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall)
+void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::TextureDependencyChecker& dependencyChecker)
 {
   auto& gl = *mImpl->mController.GetGL();
 
@@ -255,6 +258,13 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall)
     newProgram = static_cast<const GLES::Program*>(mImpl->mNewPipeline->GetCreateInfo().programState->program);
   }
 
+  if(!currentProgram && !newProgram)
+  {
+    // Early out if we have no program for this pipeline.
+    DALI_LOG_ERROR("No program defined for pipeline\n");
+    return;
+  }
+
   if(mImpl->mNewPipeline && mImpl->mCurrentPipeline != mImpl->mNewPipeline)
   {
     if(!currentProgram || currentProgram->GetImplementation()->GetGlProgram() != newProgram->GetImplementation()->GetGlProgram())
@@ -289,6 +299,9 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall)
       texture->InitializeResource();
     }
 
+    // Warning, this may cause glWaitSync to occur on the GPU.
+    dependencyChecker.CheckNeedsSync(this, texture);
+
     texture->Bind(binding);
 
     texture->Prepare(); // @todo also non-const.
@@ -628,7 +641,8 @@ void Context::BeginRenderPass(const BeginRenderPassDescriptor& renderPassBegin)
   else if(targetInfo.framebuffer)
   {
     // bind framebuffer and swap.
-    renderTarget.GetFramebuffer()->Bind();
+    auto framebuffer = renderTarget.GetFramebuffer();
+    framebuffer->Bind();
   }
 
   // clear (ideally cache the setup)
@@ -640,6 +654,7 @@ void Context::BeginRenderPass(const BeginRenderPassDescriptor& renderPassBegin)
   const auto& attachments = *renderPass.GetCreateInfo().attachments;
   const auto& color0      = attachments[0];
   GLuint      mask        = 0;
+
   if(color0.loadOp == AttachmentLoadOp::CLEAR)
   {
     mask |= GL_COLOR_BUFFER_BIT;
@@ -650,11 +665,11 @@ void Context::BeginRenderPass(const BeginRenderPassDescriptor& renderPassBegin)
 
     const auto clearValues = renderPassBegin.clearValues.Ptr();
 
-    if(!mImpl->mGlStateCache.mClearColorSet ||
-       mImpl->mGlStateCache.mClearColor.r != clearValues[0].color.r ||
-       mImpl->mGlStateCache.mClearColor.g != clearValues[0].color.g ||
-       mImpl->mGlStateCache.mClearColor.b != clearValues[0].color.b ||
-       mImpl->mGlStateCache.mClearColor.a != clearValues[0].color.a)
+    if(!Dali::Equals(mImpl->mGlStateCache.mClearColor.r, clearValues[0].color.r) ||
+       !Dali::Equals(mImpl->mGlStateCache.mClearColor.g, clearValues[0].color.g) ||
+       !Dali::Equals(mImpl->mGlStateCache.mClearColor.b, clearValues[0].color.b) ||
+       !Dali::Equals(mImpl->mGlStateCache.mClearColor.a, clearValues[0].color.a) ||
+       !mImpl->mGlStateCache.mClearColorSet)
     {
       gl.ClearColor(clearValues[0].color.r,
                     clearValues[0].color.g,
@@ -702,14 +717,28 @@ void Context::BeginRenderPass(const BeginRenderPassDescriptor& renderPassBegin)
   mImpl->mCurrentRenderTarget = &renderTarget;
 }
 
-void Context::EndRenderPass()
+void Context::EndRenderPass(GLES::TextureDependencyChecker& dependencyChecker)
 {
   if(mImpl->mCurrentRenderTarget)
   {
-    if(mImpl->mCurrentRenderTarget->GetFramebuffer())
+    GLES::Framebuffer* framebuffer = mImpl->mCurrentRenderTarget->GetFramebuffer();
+    if(framebuffer)
     {
       auto& gl = *mImpl->mController.GetGL();
       gl.Flush();
+
+      /* @todo Full dependency checking would need to store textures in Begin, and create
+       * fence objects here; but we're going to draw all fbos on shared context in serial,
+       * so no real need (yet). Might want to consider ensuring order of render passes,
+       * but that needs doing in the controller, and would need doing before ProcessCommandQueues.
+       *
+       * Currently up to the client to create render tasks in the right order.
+       */
+
+      /* Create fence sync objects. Other contexts can then wait on these fences before reading
+       * textures.
+       */
+      dependencyChecker.AddTextures(this, framebuffer);
     }
   }
 }
@@ -1002,13 +1031,20 @@ void Context::PrepareForNativeRendering()
   if(!mImpl->mNativeDrawContext)
   {
     EGLint configId{0u};
-    EGLint size{0u};
-    eglGetConfigs(display, nullptr, 0, &size);
-    std::vector<EGLConfig> configs;
-    configs.resize(size);
-    eglGetConfigs(display, configs.data(), configs.size(), &size);
+    eglQueryContext(display, mImpl->mController.GetSharedContext(), EGL_CONFIG_ID, &configId);
 
-    eglQueryContext(display, context, EGL_CONFIG_ID, &configId);
+    EGLint configAttribs[3];
+    configAttribs[0] = EGL_CONFIG_ID;
+    configAttribs[1] = configId;
+    configAttribs[2] = EGL_NONE;
+
+    EGLConfig config;
+    EGLint    numConfigs;
+    if(eglChooseConfig(display, configAttribs, &config, 1, &numConfigs) != EGL_TRUE)
+    {
+      DALI_LOG_ERROR("eglChooseConfig failed!\n");
+      return;
+    }
 
     auto version = int(mImpl->mController.GetGLESVersion());
 
@@ -1019,7 +1055,12 @@ void Context::PrepareForNativeRendering()
     attribs.push_back(version % 10);
     attribs.push_back(EGL_NONE);
 
-    mImpl->mNativeDrawContext = eglCreateContext(display, configs[configId], mImpl->mController.GetSharedContext(), attribs.data());
+    mImpl->mNativeDrawContext = eglCreateContext(display, config, mImpl->mController.GetSharedContext(), attribs.data());
+    if(mImpl->mNativeDrawContext == EGL_NO_CONTEXT)
+    {
+      DALI_LOG_ERROR("eglCreateContext failed!\n");
+      return;
+    }
   }
 
   eglMakeCurrent(display, drawSurface, readSurface, mImpl->mNativeDrawContext);
index 12e62cd..2345458 100644 (file)
@@ -31,6 +31,7 @@ class Pipeline;
 class RenderPass;
 class RenderTarget;
 class Texture;
+class TextureDependencyChecker;
 
 /**
  * @brief Context represents single GLES context
@@ -46,11 +47,14 @@ public:
    * @brief Flushes the context
    *
    * Flushes the context by issuing GL calls to set the required
-   * state.
+   * state. Causes a glWaitSync if any drawn textures are dependent
+   * on another context.
    *
    * @param[in] reset If true then state is reset unconditionally
+   * @param[in] drawCall the draws that need flushing
+   * @param[in] dependencyChecker The texture dependecy checker
    */
-  void Flush(bool reset, const GLES::DrawCallDescriptor& drawCall);
+  void Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES::TextureDependencyChecker& dependencyChecker);
 
   /**
    * @brief Returns context Id
@@ -125,10 +129,9 @@ public:
   void ResolveStandaloneUniforms();
 
   /**
-   * @brief Begins render pass for sepcified render target
+   * @brief Begins render pass for specified render target
    *
    * @param[in] renderPass render pass object to begin
-   * @param[in] renderTarget render target to be drawn onto
    */
   void BeginRenderPass(const BeginRenderPassDescriptor& renderPassBegin);
 
@@ -136,9 +139,9 @@ public:
    * @brief Ends render pass
    *
    * Ending render pass is necessary in order to ensure
-   * proper implicit synchronization is in place
+   * proper explicit synchronization is in place
    */
-  void EndRenderPass();
+  void EndRenderPass(TextureDependencyChecker& checker);
 
   /**
    * @brief Returns the cache of GL state in the context
index 32df147..398735e 100644 (file)
@@ -151,6 +151,15 @@ public:
 
   void SetSamplerParameter(uint32_t param, uint32_t& cacheValue, uint32_t value) const;
 
+  uint32_t GetDependencyIndex() const
+  {
+    return mDependencyIndex;
+  }
+  void SetDependencyIndex(uint32_t dependencyIndex)
+  {
+    mDependencyIndex = dependencyIndex;
+  }
+
 private:
   mutable struct SamplerStateCache
   {
@@ -166,6 +175,7 @@ private:
   uint32_t          mTextureId{0u};
   GLenum            mGlTarget{0u};
   uint32_t          mMaxMipMapLevel{0u};
+  uint32_t          mDependencyIndex{0xFFFFFFFF};
   void*             mGLOwnerContext{nullptr};
   bool              mIsCompressed{false};
 };
diff --git a/dali/internal/graphics/gles-impl/gles-sync-pool.cpp b/dali/internal/graphics/gles-impl/gles-sync-pool.cpp
new file mode 100644 (file)
index 0000000..770deb0
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2022 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/graphics/gles-impl/gles-sync-pool.h>
+
+// External Headers
+#include <dali/graphics-api/graphics-sync-object-create-info.h>
+
+// Internal Headers
+#include <dali/internal/graphics/gles-impl/egl-graphics-controller.h>
+
+namespace Dali::Graphics::GLES
+{
+AgingSyncObject::AgingSyncObject(Graphics::EglGraphicsController& controller, const Context* writeContext)
+: controller(controller),
+  writeContext(writeContext)
+{
+  auto gl = controller.GetGL();
+  if(gl)
+  {
+    glSyncObject = gl->FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
+  }
+}
+
+AgingSyncObject::~AgingSyncObject()
+{
+  auto gl = controller.GetGL();
+  if(gl && glSyncObject != nullptr)
+  {
+    gl->DeleteSync(glSyncObject);
+  }
+}
+
+SyncPool::~SyncPool() = default;
+
+AgingSyncObject* SyncPool::AllocateSyncObject(const Context* writeContext)
+{
+  std::unique_ptr<AgingSyncObject> syncObject = std::make_unique<AgingSyncObject>(mController, writeContext);
+  mSyncObjects.push_back(std::move(syncObject));
+  return mSyncObjects.back().get();
+}
+
+void SyncPool::Wait(AgingSyncObject* syncPoolObject)
+{
+  auto gl = mController.GetGL();
+  if(gl && syncPoolObject->glSyncObject != nullptr)
+  {
+    syncPoolObject->syncing = true;
+    gl->WaitSync(syncPoolObject->glSyncObject, 0, GL_TIMEOUT_IGNORED);
+  }
+}
+
+void SyncPool::FreeSyncObject(AgingSyncObject* agingSyncObject)
+{
+  auto iter = std::find_if(mSyncObjects.begin(), mSyncObjects.end(), [&agingSyncObject](AgingSyncPtrRef agingSyncPtr) { return agingSyncPtr.get() == agingSyncObject; });
+  if(iter != mSyncObjects.end())
+  {
+    iter->reset();
+  }
+}
+
+/**
+ * Age sync objects. Call at the end of each frame.
+ * When a sync object is older than 2 frames, delete it.
+ */
+void SyncPool::AgeSyncObjects()
+{
+  if(!mSyncObjects.empty())
+  {
+    // Age the remaining sync objects.
+    for(auto& agingSyncObject : mSyncObjects)
+    {
+      if(agingSyncObject != nullptr && agingSyncObject->glSyncObject != 0)
+      {
+        if(agingSyncObject->age > 0)
+        {
+          agingSyncObject->age--;
+        }
+        else
+        {
+          agingSyncObject.reset();
+        }
+      }
+    }
+  }
+  // Move any old sync objects to the end of the list, and then remove them all.
+  mSyncObjects.erase(std::remove_if(mSyncObjects.begin(), mSyncObjects.end(), [&](std::unique_ptr<AgingSyncObject>& agingSyncObject) { return agingSyncObject == nullptr; }),
+                     mSyncObjects.end());
+}
+
+} // namespace Dali::Graphics::GLES
diff --git a/dali/internal/graphics/gles-impl/gles-sync-pool.h b/dali/internal/graphics/gles-impl/gles-sync-pool.h
new file mode 100644 (file)
index 0000000..d394b03
--- /dev/null
@@ -0,0 +1,94 @@
+#ifndef DALI_GRAPHICS_GLES_SYNC_POOL_H
+#define DALI_GRAPHICS_GLES_SYNC_POOL_H
+
+/*
+ * Copyright (c) 2022 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.
+ */
+
+#include <dali/graphics-api/graphics-types.h>
+#include <dali/integration-api/gl-abstraction.h>
+#include <dali/public-api/common/vector-wrapper.h>
+
+namespace Dali::Graphics
+{
+class EglGraphicsController;
+
+namespace GLES
+{
+class Context;
+
+struct AgingSyncObject
+{
+  AgingSyncObject(Graphics::EglGraphicsController& controller, const Context* writeContext);
+  ~AgingSyncObject();
+
+  EglGraphicsController& controller;
+  const Context*         writeContext;
+  GLsync                 glSyncObject{0};
+  uint8_t                age{2};
+  bool                   syncing{false};
+};
+using AgingSyncPtrRef = std::unique_ptr<AgingSyncObject>&;
+
+/**
+ * A vector of current fence syncs. They only age if glWaitSync is called on them in the
+ * same frame they are created, otherwise they are deleted.
+ * They must be created in the writeContext, but can be synced from a readContext.
+ * (Pool per context? - probably only ever used in resource context!)
+ */
+class SyncPool
+{
+public:
+  explicit SyncPool(Graphics::EglGraphicsController& graphicsController)
+  : mController(graphicsController)
+  {
+  }
+
+  ~SyncPool();
+
+  /**
+   * Allocate a sync object in the writeContext
+   * @param writeContext
+   * @return An owned ptr to a sync object
+   */
+  AgingSyncObject* AllocateSyncObject(const Context* writeContext);
+
+  /**
+   * Wait on a sync object in any context
+   * @param syncPoolObject The object to wait on.
+   */
+  void Wait(AgingSyncObject* syncPoolObject);
+
+  /**
+   * Delete the sync object if it's not needed.
+   *
+   */
+  void FreeSyncObject(AgingSyncObject* agingSyncObject);
+
+  /**
+   * Age outstanding sync objects. Call at the end of each frame.
+   * When a sync object is older than 2 frames, delete it.
+   */
+  void AgeSyncObjects();
+
+private:
+  std::vector<std::unique_ptr<AgingSyncObject>> mSyncObjects;
+  EglGraphicsController&                        mController;
+};
+
+} // namespace GLES
+} // namespace Dali::Graphics
+
+#endif //DALI_GRAPHICS_GLES_SYNC_POOL_H
diff --git a/dali/internal/graphics/gles-impl/gles-texture-dependency-checker.cpp b/dali/internal/graphics/gles-impl/gles-texture-dependency-checker.cpp
new file mode 100644 (file)
index 0000000..0b54e89
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2022 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 "gles-texture-dependency-checker.h"
+
+// EXTERNAL INCLUDES
+#include <dali/internal/graphics/gles-impl/egl-graphics-controller.h>
+
+namespace Dali::Graphics::GLES
+{
+void TextureDependencyChecker::Reset()
+{
+  for(auto& textureDependency : mTextureDependencies)
+  {
+    for(auto texture : textureDependency.textures)
+    {
+      texture->SetDependencyIndex(0xffffffff);
+    }
+    if(!textureDependency.syncing)
+    {
+      mController.GetSyncPool().FreeSyncObject(textureDependency.agingSyncObject);
+    }
+  }
+  mTextureDependencies.clear();
+}
+
+void TextureDependencyChecker::AddTextures(const GLES::Context* writeContext, const GLES::Framebuffer* framebuffer)
+{
+  uint32_t index = mTextureDependencies.size();
+  mTextureDependencies.emplace_back();
+  TextureDependency& textureDependency = mTextureDependencies.back();
+
+  for(int i = 0; i < 3; ++i)
+  {
+    GLES::Texture* texture{nullptr};
+    switch(i)
+    {
+      case 0:
+        texture = static_cast<GLES::Texture*>(framebuffer->GetCreateInfo().colorAttachments[0].texture);
+        break;
+      case 1:
+        texture = static_cast<GLES::Texture*>(framebuffer->GetCreateInfo().depthStencilAttachment.depthTexture);
+        break;
+      case 2:
+        texture = static_cast<GLES::Texture*>(framebuffer->GetCreateInfo().depthStencilAttachment.stencilTexture);
+        break;
+    }
+    if(texture != nullptr)
+    {
+      textureDependency.textures.push_back(texture);
+      texture->SetDependencyIndex(index);
+    }
+  }
+  textureDependency.writeContext    = const_cast<GLES::Context*>(writeContext);
+  textureDependency.framebuffer     = const_cast<GLES::Framebuffer*>(framebuffer);
+  textureDependency.agingSyncObject = mController.GetSyncPool().AllocateSyncObject(writeContext);
+}
+
+void TextureDependencyChecker::CheckNeedsSync(const GLES::Context* readContext, const GLES::Texture* texture)
+{
+  uint32_t dependencyIndex = texture->GetDependencyIndex();
+  if(dependencyIndex < mTextureDependencies.size())
+  {
+    auto& textureDependency = mTextureDependencies[dependencyIndex];
+    if(!textureDependency.syncing && textureDependency.writeContext != readContext)
+    {
+      // Needs syncing!
+      textureDependency.syncing = true;
+
+      // Wait on the sync object in GPU. This will ensure that the writeContext completes its tasks prior
+      // to the sync point.
+      mController.GetSyncPool().Wait(textureDependency.agingSyncObject);
+    }
+  }
+}
+
+} // namespace Dali::Graphics::GLES
diff --git a/dali/internal/graphics/gles-impl/gles-texture-dependency-checker.h b/dali/internal/graphics/gles-impl/gles-texture-dependency-checker.h
new file mode 100644 (file)
index 0000000..8861229
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef DALI_GLES_TEXTURE_DEPENDENCY_CHECKER_H
+#define DALI_GLES_TEXTURE_DEPENDENCY_CHECKER_H
+
+/*
+ * Copyright (c) 2022 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.
+ */
+
+#include <dali/public-api/common/vector-wrapper.h>
+
+namespace Dali::Graphics
+{
+class EglGraphicsController;
+
+namespace GLES
+{
+class Context;
+class Framebuffer;
+class Texture;
+class AgingSyncObject;
+
+/**
+ * Class to handle dependency checks between textures on different
+ * GL Contexts.
+ *
+ * We have a shared (resource) context for writing to offscreen framebuffers,
+ * and separate contexts for each window/scene.
+ * If a framebuffer attachment is used in a scene, then it needs a sync point
+ * in the GPU in order to ensure that the first context finishes writing to the
+ * texture before it is read in the scene context.
+ */
+class TextureDependencyChecker
+{
+public:
+  explicit TextureDependencyChecker(EglGraphicsController& controller)
+  : mController(controller)
+  {
+  }
+
+  /**
+   * Clear all the textures. Call at the start of a frame
+   */
+  void Reset();
+
+  /**
+   * Add Texture dependencies
+   *
+   * @param[in] writeContext The context of the framebuffer's render pass
+   * @param[in] framebuffer The framebuffer to collect textures from
+   */
+  void AddTextures(const Context* writeContext, const Framebuffer* framebuffer);
+
+  /**
+   * Check if the given texture needs syncing before being read.  This
+   * will perform a glWaitSync() (GPU side semaphore) if the texture
+   * needs syncing.
+   * @param[in] readContext The context that the texture is being read (drawn with)
+   * @param[in] texture The texture being read
+   */
+  void CheckNeedsSync(const Context* readContext, const Texture* texture);
+
+private:
+  struct TextureDependency
+  {
+    std::vector<Texture*> textures;
+    Context*              writeContext{nullptr};
+    Framebuffer*          framebuffer{nullptr};
+    AgingSyncObject*      agingSyncObject;
+    bool                  syncing{false};
+  };
+  std::vector<TextureDependency> mTextureDependencies;
+  EglGraphicsController&         mController;
+};
+
+} // namespace GLES
+} // namespace Dali::Graphics
+
+#endif //DALI_GLES_TEXTURE_DEPENDENCY_CHECKER_H
index 62563e1..a963e28 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -101,6 +101,8 @@ void EglGraphics::PostRender()
   {
     mGraphicsController.GetCurrentContext()->InvalidateDepthStencilBuffers();
   }
+
+  mGraphicsController.PostRender();
 }
 
 void EglGraphics::SetFirstFrameAfterResume()
index bb6693f..bb25e3f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -56,25 +56,22 @@ NativeImageSourceAndroid* NativeImageSourceAndroid::New(uint32_t width, uint32_t
   return image;
 }
 
-NativeImageSourceAndroid::NativeImageSourceAndroid( uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
+NativeImageSourceAndroid::NativeImageSourceAndroid(uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource)
 : mWidth(width),
-  mHeight(height ),
+  mHeight(height),
   mOwnPixmap(true),
   mPixmap(NULL),
   mBlendingRequired(false),
   mColorDepth(depth),
   mEglImageKHR(NULL),
+  mEglGraphics(NULL),
   mEglImageExtensions(NULL),
   mResourceDestructionCallback()
 {
   DALI_ASSERT_ALWAYS(Adaptor::IsAvailable());
 
-  GraphicsInterface* graphics    = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
-  auto               eglGraphics = static_cast<EglGraphics*>(graphics);
-
-  mEglImageExtensions = eglGraphics->GetImageExtensions();
-
-  DALI_ASSERT_DEBUG(mEglImageExtensions);
+  GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
+  mEglGraphics                = static_cast<EglGraphics*>(graphics);
 
   // assign the pixmap
   mPixmap = static_cast<AHardwareBuffer*>(GetPixmapFromAny(nativeImageSource));
@@ -239,6 +236,9 @@ bool NativeImageSourceAndroid::IsColorDepthSupported(Dali::NativeImageSource::Co
 
 bool NativeImageSourceAndroid::CreateResource()
 {
+  mEglImageExtensions = mEglGraphics->GetImageExtensions();
+  DALI_ASSERT_DEBUG(mEglImageExtensions);
+
   // if the image existed previously delete it.
   if(mEglImageKHR != NULL)
   {
index 65397d6..feaaa2b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 Internal
 {
 namespace Adaptor
 {
+class EglGraphics;
 class EglImageExtensions;
 
 /**
@@ -210,15 +211,16 @@ private:
   void GetPixmapDetails();
 
 private:
-  uint32_t                             mWidth;                        ///< image width
-  uint32_t                             mHeight;                       ///< image heights
-  bool                                 mOwnPixmap;                    ///< Whether we created pixmap or not
-  AHardwareBuffer*                     mPixmap;                       ///<
-  bool                                 mBlendingRequired;             ///< Whether blending is required
-  Dali::NativeImageSource::ColorDepth  mColorDepth;                   ///< color depth of image
-  void*                                mEglImageKHR;                  ///< From EGL extension
-  EglImageExtensions*                  mEglImageExtensions;           ///< The EGL Image Extensions
-  std::unique_ptr<EventThreadCallback> mResourceDestructionCallback;  ///< The Resource Destruction Callback
+  uint32_t                             mWidth;                       ///< image width
+  uint32_t                             mHeight;                      ///< image heights
+  bool                                 mOwnPixmap;                   ///< Whether we created pixmap or not
+  AHardwareBuffer*                     mPixmap;                      ///<
+  bool                                 mBlendingRequired;            ///< Whether blending is required
+  Dali::NativeImageSource::ColorDepth  mColorDepth;                  ///< color depth of image
+  void*                                mEglImageKHR;                 ///< From EGL extension
+  EglGraphics*                         mEglGraphics;                 ///< EGL Graphics
+  EglImageExtensions*                  mEglImageExtensions;          ///< The EGL Image Extensions
+  std::unique_ptr<EventThreadCallback> mResourceDestructionCallback; ///< The Resource Destruction Callback
 };
 
 } // namespace Adaptor
index 4ca7dd4..88b8e1e 100644 (file)
@@ -1078,6 +1078,11 @@ bool ReadHeader(LoaderInfo&      loaderInfo,
         }
       }
     }
+    else
+    {
+      success = false;
+      DALI_LOG_ERROR("LOAD_ERROR_UNKNOWN_FORMAT\n");
+    }
   }
   return success;
 }
@@ -1396,7 +1401,7 @@ public:
     mLoadSucceeded(false),
     mMutex()
   {
-    loaderInfo.gifAccessor = nullptr;
+    loaderInfo.gifAccessor              = nullptr;
     loaderInfo.fileData.fileName        = mUrl.c_str();
     loaderInfo.fileData.isLocalResource = isLocalResource;
   }
@@ -1411,6 +1416,10 @@ public:
     }
 
     mLoadSucceeded = ReadHeader(loaderInfo, imageProperties);
+    if(!mLoadSucceeded)
+    {
+      DALI_LOG_ERROR("ReadHeader is failed [%s]\n", mUrl.c_str());
+    }
     return mLoadSucceeded;
   }
 
index 675388e..6123e61 100644 (file)
@@ -2289,19 +2289,19 @@ void Resample(const unsigned char* __restrict__ inPixels,
   }
 }
 
-void LanczosSample4BPP(const unsigned char* __restrict__ inPixels,
+void LanczosSample4BPP(const uint8_t* __restrict__ inPixels,
                        ImageDimensions inputDimensions,
-                       unsigned int    inputStride,
-                       unsigned char* __restrict__ outPixels,
+                       uint32_t        inputStride,
+                       uint8_t* __restrict__ outPixels,
                        ImageDimensions desiredDimensions)
 {
   Resample(inPixels, inputDimensions, inputStride, outPixels, desiredDimensions, Resampler::LANCZOS4, 4, true);
 }
 
-void LanczosSample1BPP(const unsigned char* __restrict__ inPixels,
+void LanczosSample1BPP(const uint8_t* __restrict__ inPixels,
                        ImageDimensions inputDimensions,
-                       unsigned int    inputStride,
-                       unsigned char* __restrict__ outPixels,
+                       uint32_t        inputStride,
+                       uint8_t* __restrict__ outPixels,
                        ImageDimensions desiredDimensions)
 {
   // For L8 images
@@ -2309,11 +2309,11 @@ void LanczosSample1BPP(const unsigned char* __restrict__ inPixels,
 }
 
 // Dispatch to a format-appropriate third-party resampling function:
-void LanczosSample(const unsigned char* __restrict__ inPixels,
+void LanczosSample(const uint8_t* __restrict__ inPixels,
                    ImageDimensions inDimensions,
-                   unsigned int    inStride,
+                   uint32_t        inStride,
                    Pixel::Format   pixelFormat,
-                   unsigned char* __restrict__ outPixels,
+                   uint8_t* __restrict__ outPixels,
                    ImageDimensions outDimensions)
 {
   // Check the pixel format is one that is supported:
@@ -2341,25 +2341,25 @@ void LanczosSample(const unsigned char* __restrict__ inPixels,
   }
   else
   {
-    DALI_LOG_INFO(gImageOpsLogFilter, Dali::Integration::Log::Verbose, "Bitmap was not lanczos sampled: unsupported pixel format: %u.\n", unsigned(pixelFormat));
+    DALI_LOG_INFO(gImageOpsLogFilter, Dali::Integration::Log::Verbose, "Bitmap was not lanczos sampled: unsupported pixel format: %u.\n", static_cast<uint32_t>(pixelFormat));
   }
 }
 
 void RotateByShear(const uint8_t* const pixelsIn,
-                   unsigned int         widthIn,
-                   unsigned int         heightIn,
-                   unsigned int         strideIn,
-                   unsigned int         pixelSize,
+                   uint32_t             widthIn,
+                   uint32_t             heightIn,
+                   uint32_t             strideIn,
+                   uint32_t             pixelSize,
                    float                radians,
                    uint8_t*&            pixelsOut,
-                   unsigned int&        widthOut,
-                   unsigned int&        heightOut)
+                   uint32_t&            widthOut,
+                   uint32_t&            heightOut)
 {
   // @note Code got from https://www.codeproject.com/Articles/202/High-quality-image-rotation-rotate-by-shear by Eran Yariv.
 
   // Do first the fast rotations to transform the angle into a (-45..45] range.
 
-  float fastRotationPerformed = false;
+  bool fastRotationPerformed = false;
   if((radians > Math::PI_4) && (radians <= RAD_135))
   {
     // Angle in (45.0 .. 135.0]
@@ -2447,7 +2447,7 @@ void RotateByShear(const uint8_t* const pixelsIn,
   const uint8_t* const                      firstHorizontalSkewPixelsIn = fastRotationPerformed ? pixelsOut : pixelsIn;
   std::unique_ptr<uint8_t, void (*)(void*)> tmpPixelsInPtr((fastRotationPerformed ? pixelsOut : nullptr), free);
 
-  unsigned int stride = fastRotationPerformed ? widthOut : strideIn;
+  uint32_t stride = fastRotationPerformed ? widthOut : strideIn;
 
   // Reset the input/output
   widthIn   = widthOut;
@@ -2464,7 +2464,7 @@ void RotateByShear(const uint8_t* const pixelsIn,
 
   // Calculate first shear (horizontal) destination image dimensions
 
-  widthOut  = widthIn + static_cast<unsigned int>(fabs(angleTangent) * static_cast<float>(heightIn));
+  widthOut  = widthIn + static_cast<uint32_t>(fabs(angleTangent) * static_cast<float>(heightIn));
   heightOut = heightIn;
 
   // Allocate the buffer for the 1st shear
@@ -2482,7 +2482,7 @@ void RotateByShear(const uint8_t* const pixelsIn,
     return;
   }
 
-  for(unsigned int y = 0u; y < heightOut; ++y)
+  for(uint32_t y = 0u; y < heightOut; ++y)
   {
     const float shear = angleTangent * ((angleTangent >= 0.f) ? (0.5f + static_cast<float>(y)) : (0.5f + static_cast<float>(y) - static_cast<float>(heightOut)));
 
@@ -2492,8 +2492,8 @@ void RotateByShear(const uint8_t* const pixelsIn,
 
   // Reset the 'pixel in' pointer with the output of the 'First Horizontal Skew' and free the memory allocated by the 'Fast Rotations'.
   tmpPixelsInPtr.reset(pixelsOut);
-  unsigned int tmpWidthIn  = widthOut;
-  unsigned int tmpHeightIn = heightOut;
+  uint32_t tmpWidthIn  = widthOut;
+  uint32_t tmpHeightIn = heightOut;
 
   // Reset the input/output
   pixelsOut = nullptr;
@@ -2503,7 +2503,7 @@ void RotateByShear(const uint8_t* const pixelsIn,
   ///////////////////////////////////////
 
   // Calc 2nd shear (vertical) destination image dimensions
-  heightOut = static_cast<unsigned int>(static_cast<float>(widthIn) * fabs(angleSinus) + static_cast<float>(heightIn) * angleCosinus);
+  heightOut = static_cast<uint32_t>(static_cast<float>(widthIn) * fabs(angleSinus) + static_cast<float>(heightIn) * angleCosinus);
 
   // Allocate the buffer for the 2nd shear
   pixelsOut = static_cast<uint8_t*>(malloc(widthOut * heightOut * pixelSize));
@@ -2522,10 +2522,10 @@ void RotateByShear(const uint8_t* const pixelsIn,
   // Variable skew offset
   float offset = angleSinus * ((angleSinus > 0.f) ? static_cast<float>(widthIn - 1u) : -(static_cast<float>(widthIn) - static_cast<float>(widthOut)));
 
-  unsigned int column = 0u;
+  uint32_t column = 0u;
   for(column = 0u; column < widthOut; ++column, offset -= angleSinus)
   {
-    const int shear = static_cast<int>(floor(offset));
+    const int32_t shear = static_cast<int32_t>(floor(offset));
     VerticalSkew(tmpPixelsInPtr.get(), tmpWidthIn, tmpHeightIn, tmpWidthIn, pixelSize, pixelsOut, widthOut, heightOut, column, shear, offset - static_cast<float>(shear));
   }
   // Reset the 'pixel in' pointer with the output of the 'Vertical Skew' and free the memory allocated by the 'First Horizontal Skew'.
@@ -2540,7 +2540,7 @@ void RotateByShear(const uint8_t* const pixelsIn,
   ///////////////////////////////////////
 
   // Calc 3rd shear (horizontal) destination image dimensions
-  widthOut = static_cast<unsigned int>(static_cast<float>(heightIn) * fabs(angleSinus) + static_cast<float>(widthIn) * angleCosinus) + 1u;
+  widthOut = static_cast<uint32_t>(static_cast<float>(heightIn) * fabs(angleSinus) + static_cast<float>(widthIn) * angleCosinus) + 1u;
 
   // Allocate the buffer for the 3rd shear
   pixelsOut = static_cast<uint8_t*>(malloc(widthOut * heightOut * pixelSize));
@@ -2558,9 +2558,9 @@ void RotateByShear(const uint8_t* const pixelsIn,
 
   offset = (angleSinus >= 0.f) ? -angleSinus * angleTangent * static_cast<float>(widthIn - 1u) : angleTangent * (static_cast<float>(widthIn - 1u) * -angleSinus + (1.f - static_cast<float>(heightOut)));
 
-  for(unsigned int y = 0u; y < heightOut; ++y, offset += angleTangent)
+  for(uint32_t y = 0u; y < heightOut; ++y, offset += angleTangent)
   {
-    const int shear = static_cast<int>(floor(offset));
+    const int32_t shear = static_cast<int32_t>(floor(offset));
     HorizontalSkew(tmpPixelsInPtr.get(), tmpWidthIn, tmpWidthIn, pixelSize, pixelsOut, widthOut, y, shear, offset - static_cast<float>(shear));
   }
 
@@ -2569,14 +2569,14 @@ void RotateByShear(const uint8_t* const pixelsIn,
 }
 
 void HorizontalShear(const uint8_t* const pixelsIn,
-                     unsigned int         widthIn,
-                     unsigned int         heightIn,
-                     unsigned int         strideIn,
-                     unsigned int         pixelSize,
+                     uint32_t             widthIn,
+                     uint32_t             heightIn,
+                     uint32_t             strideIn,
+                     uint32_t             pixelSize,
                      float                radians,
                      uint8_t*&            pixelsOut,
-                     unsigned int&        widthOut,
-                     unsigned int&        heightOut)
+                     uint32_t&            widthOut,
+                     uint32_t&            heightOut)
 {
   // Calculate the destination image dimensions.
 
@@ -2592,7 +2592,7 @@ void HorizontalShear(const uint8_t* const pixelsIn,
     return;
   }
 
-  widthOut  = widthIn + static_cast<unsigned int>(ceil(absRadians * static_cast<float>(heightIn)));
+  widthOut  = widthIn + static_cast<uint32_t>(ceil(absRadians * static_cast<float>(heightIn)));
   heightOut = heightIn;
 
   // Allocate the buffer for the shear.
@@ -2607,11 +2607,11 @@ void HorizontalShear(const uint8_t* const pixelsIn,
     return;
   }
 
-  for(unsigned int y = 0u; y < heightOut; ++y)
+  for(uint32_t y = 0u; y < heightOut; ++y)
   {
     const float shear = radians * ((radians >= 0.f) ? (0.5f + static_cast<float>(y)) : (0.5f + static_cast<float>(y) - static_cast<float>(heightOut)));
 
-    const int intShear = static_cast<int>(floor(shear));
+    const int32_t intShear = static_cast<int32_t>(floor(shear));
     HorizontalSkew(pixelsIn, widthIn, strideIn, pixelSize, pixelsOut, widthOut, y, intShear, shear - static_cast<float>(intShear));
   }
 }
index 533db68..f4a1743 100644 (file)
@@ -43,11 +43,11 @@ constexpr uint32_t BRIGHTNESS_CONSTANT_G = 587;
 constexpr uint32_t BRIGHTNESS_CONSTANT_B = 114;
 } // namespace
 
-PixelBuffer::PixelBuffer(unsigned char*      buffer,
-                         unsigned int        bufferSize,
-                         unsigned int        width,
-                         unsigned int        height,
-                         unsigned int        stride,
+PixelBuffer::PixelBuffer(uint8_t*            buffer,
+                         uint32_t            bufferSize,
+                         uint32_t            width,
+                         uint32_t            height,
+                         uint32_t            stride,
                          Dali::Pixel::Format pixelFormat)
 : mMetadata(),
   mBuffer(buffer),
@@ -65,24 +65,24 @@ PixelBuffer::~PixelBuffer()
   ReleaseBuffer();
 }
 
-PixelBufferPtr PixelBuffer::New(unsigned int        width,
-                                unsigned int        height,
+PixelBufferPtr PixelBuffer::New(uint32_t            width,
+                                uint32_t            height,
                                 Dali::Pixel::Format pixelFormat)
 {
-  unsigned int   bufferSize = width * height * Dali::Pixel::GetBytesPerPixel(pixelFormat);
-  unsigned char* buffer     = NULL;
+  uint32_t bufferSize = width * height * Dali::Pixel::GetBytesPerPixel(pixelFormat);
+  uint8_t* buffer     = NULL;
   if(bufferSize > 0)
   {
-    buffer = static_cast<unsigned char*>(malloc(bufferSize));
+    buffer = static_cast<uint8_t*>(malloc(bufferSize));
   }
   return new PixelBuffer(buffer, bufferSize, width, height, width, pixelFormat);
 }
 
-PixelBufferPtr PixelBuffer::New(unsigned char*      buffer,
-                                unsigned int        bufferSize,
-                                unsigned int        width,
-                                unsigned int        height,
-                                unsigned int        stride,
+PixelBufferPtr PixelBuffer::New(uint8_t*            buffer,
+                                uint32_t            bufferSize,
+                                uint32_t            width,
+                                uint32_t            height,
+                                uint32_t            stride,
                                 Dali::Pixel::Format pixelFormat)
 {
   return new PixelBuffer(buffer, bufferSize, width, height, stride, pixelFormat);
@@ -106,12 +106,12 @@ Dali::PixelData PixelBuffer::Convert(PixelBuffer& pixelBuffer)
   return pixelData;
 }
 
-unsigned int PixelBuffer::GetWidth() const
+uint32_t PixelBuffer::GetWidth() const
 {
   return mWidth;
 }
 
-unsigned int PixelBuffer::GetHeight() const
+uint32_t PixelBuffer::GetHeight() const
 {
   return mHeight;
 }
@@ -126,28 +126,28 @@ Dali::Pixel::Format PixelBuffer::GetPixelFormat() const
   return mPixelFormat;
 }
 
-unsigned char* PixelBuffer::GetBuffer() const
+uint8_t* PixelBuffer::GetBuffer() const
 {
   return mBuffer;
 }
 
-const unsigned char* const PixelBuffer::GetConstBuffer() const
+const uint8_t* PixelBuffer::GetConstBuffer() const
 {
   return mBuffer;
 }
 
-unsigned int PixelBuffer::GetBufferSize() const
+uint32_t PixelBuffer::GetBufferSize() const
 {
   return mBufferSize;
 }
 
 Dali::PixelData PixelBuffer::CreatePixelData() const
 {
-  unsigned char* destBuffer = NULL;
+  uint8_t* destBuffer = NULL;
 
   if(mBufferSize > 0)
   {
-    destBuffer = static_cast<unsigned char*>(malloc(mBufferSize));
+    destBuffer = static_cast<uint8_t*>(malloc(mBufferSize));
     memcpy(destBuffer, mBuffer, mBufferSize);
   }
 
@@ -349,12 +349,12 @@ PixelBufferPtr PixelBuffer::NewCrop(const PixelBuffer& inBuffer, uint16_t x, uin
     destStride = (inBuffer.mWidth - x) * bytesPerPixel;
   }
 
-  int            srcOffset  = x * bytesPerPixel + y * srcStride;
-  int            destOffset = 0;
-  unsigned char* destBuffer = outBuffer->mBuffer;
+  int      srcOffset  = x * bytesPerPixel + y * srcStride;
+  int      destOffset = 0;
+  uint8_t* destBuffer = outBuffer->mBuffer;
 
   // Clamp crop to last row
-  unsigned int endRow = y + cropDimensions.GetHeight();
+  uint16_t endRow = y + cropDimensions.GetHeight();
   if(endRow > inBuffer.mHeight)
   {
     endRow = inBuffer.mHeight - 1;
@@ -456,9 +456,9 @@ void PixelBuffer::MultiplyColorByAlpha()
   // must be skipped in such case
   if(Pixel::GetBytesPerPixel(mPixelFormat) && Pixel::HasAlpha(mPixelFormat))
   {
-    unsigned char*     pixel       = mBuffer;
-    const unsigned int strideBytes = mStride * bytesPerPixel;
-    const unsigned int widthBytes  = mWidth * bytesPerPixel;
+    uint8_t*       pixel       = mBuffer;
+    const uint32_t strideBytes = mStride * bytesPerPixel;
+    const uint32_t widthBytes  = mWidth * bytesPerPixel;
 
     // Collect all valid channel list before lookup whole buffer
     std::vector<Channel> validChannelList;
@@ -472,11 +472,11 @@ void PixelBuffer::MultiplyColorByAlpha()
 
     if(DALI_LIKELY(!validChannelList.empty()))
     {
-      for(unsigned int y = 0; y < mHeight; y++)
+      for(uint32_t y = 0; y < mHeight; y++)
       {
-        for(unsigned int x = 0; x < widthBytes; x += bytesPerPixel)
+        for(uint32_t x = 0; x < widthBytes; x += bytesPerPixel)
         {
-          unsigned int alpha = ReadChannel(&pixel[x], mPixelFormat, Adaptor::ALPHA);
+          uint32_t alpha = ReadChannel(&pixel[x], mPixelFormat, Adaptor::ALPHA);
           if(alpha < 255)
           {
             // If alpha is 255, we don't need to change color. Skip current pixel
@@ -515,7 +515,7 @@ uint32_t PixelBuffer::GetBrightness() const
 
   if(bytesPerPixel && mWidth && mHeight)
   {
-    unsigned char* pixel       = mBuffer;
+    uint8_t*       pixel       = mBuffer;
     const uint32_t strideBytes = mStride * bytesPerPixel;
     const uint32_t widthBytes  = mWidth * bytesPerPixel;
     const uint32_t bufferSize  = mWidth * mHeight;
@@ -524,9 +524,9 @@ uint32_t PixelBuffer::GetBrightness() const
     uint64_t green = 0;
     uint64_t blue  = 0;
 
-    for(unsigned int y = 0; y < mHeight; y++)
+    for(uint32_t y = 0; y < mHeight; y++)
     {
-      for(unsigned int x = 0; x < widthBytes; x += bytesPerPixel)
+      for(uint32_t x = 0; x < widthBytes; x += bytesPerPixel)
       {
         red += ReadChannel(&pixel[x], mPixelFormat, Adaptor::RED);
         green += ReadChannel(&pixel[x], mPixelFormat, Adaptor::GREEN);
index 6e02f3c..0866dd4 100644 (file)
@@ -49,8 +49,8 @@ public:
    * @param [in] height           Buffer height in pixels
    * @param [in] pixelFormat      The pixel format
    */
-  static PixelBufferPtr New(unsigned int  width,
-                            unsigned int  height,
+  static PixelBufferPtr New(uint32_t      width,
+                            uint32_t      height,
                             Pixel::Format pixelFormat);
 
   /**
@@ -63,12 +63,12 @@ public:
    * @param [in] stride           Buffer stride in pixels, 0 means the buffer is tightly packed
    * @param [in] pixelFormat      The pixel format
    */
-  static PixelBufferPtr New(unsigned char* buffer,
-                            unsigned int   bufferSize,
-                            unsigned int   width,
-                            unsigned int   height,
-                            unsigned int   stride,
-                            Pixel::Format  pixelFormat);
+  static PixelBufferPtr New(uint8_t*      buffer,
+                            uint32_t      bufferSize,
+                            uint32_t      width,
+                            uint32_t      height,
+                            uint32_t      stride,
+                            Pixel::Format pixelFormat);
 
   /**
    * Convert a pixelBuffer object into a PixelData object.
@@ -89,12 +89,12 @@ public:
    * @param [in] stride           Buffer stride in pixels, 0 means the buffer is tightly packed
    * @param [in] pixelFormat      The pixel format
    */
-  PixelBuffer(unsigned char* buffer,
-              unsigned int   bufferSize,
-              unsigned int   width,
-              unsigned int   height,
-              unsigned int   stride,
-              Pixel::Format  pixelFormat);
+  PixelBuffer(uint8_t*      buffer,
+              uint32_t      bufferSize,
+              uint32_t      width,
+              uint32_t      height,
+              uint32_t      stride,
+              Pixel::Format pixelFormat);
 
 protected:
   /**
@@ -109,19 +109,19 @@ public:
    * Get the width of the buffer in pixels.
    * @return The width of the buffer in pixels
    */
-  unsigned int GetWidth() const;
+  uint32_t GetWidth() const;
 
   /**
    * Get the height of the buffer in pixels
    * @return The height of the buffer in pixels
    */
-  unsigned int GetHeight() const;
+  uint32_t GetHeight() const;
 
   /**
    * @brief Gets the stride of the buffer in pixels.
    * @return The stride of the buffer in pixels. 0 means the buffer is tightly packed.
    */
-  unsigned int GetStride() const;
+  uint32_t GetStride() const;
 
   /**
    * Get the pixel format
@@ -133,18 +133,18 @@ public:
    * Get the pixel buffer if it's present.
    * @return The buffer if exists, or NULL if there is no pixel buffer.
    */
-  unsigned char* GetBuffer() const;
+  uint8_t* GetBuffer() const;
 
   /**
    * @copydoc Devel::PixelBuffer::GetBuffer()
    */
-  const unsigned char* const GetConstBuffer() const;
+  const uint8_t* GetConstBuffer() const;
 
   /**
    * Get the size of the buffer in bytes
    * @return The size of the buffer
    */
-  unsigned int GetBufferSize() const;
+  uint32_t GetBufferSize() const;
 
   /**
    * Copy the buffer into a new PixelData
index 5ae65a1..7c4f911 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -92,17 +92,14 @@ NativeImageSourceX::NativeImageSourceX(uint32_t width, uint32_t height, Dali::Na
   mBlendingRequired(false),
   mColorDepth(depth),
   mEglImageKHR(NULL),
+  mEglGraphics(NULL),
   mEglImageExtensions(NULL),
   mResourceDestructionCallback()
 {
   DALI_ASSERT_ALWAYS(Adaptor::IsAvailable());
 
-  GraphicsInterface* graphics    = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
-  auto               eglGraphics = static_cast<EglGraphics*>(graphics);
-
-  mEglImageExtensions = eglGraphics->GetImageExtensions();
-
-  DALI_ASSERT_DEBUG(mEglImageExtensions);
+  GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
+  mEglGraphics                = static_cast<EglGraphics*>(graphics);
 
   // assign the pixmap
   mPixmap = GetPixmapFromAny(nativeImageSource);
@@ -287,6 +284,9 @@ bool NativeImageSourceX::IsColorDepthSupported(Dali::NativeImageSource::ColorDep
 
 bool NativeImageSourceX::CreateResource()
 {
+  mEglImageExtensions = mEglGraphics->GetImageExtensions();
+  DALI_ASSERT_DEBUG(mEglImageExtensions);
+
   // if the image existed previously delete it.
   if(mEglImageKHR != NULL)
   {
index 6f49953..38b5dac 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -23,8 +23,8 @@
 #include <memory>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/native-image-source.h>
 #include <dali/internal/imaging/common/native-image-source-impl.h>
+#include <dali/public-api/adaptor-framework/native-image-source.h>
 
 namespace Dali
 {
@@ -32,6 +32,7 @@ namespace Internal
 {
 namespace Adaptor
 {
+class EglGraphics;
 class EglImageExtensions;
 
 /**
@@ -209,15 +210,16 @@ private:
   void GetPixmapDetails();
 
 private:
-  uint32_t                             mWidth;                        ///< image width
-  uint32_t                             mHeight;                       ///< image heights
-  bool                                 mOwnPixmap;                    ///< Whether we created pixmap or not
-  Ecore_X_Pixmap                       mPixmap;                       ///< From Xlib
-  bool                                 mBlendingRequired;             ///< Whether blending is required
-  Dali::NativeImageSource::ColorDepth  mColorDepth;                   ///< color depth of image
-  void*                                mEglImageKHR;                  ///< From EGL extension
-  EglImageExtensions*                  mEglImageExtensions;           ///< The EGL Image Extensions
-  std::unique_ptr<EventThreadCallback> mResourceDestructionCallback;  ///< The Resource Destruction Callback
+  uint32_t                             mWidth;                       ///< image width
+  uint32_t                             mHeight;                      ///< image heights
+  bool                                 mOwnPixmap;                   ///< Whether we created pixmap or not
+  Ecore_X_Pixmap                       mPixmap;                      ///< From Xlib
+  bool                                 mBlendingRequired;            ///< Whether blending is required
+  Dali::NativeImageSource::ColorDepth  mColorDepth;                  ///< color depth of image
+  void*                                mEglImageKHR;                 ///< From EGL extension
+  EglGraphics*                         mEglGraphics;                 ///< EGL Graphics
+  EglImageExtensions*                  mEglImageExtensions;          ///< The EGL Image Extensions
+  std::unique_ptr<EventThreadCallback> mResourceDestructionCallback; ///< The Resource Destruction Callback
 };
 
 } // namespace Adaptor
index 44742ee..c234e03 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -58,17 +58,14 @@ NativeImageSourceWin::NativeImageSourceWin(unsigned int width, unsigned int heig
   mBlendingRequired(false),
   mColorDepth(depth),
   mEglImageKHR(NULL),
+  mEglGraphics(NULL),
   mEglImageExtensions(NULL),
   mResourceDestructionCallback()
 {
   DALI_ASSERT_ALWAYS(Adaptor::IsAvailable());
 
-  GraphicsInterface* graphics    = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
-  auto               eglGraphics = static_cast<EglGraphics*>(graphics);
-
-  mEglImageExtensions = eglGraphics->GetImageExtensions();
-
-  DALI_ASSERT_DEBUG(mEglImageExtensions);
+  GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
+  mEglGraphics                = static_cast<EglGraphics*>(graphics);
 
   // assign the pixmap
   mPixmap = GetPixmapFromAny(nativeImageSource);
@@ -138,6 +135,9 @@ bool NativeImageSourceWin::IsColorDepthSupported(Dali::NativeImageSource::ColorD
 
 bool NativeImageSourceWin::CreateResource()
 {
+  mEglImageExtensions = mEglGraphics->GetImageExtensions();
+  DALI_ASSERT_DEBUG(mEglImageExtensions);
+
   // if the image existed previously delete it.
   if(mEglImageKHR != NULL)
   {
index 81e2ab2..eb05a9e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -29,6 +29,7 @@ namespace Internal
 {
 namespace Adaptor
 {
+class EglGraphics;
 class EglImageExtensions;
 
 /**
@@ -206,15 +207,16 @@ private:
   void GetPixmapDetails();
 
 private:
-  unsigned int                        mWidth;                         ///< image width
-  unsigned int                        mHeight;                        ///< image heights
-  bool                                mOwnPixmap;                     ///< Whether we created pixmap or not
-  unsigned int                        mPixmap;                        ///< From Windows
-  bool                                mBlendingRequired;              ///< Whether blending is required
-  Dali::NativeImageSource::ColorDepth mColorDepth;                    ///< color depth of image
-  void*                               mEglImageKHR;                   ///< From EGL extension
-  EglImageExtensions*                 mEglImageExtensions;            ///< The EGL Image Extensions
-  std::unique_ptr<EventThreadCallback> mResourceDestructionCallback;  ///< The Resource Destruction Callback
+  unsigned int                         mWidth;                       ///< image width
+  unsigned int                         mHeight;                      ///< image heights
+  bool                                 mOwnPixmap;                   ///< Whether we created pixmap or not
+  unsigned int                         mPixmap;                      ///< From Windows
+  bool                                 mBlendingRequired;            ///< Whether blending is required
+  Dali::NativeImageSource::ColorDepth  mColorDepth;                  ///< color depth of image
+  void*                                mEglImageKHR;                 ///< From EGL extension
+  EglGraphics*                         mEglGraphics;                 ///< EGL Graphics
+  EglImageExtensions*                  mEglImageExtensions;          ///< The EGL Image Extensions
+  std::unique_ptr<EventThreadCallback> mResourceDestructionCallback; ///< The Resource Destruction Callback
 };
 
 } // namespace Adaptor
index 804ad6a..d81e456 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -164,7 +164,7 @@ void NetworkPerformanceServer::ClientThread(NetworkPerformanceClient* client)
       unsigned int bytesRead;
 
       bool ok = socket.Read(buffer, sizeof(buffer), bytesRead);
-      if(ok && (bytesRead > 0))
+      if(ok && (bytesRead > 0) && (bytesRead <= SOCKET_READ_BUFFER_SIZE))
       {
         client->ProcessCommand(buffer, bytesRead);
       }
index a451de9..afa9d7e 100644 (file)
@@ -224,8 +224,8 @@ struct BidirectionalSupport::Plugin
     }
 
     // Copy embedded levels as fribidi_reorder_line() may change them.
-    const uint32_t embeddedLevelsSize = numberOfCharacters * sizeof(FriBidiLevel);
-    FriBidiLevel*  embeddedLevels     = reinterpret_cast<FriBidiLevel*>(malloc(embeddedLevelsSize));
+    const size_t  embeddedLevelsSize = static_cast<std::size_t>(numberOfCharacters) * sizeof(FriBidiLevel);
+    FriBidiLevel* embeddedLevels     = reinterpret_cast<FriBidiLevel*>(malloc(embeddedLevelsSize));
     if(embeddedLevels)
     {
       memcpy(embeddedLevels, bidirectionalInfo->embeddedLevels + firstCharacterIndex, embeddedLevelsSize);
index 2a44fde..6715e54 100644 (file)
@@ -1043,7 +1043,7 @@ FontId FontClient::Plugin::CreateFont(const FontPath& path,
       int             fixedSizeIndex  = 0;
       for(; fixedSizeIndex < ftFace->num_fixed_sizes; ++fixedSizeIndex)
       {
-        const PointSize26Dot6 fixedSize = ftFace->available_sizes[fixedSizeIndex].size;
+        const PointSize26Dot6 fixedSize = static_cast<PointSize26Dot6>(ftFace->available_sizes[fixedSizeIndex].size);
         DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, "  size index : %d, size : %d\n", fixedSizeIndex, fixedSize);
 
         if(fixedSize >= requestedPointSize)
@@ -1057,7 +1057,7 @@ FontId FontClient::Plugin::CreateFont(const FontPath& path,
       {
         // The requested point size is bigger than the bigest fixed size.
         fixedSizeIndex  = ftFace->num_fixed_sizes - 1;
-        actualPointSize = ftFace->available_sizes[fixedSizeIndex].size;
+        actualPointSize = static_cast<PointSize26Dot6>(ftFace->available_sizes[fixedSizeIndex].size);
       }
 
       DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, "  size index : %d, actual size : %d\n", fixedSizeIndex, actualPointSize);
index 41e8205..4a99c5a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-// EXTERNAL INCLUDES
+// CLASS HEADER
 #include <dali/internal/trace/tizen/trace-manager-impl-tizen.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
 #include <ttrace.h>
 
 // INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
 
 namespace Dali
 {
@@ -27,9 +31,21 @@ namespace Internal
 {
 namespace Adaptor
 {
+namespace
+{
+const char* DALI_TRACE_ENABLE_PRINT_LOG_ENV = "DALI_TRACE_ENABLE_PRINT_LOG";
+static bool gTraceManagerEnablePrintLog     = false;
+
+} // namespace
+
 TraceManagerTizen::TraceManagerTizen(PerformanceInterface* performanceInterface)
 : TraceManager(performanceInterface)
 {
+  const char* enablePrintLog = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_TRACE_ENABLE_PRINT_LOG_ENV);
+  if(enablePrintLog && std::atoi(enablePrintLog) != 0)
+  {
+    gTraceManagerEnablePrintLog = true;
+  }
 }
 
 Dali::Integration::Trace::LogContextFunction TraceManagerTizen::GetLogContextFunction()
@@ -42,10 +58,20 @@ void TraceManagerTizen::LogContext(bool start, const char* tag)
   if(start)
   {
     traceBegin(TTRACE_TAG_GRAPHICS, tag);
+
+    if(gTraceManagerEnablePrintLog)
+    {
+      DALI_LOG_RELEASE_INFO("BEGIN: %s\n", tag);
+    }
   }
   else
   {
     traceEnd(TTRACE_TAG_GRAPHICS);
+
+    if(gTraceManagerEnablePrintLog)
+    {
+      DALI_LOG_RELEASE_INFO("END: %s\n", tag);
+    }
   }
 }
 
index 004af89..abab78f 100644 (file)
@@ -386,7 +386,7 @@ int WindowBaseAndroid::CreateFramePresentedSyncFence()
   return -1;
 }
 
-int WindowBaseAndroid::GetOrientation() const
+int WindowBaseAndroid::GetWindowRotationAngle() const
 {
   return 0;
 }
index 9f1b797..6be667e 100644 (file)
@@ -399,9 +399,9 @@ public:
   int CreateFramePresentedSyncFence() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
    */
-  int GetOrientation() const override;
+  int GetWindowRotationAngle() const override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetPositionSizeWithAngle()
index 536cd56..db58107 100644 (file)
@@ -680,7 +680,6 @@ WindowOrientation GlWindow::ConvertToOrientation(int angle) const
 
 WindowOrientation GlWindow::GetCurrentOrientation() const
 {
-  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), GetCurrentOrientation(): %d\n", this, mNativeWindowId, mTotalRotationAngle);
   return ConvertToOrientation(mTotalRotationAngle);
 }
 
index 0e0091a..d0115ed 100644 (file)
@@ -353,18 +353,19 @@ public:
   virtual void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) = 0;
 
   /**
-   * @brief Return the orientation of the surface.
-   * @return The orientation
+   * @brief Return the angle of the window's rotation.
+   * @return The window orientation
    */
-  virtual int GetOrientation() const = 0;
+  virtual int GetWindowRotationAngle() const = 0;
 
   /**
-   * @brief Get the screen rotation angle of the window
+   * @brief Get the angle of screen rotation for the window
+   * @return The screen orientation
    */
   virtual int GetScreenRotationAngle() = 0;
 
   /**
-   * @brief Set the rotation angle of the window
+   * @brief Set the screen rotation angle of the window
    */
   virtual void SetWindowRotationAngle(int degree) = 0;
 
index 67bf27c..e4c2cd5 100644 (file)
@@ -100,7 +100,8 @@ Window::Window()
   mIconified(false),
   mOpaqueState(false),
   mWindowRotationAcknowledgement(false),
-  mFocused(false)
+  mFocused(false),
+  mIsWindowRotating(false)
 {
 }
 
@@ -158,6 +159,7 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std
   mWindowBase->AuxiliaryMessageSignal().Connect(this, &Window::OnAuxiliaryMessage);
 
   mWindowSurface->OutputTransformedSignal().Connect(this, &Window::OnOutputTransformed);
+  mWindowSurface->RotationFinishedSignal().Connect(this, &Window::OnRotationFinished);
 
   AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
 
@@ -176,6 +178,18 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std
   {
     mOrientationMode = Internal::Adaptor::Window::OrientationMode::PORTRAIT;
   }
+
+  if(positionSize.width <= 0 || positionSize.height <= 0)
+  {
+    mWindowWidth  = screenWidth;
+    mWindowHeight = screenHeight;
+  }
+  else
+  {
+    mWindowWidth  = positionSize.width;
+    mWindowHeight = positionSize.height;
+  }
+
   // For Debugging
   mNativeWindowId = mWindowBase->GetNativeWindowId();
 }
@@ -363,7 +377,6 @@ void Window::SetPreferredOrientation(WindowOrientation orientation)
 
 WindowOrientation Window::GetPreferredOrientation()
 {
-  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), GetPreferredOrientation: %d\n", this, mNativeWindowId, mPreferredAngle);
   WindowOrientation preferredOrientation = ConvertToOrientation(mPreferredAngle);
   return preferredOrientation;
 }
@@ -658,25 +671,27 @@ int Window::GetBrightness() const
 
 void Window::SetSize(Dali::Window::WindowSize size)
 {
-  PositionSize oldRect = mSurface->GetPositionSize();
-
-  mWindowSurface->MoveResize(PositionSize(oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight()));
+  PositionSize oldRect = GetPositionSize();
 
-  PositionSize newRect = mSurface->GetPositionSize();
+  PositionSize newRect;
+  newRect.width  = size.GetWidth();
+  newRect.height = size.GetHeight();
 
   // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
   if((oldRect.width != newRect.width) || (oldRect.height != newRect.height))
   {
+    mWindowSurface->MoveResize(PositionSize(oldRect.x, oldRect.y, newRect.width, newRect.height));
+
     Uint16Pair newSize(newRect.width, newRect.height);
 
     mWindowWidth  = newRect.width;
     mWindowHeight = newRect.height;
 
-    SurfaceResized();
+    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), current angle (%d), SetSize(): (%d, %d), [%d x %d]\n", this, mNativeWindowId, mRotationAngle, oldRect.x, oldRect.y, newRect.width, newRect.height);
 
-    mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize);
+    SurfaceResized(static_cast<float>(mWindowWidth), static_cast<float>(mWindowHeight));
 
-    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), current angle (%d), SetSize(): resize signal [%d x %d]\n", this, mNativeWindowId, mRotationAngle, newRect.width, newRect.height);
+    mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize);
 
     Dali::Window handle(this);
     mResizeSignal.Emit(handle, newSize);
@@ -691,16 +706,25 @@ void Window::SetSize(Dali::Window::WindowSize size)
 
 Dali::Window::WindowSize Window::GetSize() const
 {
-  PositionSize positionSize = mSurface->GetPositionSize();
-
-  return Dali::Window::WindowSize(positionSize.width, positionSize.height);
+  return Dali::Window::WindowSize(mWindowWidth, mWindowHeight);
 }
 
 void Window::SetPosition(Dali::Window::WindowPosition position)
 {
   PositionSize oldRect = mSurface->GetPositionSize();
+  int32_t      newX    = position.GetX();
+  int32_t      newY    = position.GetY();
 
-  mWindowSurface->MoveResize(PositionSize(position.GetX(), position.GetY(), oldRect.width, oldRect.height));
+  mWindowSurface->MoveResize(PositionSize(newX, newY, oldRect.width, oldRect.height));
+
+  if((oldRect.x != newX) || (oldRect.y != newY))
+  {
+    Dali::Window                 handle(this);
+    Dali::Window::WindowPosition newPosition(newX, newY);
+
+    DALI_LOG_RELEASE_INFO("send moved signal with new position: %d, %d\n", newPosition.GetX(), newPosition.GetY());
+    mMovedSignal.Emit(handle, newPosition);
+  }
 
   mSurface->SetFullSwapNextFrame();
 
@@ -709,44 +733,63 @@ void Window::SetPosition(Dali::Window::WindowPosition position)
 
 Dali::Window::WindowPosition Window::GetPosition() const
 {
-  PositionSize positionSize = mSurface->GetPositionSize();
-
+  PositionSize positionSize = GetPositionSize();
   return Dali::Window::WindowPosition(positionSize.x, positionSize.y);
 }
 
 PositionSize Window::GetPositionSize() const
 {
-  return mSurface->GetPositionSize();
+  PositionSize positionSize = mSurface->GetPositionSize();
+  positionSize.width        = mWindowWidth;
+  positionSize.height       = mWindowHeight;
+  return positionSize;
 }
 
 void Window::SetPositionSize(PositionSize positionSize)
 {
-  PositionSize oldRect = mSurface->GetPositionSize();
+  bool moved  = false;
+  bool resize = false;
+
+  PositionSize oldRect = GetPositionSize();
   Dali::Window handle(this);
 
-  mWindowSurface->MoveResize(positionSize);
+  if((oldRect.x != positionSize.x) || (oldRect.y != positionSize.y))
+  {
+    moved = true;
+  }
 
-  PositionSize newRect = mSurface->GetPositionSize();
+  if((oldRect.width != positionSize.width) || (oldRect.height != positionSize.height))
+  {
+    resize = true;
+  }
 
-  if((oldRect.x != newRect.x) || (oldRect.y != newRect.y))
+  if(moved || resize)
   {
-    Dali::Window::WindowPosition position(newRect.x, newRect.y);
+    mWindowSurface->MoveResize(positionSize);
+  }
+
+  // When window is moved, emit Moved Signal
+  if(moved)
+  {
+    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Moved signal emit (%d, %d)\n", this, mNativeWindowId, positionSize.x, positionSize.y);
+    Dali::Window::WindowPosition position(positionSize.x, positionSize.y);
     mMovedSignal.Emit(handle, position);
   }
 
   // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
-  if((oldRect.width != newRect.width) || (oldRect.height != newRect.height))
+  if(resize)
   {
-    Uint16Pair newSize(newRect.width, newRect.height);
+    Uint16Pair newSize(positionSize.width, positionSize.height);
 
-    mWindowWidth  = newRect.width;
-    mWindowHeight = newRect.height;
+    mWindowWidth  = positionSize.width;
+    mWindowHeight = positionSize.height;
 
-    SurfaceResized();
+    SurfaceResized(static_cast<float>(mWindowWidth), static_cast<float>(mWindowHeight));
 
     mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize);
 
-    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), current angle (%d), SetPositionSize():resize signal [%d x %d]\n", this, mNativeWindowId, mRotationAngle, newRect.width, newRect.height);
+    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Resize signal emit [%d x %d]\n", this, mNativeWindowId, positionSize.width, positionSize.height);
+
     mResizeSignal.Emit(handle, newSize);
     mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize);
   }
@@ -847,10 +890,9 @@ void Window::OnFocusChanged(bool focusIn)
 
 void Window::OnOutputTransformed()
 {
-  PositionSize positionSize = mSurface->GetPositionSize();
+  PositionSize positionSize = GetPositionSize();
 
-  int orientation = (mRotationAngle + mWindowBase->GetScreenRotationAngle()) % 360;
-  SurfaceRotated(static_cast<float>(positionSize.width), static_cast<float>(positionSize.height), orientation);
+  SurfaceRotated(static_cast<float>(positionSize.width), static_cast<float>(positionSize.height), mRotationAngle, mWindowBase->GetScreenRotationAngle());
 
   mAdaptor->SurfaceResizePrepare(mSurface.get(), Adaptor::SurfaceSize(positionSize.width, positionSize.height));
   mAdaptor->SurfaceResizeComplete(mSurface.get(), Adaptor::SurfaceSize(positionSize.width, positionSize.height));
@@ -880,13 +922,12 @@ void Window::OnWindowRedrawRequest()
 
 void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize)
 {
-  bool resized = false;
-  bool moved = false;
-  Dali::Window handle(this);
-  PositionSize oldRect = mSurface->GetPositionSize();
+  bool moved  = false;
+  bool resize = false;
 
-  mWindowSurface->UpdatePositionSize(positionSize);
+  Dali::Window handle(this);
 
+  PositionSize oldRect = GetPositionSize();
   PositionSize newRect = positionSize;
 
   if((oldRect.x != newRect.x) || (oldRect.y != newRect.y))
@@ -896,28 +937,35 @@ void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize)
 
   if((oldRect.width != newRect.width) || (oldRect.height != newRect.height))
   {
-    resized = true;
+    resize = true;
   }
 
-  if(moved)
+  if(moved || resize)
   {
+    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), current angle (%d), position or size is updated by server , (%d, %d) [%d x %d]\n", this, mNativeWindowId, mRotationAngle, newRect.x, newRect.y, newRect.width, newRect.height);
+    mWindowSurface->UpdatePositionSize(positionSize);
+  }
+
+  if((oldRect.x != newRect.x) || (oldRect.y != newRect.y))
+  {
+    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Moved signal emit (%d, %d)\n", this, mNativeWindowId, newRect.x, newRect.y);
     Dali::Window::WindowPosition position(newRect.x, newRect.y);
     mMovedSignal.Emit(handle, position);
   }
 
   // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
-  if(resized)
+  if((oldRect.width != newRect.width) || (oldRect.height != newRect.height))
   {
     Uint16Pair newSize(newRect.width, newRect.height);
 
-    mWindowWidth   = newRect.width;
-    mWindowHeight  = newRect.height;
+    mWindowWidth  = newRect.width;
+    mWindowHeight = newRect.height;
 
-    SurfaceResized();
+    SurfaceResized(static_cast<float>(mWindowWidth), static_cast<float>(mWindowHeight));
 
     mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize);
 
-    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Updated PositionSize by server :resize signal [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height);
+    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Resized signal emit [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height);
     mResizeSignal.Emit(handle, newSize);
     mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize);
   }
@@ -952,24 +1000,30 @@ void Window::OnRotation(const RotationEvent& rotation)
   mWindowWidth   = rotation.width;
   mWindowHeight  = rotation.height;
 
+  mIsWindowRotating = true;
+  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), angle(%d), Window Rotation (%d , %d) [%d x %d]\n", this, mNativeWindowId, mRotationAngle, newPositionSize.x, newPositionSize.y, mWindowWidth, mWindowHeight);
+
   // Notify that the orientation is changed
   mOrientation->OnOrientationChange(rotation);
 
   mWindowSurface->RequestRotation(mRotationAngle, newPositionSize);
 
-  int orientation = (mRotationAngle + mWindowBase->GetScreenRotationAngle()) % 360;
-  SurfaceRotated(mWindowWidth, mWindowHeight, orientation);
+  SurfaceRotated(static_cast<float>(mWindowWidth), static_cast<float>(mWindowHeight), mRotationAngle, mWindowBase->GetScreenRotationAngle());
 
   mAdaptor->SurfaceResizePrepare(mSurface.get(), Adaptor::SurfaceSize(mWindowWidth, mWindowHeight));
 
-  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), OnRotation(): x[%d], y[%d], resize signal emit [%d x %d]\n", this, mNativeWindowId, newPositionSize.x, newPositionSize.y, mWindowWidth, mWindowHeight);
-  // Emit signal
   Dali::Window handle(this);
   mResizeSignal.Emit(handle, Dali::Window::WindowSize(mWindowWidth, mWindowHeight));
 
   mAdaptor->SurfaceResizeComplete(mSurface.get(), Adaptor::SurfaceSize(mWindowWidth, mWindowHeight));
 }
 
+void Window::OnRotationFinished()
+{
+  mIsWindowRotating = false;
+  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), window rotation is finised\n", this, mNativeWindowId);
+}
+
 void Window::OnPause()
 {
   if(mEventHandler)
@@ -1117,7 +1171,6 @@ Dali::Window Window::GetParent()
 
 WindowOrientation Window::GetCurrentOrientation() const
 {
-  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), GetCurrentOrientation(): %d\n", this, mNativeWindowId, mRotationAngle);
   return ConvertToOrientation(mRotationAngle);
 }
 
@@ -1250,7 +1303,7 @@ void Window::SendRotationCompletedAcknowledgement()
 
 bool Window::IsWindowRotating() const
 {
-  return mWindowSurface->IsWindowRotating();
+  return mIsWindowRotating;
 }
 
 const Dali::KeyEvent& Window::GetLastKeyEvent() const
index a639431..eb3aac6 100644 (file)
@@ -576,6 +576,13 @@ private:
   void OnAccessibilityDisabled();
 
   /**
+   * Called when the window rotation is finished.
+   *
+   * This signal is emmit when window rotation is finisehd and WindowRotationCompleted() is called.
+   */
+  void OnRotationFinished();
+
+  /**
    * @brief Set available orientation to window base.
    */
   void SetAvailableAnlges(const std::vector<int>& angles);
@@ -776,6 +783,7 @@ private:
   bool mOpaqueState : 1;
   bool mWindowRotationAcknowledgement : 1;
   bool mFocused : 1;
+  bool mIsWindowRotating : 1; ///< The window rotating flag.
 };
 
 } // namespace Adaptor
index 4f00430..2e23548 100644 (file)
@@ -164,6 +164,7 @@ WindowRenderSurface::WindowRenderSurface(Dali::PositionSize positionSize, Any su
   mEGLContext(nullptr),
   mColorDepth(isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24),
   mOutputTransformedSignal(),
+  mWindowRotationFinishedSignal(),
   mFrameCallbackInfoContainer(),
   mBufferDamagedRects(),
   mMutex(),
@@ -172,12 +173,9 @@ WindowRenderSurface::WindowRenderSurface(Dali::PositionSize positionSize, Any su
   mDpiHorizontal(0),
   mDpiVertical(0),
   mOwnSurface(false),
-  mWindowRotationFinished(true),
-  mScreenRotationFinished(true),
-  mResizeFinished(true),
-  mDefaultScreenRotationAvailable(false),
   mIsImeWindowSurface(false),
-  mNeedWindowRotationAcknowledgement(false)
+  mNeedWindowRotationAcknowledgement(false),
+  mIsWindowOrientationChanging(false)
 {
   DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n");
   Initialize(surface);
@@ -206,13 +204,11 @@ void WindowRenderSurface::Initialize(Any surface)
   mWindowBase->OutputTransformedSignal().Connect(this, &WindowRenderSurface::OutputTransformed);
 
   // Check screen rotation
-  mScreenRotationAngle = mWindowBase->GetScreenRotationAngle();
-  if(mScreenRotationAngle != 0)
+  int screenRotationAngle = mWindowBase->GetScreenRotationAngle();
+  if(screenRotationAngle != 0)
   {
-    mScreenRotationFinished         = false;
-    mResizeFinished                 = false;
-    mDefaultScreenRotationAvailable = true;
-    DALI_LOG_RELEASE_INFO("WindowRenderSurface::Initialize, screen rotation is enabled, screen rotation angle:[%d]\n", mScreenRotationAngle);
+    OutputTransformed();
+    DALI_LOG_RELEASE_INFO("WindowRenderSurface::Initialize, screen rotation is enabled, screen rotation angle:[%d]\n", screenRotationAngle);
   }
 }
 
@@ -249,15 +245,12 @@ void WindowRenderSurface::RequestRotation(int angle, PositionSize positionSize)
                                                                                                         TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
   }
 
-  mPositionSize = positionSize;
-
-  mWindowRotationAngle    = angle;
-  mWindowRotationFinished = false;
-  mResizeFinished         = false;
+  mPositionSize.x = positionSize.x;
+  mPositionSize.y = positionSize.y;
 
-  mWindowBase->SetWindowRotationAngle(mWindowRotationAngle);
+  mWindowBase->SetWindowRotationAngle(angle);
 
-  DALI_LOG_RELEASE_INFO("angle = %d screen rotation = %d, flag = %d\n", mWindowRotationAngle, mScreenRotationAngle, mWindowRotationFinished);
+  DALI_LOG_RELEASE_INFO("start window rotation angle = %d screen rotation = %d\n", angle, mScreenRotationAngle);
 }
 
 WindowBase* WindowRenderSurface::GetWindowBase()
@@ -270,6 +263,11 @@ WindowBase::OutputSignalType& WindowRenderSurface::OutputTransformedSignal()
   return mOutputTransformedSignal;
 }
 
+WindowRenderSurface::RotationFinishedSignalType& WindowRenderSurface::RotationFinishedSignal()
+{
+  return mWindowRotationFinishedSignal;
+}
+
 PositionSize WindowRenderSurface::GetPositionSize() const
 {
   return mPositionSize;
@@ -295,9 +293,14 @@ void WindowRenderSurface::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiV
   dpiVertical   = mDpiVertical;
 }
 
-int WindowRenderSurface::GetOrientation() const
+int WindowRenderSurface::GetSurfaceOrientation() const
 {
-  return mWindowBase->GetOrientation();
+  return mWindowBase->GetWindowRotationAngle();
+}
+
+int WindowRenderSurface::GetScreenOrientation() const
+{
+  return mWindowBase->GetScreenRotationAngle();
 }
 
 void WindowRenderSurface::InitializeGraphics()
@@ -398,9 +401,6 @@ bool WindowRenderSurface::ReplaceGraphicsSurface()
   // Create the EGL window
   EGLNativeWindowType window = mWindowBase->CreateEglWindow(width, height);
 
-  // Set screen rotation
-  mScreenRotationFinished = false;
-
   auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
 
   Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
@@ -409,83 +409,25 @@ bool WindowRenderSurface::ReplaceGraphicsSurface()
 
 void WindowRenderSurface::UpdatePositionSize(Dali::PositionSize positionSize)
 {
-  bool needToMove   = false;
-  bool needToResize = false;
-
   // Check moving
   if((fabs(positionSize.x - mPositionSize.x) >= MINIMUM_DIMENSION_CHANGE) ||
      (fabs(positionSize.y - mPositionSize.y) >= MINIMUM_DIMENSION_CHANGE))
   {
-    needToMove = true;
-  }
+    mPositionSize.x = positionSize.x;
+    mPositionSize.y = positionSize.y;
 
-  // Check resizing
-  if((fabs(positionSize.width - mPositionSize.width) >= MINIMUM_DIMENSION_CHANGE) ||
-     (fabs(positionSize.height - mPositionSize.height) >= MINIMUM_DIMENSION_CHANGE))
-  {
-    needToResize = true;
-  }
-
-  if(needToResize)
-  {
-    mResizeFinished = false;
-    mPositionSize   = positionSize;
+    DALI_LOG_RELEASE_INFO("Update Position by server (%d, %d)\n", mPositionSize.x, mPositionSize.y);
   }
-  else
-  {
-    if(needToMove)
-    {
-      mPositionSize = positionSize;
-    }
-  }
-
-  DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::MoveResize: %d, %d, %d, %d\n", mPositionSize.x, mPositionSize.y, mPositionSize.width, mPositionSize.height);
 }
 
 void WindowRenderSurface::MoveResize(Dali::PositionSize positionSize)
 {
-  bool needToMove   = false;
-  bool needToResize = false;
-
-  // Check moving
-  if((fabs(positionSize.x - mPositionSize.x) >= MINIMUM_DIMENSION_CHANGE) ||
-     (fabs(positionSize.y - mPositionSize.y) >= MINIMUM_DIMENSION_CHANGE))
-  {
-    needToMove = true;
-  }
-
-  // Check resizing
-  if((fabs(positionSize.width - mPositionSize.width) >= MINIMUM_DIMENSION_CHANGE) ||
-     (fabs(positionSize.height - mPositionSize.height) >= MINIMUM_DIMENSION_CHANGE))
-  {
-    needToResize = true;
-  }
-
-  if(needToResize)
-  {
-    if(needToMove)
-    {
-      mWindowBase->MoveResize(positionSize);
-    }
-    else
-    {
-      mWindowBase->Resize(positionSize);
-    }
+  mPositionSize.x = positionSize.x;
+  mPositionSize.y = positionSize.y;
 
-    mResizeFinished = false;
-    mPositionSize   = positionSize;
-  }
-  else
-  {
-    if(needToMove)
-    {
-      mWindowBase->Move(positionSize);
-
-      mPositionSize = positionSize;
-    }
-  }
+  DALI_LOG_RELEASE_INFO("Update Position by client (%d, %d)\n", positionSize.x, positionSize.y);
 
-  DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::MoveResize: %d, %d, %d, %d\n", mPositionSize.x, mPositionSize.y, mPositionSize.width, mPositionSize.height);
+  mWindowBase->MoveResize(positionSize);
 }
 
 void WindowRenderSurface::StartRender()
@@ -499,6 +441,7 @@ bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector<Rect
   Dali::Integration::Scene::FrameCallbackContainer callbacks;
 
   Dali::Integration::Scene scene = mScene.GetHandle();
+
   if(scene)
   {
     bool needFrameRenderedTrigger = false;
@@ -568,52 +511,66 @@ bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector<Rect
     * Notice : PreRotation is not used in the latest tizen,
     *          because output transform event should be occured before egl window is not created.
     */
-
-  if(mIsResizing || mDefaultScreenRotationAvailable)
+  if(scene && resizingSurface)
   {
-    int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
+    int totalAngle = 0;
+    bool isScreenOrientationChanging = false;
 
-    // Window rotate or screen rotate
-    if(!mWindowRotationFinished || !mScreenRotationFinished)
+    if(mWindowRotationAngle != scene.GetCurrentSurfaceOrientation())
     {
-      mWindowBase->SetEglWindowBufferTransform(totalAngle);
+      mWindowRotationAngle = scene.GetCurrentSurfaceOrientation();
+      mIsWindowOrientationChanging = true;
+    }
+
+    if(mScreenRotationAngle != scene.GetCurrentScreenOrientation())
+    {
+      mScreenRotationAngle = scene.GetCurrentScreenOrientation();
+      isScreenOrientationChanging = true;
+    }
+    totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
 
-      // Reset only screen rotation flag
-      mScreenRotationFinished = true;
+    DALI_LOG_RELEASE_INFO("Window/Screen orientation ard changed, WinOrientation[%d],flag[%d], ScreenOrientation[%d],flag[%d], total[%d]\n", mWindowRotationAngle, mIsWindowOrientationChanging, mScreenRotationAngle, isScreenOrientationChanging, totalAngle);
 
-      DALI_LOG_RELEASE_INFO("WindowRenderSurface::PreRender: Set rotation [%d] [%d]\n", mWindowRotationAngle, mScreenRotationAngle);
+    Rect<int> surfaceSize = scene.GetCurrentSurfaceRect();
+    //update surface size
+    mPositionSize.width = surfaceSize.width;
+    mPositionSize.height = surfaceSize.height;
+
+    DALI_LOG_RELEASE_INFO("Window is resizing, (%d, %d), [%d x %d]\n", mPositionSize.x, mPositionSize.y, mPositionSize.width, mPositionSize.height);
+
+    // Window rotate or screen rotate
+    if(mIsWindowOrientationChanging || isScreenOrientationChanging)
+    {
+      mWindowBase->SetEglWindowBufferTransform(totalAngle);
     }
 
     // Only window rotate
-    if(!mWindowRotationFinished)
+    if(mIsWindowOrientationChanging)
     {
       mWindowBase->SetEglWindowTransform(mWindowRotationAngle);
     }
 
     // Resize case
-    if(!mResizeFinished)
-    {
-      Dali::PositionSize positionSize;
-      positionSize.x = mPositionSize.x;
-      positionSize.y = mPositionSize.y;
-      if(totalAngle == 0 || totalAngle == 180)
-      {
-        positionSize.width  = mPositionSize.width;
-        positionSize.height = mPositionSize.height;
-      }
-      else
-      {
-        positionSize.width  = mPositionSize.height;
-        positionSize.height = mPositionSize.width;
-      }
-      mWindowBase->ResizeEglWindow(positionSize);
-      mResizeFinished = true;
+    Dali::PositionSize positionSize;
 
-      DALI_LOG_RELEASE_INFO("WindowRenderSurface::PreRender: Set resize, totalAngle: %d, x: %d, y: %d, w: %d, h:%d\n", totalAngle, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
+    // Some native resize API(wl_egl_window_resize) has the input parameters of x, y, width and height.
+    // So, position data should be set.
+    positionSize.x = mPositionSize.x;
+    positionSize.y = mPositionSize.y;
+    if(totalAngle == 0 || totalAngle == 180)
+    {
+      positionSize.width  = mPositionSize.width;
+      positionSize.height = mPositionSize.height;
+    }
+    else
+    {
+      positionSize.width  = mPositionSize.height;
+      positionSize.height = mPositionSize.width;
     }
 
+    mWindowBase->ResizeEglWindow(positionSize);
+
     SetFullSwapNextFrame();
-    mDefaultScreenRotationAvailable = false;
   }
 
   SetBufferDamagedRects(damagedRects, clippingRect);
@@ -644,7 +601,7 @@ void WindowRenderSurface::PostRender()
 
     bool needWindowRotationCompleted = false;
 
-    if(!mWindowRotationFinished)
+    if(mIsWindowOrientationChanging)
     {
       if(mNeedWindowRotationAcknowledgement)
       {
@@ -659,10 +616,7 @@ void WindowRenderSurface::PostRender()
       }
       else
       {
-        if(mIsResizing)
-        {
-          needWindowRotationCompleted = true;
-        }
+        needWindowRotationCompleted = true;
       }
     }
 
@@ -674,7 +628,7 @@ void WindowRenderSurface::PostRender()
         mThreadSynchronization->PostRenderStarted();
       }
 
-      if(!mWindowRotationFinished || mIsImeWindowSurface)
+      if(mIsWindowOrientationChanging || mIsImeWindowSurface)
       {
         mPostRenderTrigger->Trigger();
       }
@@ -755,13 +709,9 @@ void WindowRenderSurface::OutputTransformed()
 
   if(mScreenRotationAngle != screenRotationAngle)
   {
-    mScreenRotationAngle    = screenRotationAngle;
-    mScreenRotationFinished = false;
-    mResizeFinished         = false;
-
     mOutputTransformedSignal.Emit();
 
-    DALI_LOG_RELEASE_INFO("WindowRenderSurface::OutputTransformed: window = %d screen = %d\n", mWindowRotationAngle, mScreenRotationAngle);
+    DALI_LOG_RELEASE_INFO("WindowRenderSurface::OutputTransformed: window = %d new screen angle = %d\n", mWindowRotationAngle, screenRotationAngle);
   }
   else
   {
@@ -769,18 +719,14 @@ void WindowRenderSurface::OutputTransformed()
   }
 }
 
-bool WindowRenderSurface::IsWindowRotating() const
-{
-  return !(mWindowRotationFinished);
-}
-
 void WindowRenderSurface::ProcessPostRender()
 {
-  if(!mWindowRotationFinished)
+  if(mIsWindowOrientationChanging)
   {
+    mWindowRotationFinishedSignal.Emit();
     mWindowBase->WindowRotationCompleted(mWindowRotationAngle, mPositionSize.width, mPositionSize.height);
-    mWindowRotationFinished = true;
-    DALI_LOG_RELEASE_INFO("WindowRenderSurface::ProcessPostRender: Rotation Done, flag = %d\n", mWindowRotationFinished);
+    mIsWindowOrientationChanging = false;
+    DALI_LOG_RELEASE_INFO("WindowRenderSurface::ProcessPostRender: Rotation Done, flag = %d\n", mIsWindowOrientationChanging);
   }
 
   if(mIsImeWindowSurface)
index 660dfdb..a6643e6 100644 (file)
@@ -48,8 +48,10 @@ class AdaptorInternalServices;
 class WindowRenderSurface : public Dali::RenderSurfaceInterface, public ConnectionTracker
 {
 public:
-  using OutputSignalType      = Signal<void()>;
-  using DamagedRectsContainer = std::vector<Rect<int>>;
+
+  using RotationFinishedSignalType = Signal<void()>        ; ///<The signal of window rotation's finished.
+  using OutputSignalType           = Signal<void()>;
+  using DamagedRectsContainer      = std::vector<Rect<int>>;
 
   /**
     * Uses an window surface to render to.
@@ -138,16 +140,14 @@ public: // API
   void UpdatePositionSize(Dali::PositionSize positionSize);
 
   /**
-   * @brief Query whether window is rotating or not.
-   *
-   * @return true if window is rotating, false otherwise.
+   * @brief This signal is emitted when the output is transformed.
    */
-  bool IsWindowRotating() const;
+  OutputSignalType& OutputTransformedSignal();
 
   /**
-   * @brief This signal is emitted when the output is transformed.
+   * @brief This signal is emitted when a rotation job is finished.
    */
-  OutputSignalType& OutputTransformedSignal();
+  RotationFinishedSignalType& RotationFinishedSignal();
 
 public: // from Dali::RenderSurfaceInterface
   /**
@@ -160,9 +160,14 @@ public: // from Dali::RenderSurfaceInterface
   void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
 
   /**
-   * @copydoc Dali::RenderSurfaceInterface::GetOrientation()
+   * @copydoc Dali::RenderSurfaceInterface::GetSurfaceOrientation()
+   */
+  int GetSurfaceOrientation() const override;
+
+  /**
+   * @copydoc Dali::RenderSurfaceInterface::GetScreenOrientation()
    */
-  int GetOrientation() const override;
+  int GetScreenOrientation() const override;
 
   /**
    * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
@@ -330,7 +335,8 @@ private: // Data
   EGLSurface                             mEGLSurface;
   EGLContext                             mEGLContext;
   ColorDepth                             mColorDepth; ///< Color depth of surface (32 bit or 24 bit)
-  OutputSignalType                       mOutputTransformedSignal;
+  OutputSignalType                       mOutputTransformedSignal;       ///< The signal of screen rotation occurs
+  RotationFinishedSignalType             mWindowRotationFinishedSignal;  ///< The signal of window rotation's finished
   FrameCallbackInfoContainer             mFrameCallbackInfoContainer;
   DamagedRectsContainer                  mBufferDamagedRects;
   Dali::Mutex                            mMutex;
@@ -340,12 +346,9 @@ private: // Data
   uint32_t                               mDpiVertical;
   std::vector<Rect<int>>                 mDamagedRects{}; ///< Keeps collected damaged render items rects for one render pass. These rects are rotated by scene orientation.
   bool                                   mOwnSurface;     ///< Whether we own the surface (responsible for deleting it)
-  bool                                   mWindowRotationFinished;
-  bool                                   mScreenRotationFinished;
-  bool                                   mResizeFinished;
-  bool                                   mDefaultScreenRotationAvailable;
   bool                                   mIsImeWindowSurface;
   bool                                   mNeedWindowRotationAcknowledgement;
+  bool                                   mIsWindowOrientationChanging;
 
 }; // class WindowRenderSurface
 
index a1d6e2d..174c6bc 100644 (file)
@@ -298,9 +298,9 @@ public:
   void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
    */
-  int GetOrientation() const override;
+  int GetWindowRotationAngle() const override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
index 7c1de56..988ea87 100644 (file)
@@ -643,7 +643,7 @@ void WindowBaseCocoa::GetDpi(
   dpiVertical = res.height;
 }
 
-int WindowBaseCocoa::GetOrientation() const
+int WindowBaseCocoa::GetWindowRotationAngle() const
 {
   return 0;
 }
index 9645a04..ddf4ad5 100644 (file)
@@ -2071,9 +2071,9 @@ void WindowBaseEcoreWl::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVer
   dpiVertical   = int(yres + 0.5f);
 }
 
-int WindowBaseEcoreWl::GetOrientation() const
+int WindowBaseEcoreWl::GetWindowRotationAngle() const
 {
-  int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360;
+  int orientation = mWindowRotationAngle;
   if(mSupportedPreProtation)
   {
     orientation = 0;
index 741224d..463359c 100644 (file)
@@ -420,9 +420,9 @@ public:
   void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
    */
-  int GetOrientation() const override;
+  int GetWindowRotationAngle() const override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
index 8ddc82d..d99721c 100644 (file)
@@ -31,6 +31,7 @@
 // EXTERNAL_HEADERS
 #include <Ecore_Input.h>
 #include <dali/integration-api/debug.h>
+#include <dali/integration-api/trace.h>
 #include <dali/public-api/adaptor-framework/window-enumerations.h>
 #include <dali/public-api/events/mouse-button.h>
 #include <dali/public-api/object/any.h>
@@ -54,6 +55,8 @@ namespace
 Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW_BASE");
 #endif
 
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false);
+
 const uint32_t     MAX_TIZEN_CLIENT_VERSION = 7;
 const unsigned int PRIMARY_TOUCH_BUTTON_ID  = 1;
 
@@ -1045,7 +1048,6 @@ void WindowBaseEcoreWl2::OnConfiguration(void* data, int type, void* event)
       ecore_wl2_window_geometry_set(mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height);
 
       Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(mWindowPositionSize);
-      DALI_LOG_RELEASE_INFO("emit signal to update window's position and size, x[%d] y[%d] w[%d] h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height);
       mUpdatePositionSizeSignal.Emit(newPositionSize);
     }
 
@@ -1201,7 +1203,14 @@ void WindowBaseEcoreWl2::OnKeyDown(void* data, int type, void* event)
     std::string keyString("");
     std::string compose("");
 
-    DALI_LOG_RELEASE_INFO("OnKeyDown Start [%s]\n", keyName.c_str());
+#ifdef TRACE_ENABLED
+    std::ostringstream stream;
+    if(gTraceFilter->IsTraceEnabled())
+    {
+      stream << "DALI_ON_KEY_DOWN [" << keyName << "]\n";
+      DALI_TRACE_BEGIN(gTraceFilter, stream.str().c_str());
+    }
+#endif
 
     // Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string.
     if(keyEvent->compose)
@@ -1250,7 +1259,12 @@ void WindowBaseEcoreWl2::OnKeyDown(void* data, int type, void* event)
 
     mKeyEventSignal.Emit(keyEvent);
 
-    DALI_LOG_RELEASE_INFO("OnKeyDown End [%s]\n", keyName.c_str());
+#ifdef TRACE_ENABLED
+    if(gTraceFilter->IsTraceEnabled())
+    {
+      DALI_TRACE_END(gTraceFilter, stream.str().c_str());
+    }
+#endif
   }
 }
 
@@ -1274,7 +1288,14 @@ void WindowBaseEcoreWl2::OnKeyUp(void* data, int type, void* event)
     std::string keyString("");
     std::string compose("");
 
-    DALI_LOG_RELEASE_INFO("OnKeyUp Start [%s]\n", keyName.c_str());
+#ifdef TRACE_ENABLED
+    std::ostringstream stream;
+    if(gTraceFilter->IsTraceEnabled())
+    {
+      stream << "DALI_ON_KEY_UP [" << keyName << "]" << std::endl;
+      DALI_TRACE_BEGIN(gTraceFilter, stream.str().c_str());
+    }
+#endif
 
     // Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string.
     if(keyEvent->compose)
@@ -1323,7 +1344,12 @@ void WindowBaseEcoreWl2::OnKeyUp(void* data, int type, void* event)
 
     mKeyEventSignal.Emit(keyEvent);
 
-    DALI_LOG_RELEASE_INFO("OnKeyUp End [%s]\n", keyName.c_str());
+#ifdef TRACE_ENABLED
+    if(gTraceFilter->IsTraceEnabled())
+    {
+      DALI_TRACE_END(gTraceFilter, stream.str().c_str());
+    }
+#endif
   }
 }
 
@@ -1594,6 +1620,7 @@ void WindowBaseEcoreWl2::SetEglWindowBufferTransform(int angle)
     }
   }
 
+  DALI_LOG_RELEASE_INFO("wl_egl_window_tizen_set_buffer_transform() with buffer Transform [%d]\n", bufferTransform);
   wl_egl_window_tizen_set_buffer_transform(mEglWindow, bufferTransform);
 }
 
@@ -1630,11 +1657,13 @@ void WindowBaseEcoreWl2::SetEglWindowTransform(int angle)
     }
   }
 
+  DALI_LOG_RELEASE_INFO("wl_egl_window_tizen_set_window_transform() with window Transform [%d]\n", windowTransform);
   wl_egl_window_tizen_set_window_transform(mEglWindow, windowTransform);
 }
 
 void WindowBaseEcoreWl2::ResizeEglWindow(PositionSize positionSize)
 {
+  DALI_LOG_RELEASE_INFO("wl_egl_window_resize(), (%d, %d) [%d x %d]\n", positionSize.x, positionSize.y, positionSize.width, positionSize.height);
   wl_egl_window_resize(mEglWindow, positionSize.width, positionSize.height, positionSize.x, positionSize.y);
 
   // Note: Both "Resize" and "MoveResize" cases can reach here, but only "MoveResize" needs to submit serial number
@@ -1691,9 +1720,6 @@ PositionSize WindowBaseEcoreWl2::RecalculatePositionSizeToSystem(PositionSize po
     newPositionSize.height = positionSize.height;
   }
 
-  DALI_LOG_RELEASE_INFO("input coord x[%d], y[%d], w{%d], h[%d], screen w[%d], h[%d]\n", positionSize.x, positionSize.y, positionSize.width, positionSize.height, mScreenWidth, mScreenHeight);
-  DALI_LOG_RELEASE_INFO("recalc coord x[%d], y[%d], w{%d], h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height);
-
   return newPositionSize;
 }
 
@@ -1730,9 +1756,6 @@ PositionSize WindowBaseEcoreWl2::RecalculatePositionSizeToCurrentOrientation(Pos
     newPositionSize.height = positionSize.height;
   }
 
-  DALI_LOG_RELEASE_INFO("input coord x[%d], y[%d], w{%d], h[%d], screen w[%d], h[%d]\n", positionSize.x, positionSize.y, positionSize.width, positionSize.height, mScreenWidth, mScreenHeight);
-  DALI_LOG_RELEASE_INFO("recalc by current orientation coord x[%d], y[%d], w{%d], h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height);
-
   return newPositionSize;
 }
 
@@ -2541,9 +2564,9 @@ void WindowBaseEcoreWl2::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVe
   dpiVertical   = int(yres + 0.5f);
 }
 
-int WindowBaseEcoreWl2::GetOrientation() const
+int WindowBaseEcoreWl2::GetWindowRotationAngle() const
 {
-  int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360;
+  int orientation = mWindowRotationAngle;
   if(mSupportedPreProtation)
   {
     orientation = 0;
@@ -2553,8 +2576,12 @@ int WindowBaseEcoreWl2::GetOrientation() const
 
 int WindowBaseEcoreWl2::GetScreenRotationAngle()
 {
-  int transform = 0;
-
+  if(mSupportedPreProtation)
+  {
+    DALI_LOG_RELEASE_INFO("Support PreRotation and return 0\n");
+    return 0;
+  }
+  int transform;
   if(ecore_wl2_window_ignore_output_transform_get(mEcoreWindow))
   {
     transform = 0;
index 78e2e8b..6b66478 100644 (file)
@@ -459,9 +459,9 @@ public:
   void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
    */
-  int GetOrientation() const override;
+  int GetWindowRotationAngle() const override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
index b752013..09fd990 100644 (file)
@@ -139,7 +139,12 @@ void NativeRenderSurfaceEcoreWl::GetDpi(unsigned int& dpiHorizontal, unsigned in
   dpiVertical   = int(yres + 0.5f);
 }
 
-int NativeRenderSurfaceEcoreWl::GetOrientation() const
+int NativeRenderSurfaceEcoreWl::GetSurfaceOrientation() const
+{
+  return 0;
+}
+
+int NativeRenderSurfaceEcoreWl::GetScreenOrientation() const
 {
   return 0;
 }
index f33588e..404a916 100644 (file)
@@ -76,9 +76,14 @@ public: // from Dali::RenderSurfaceInterface
   void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
 
   /**
-   * @copydoc Dali::RenderSurfaceInterface::GetOrientation()
+   * @copydoc Dali::RenderSurfaceInterface::GetSurfaceOrientation()
    */
-  int GetOrientation() const override;
+  int GetSurfaceOrientation() const override;
+
+  /**
+   * @copydoc Dali::RenderSurfaceInterface::GetScreenOrientation()
+   */
+  int GetScreenOrientation() const override;
 
   /**
    * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
index c79fd3b..1249fb0 100644 (file)
@@ -146,7 +146,12 @@ void PixmapRenderSurfaceEcoreX::GetDpi(unsigned int& dpiHorizontal, unsigned int
   dpiVertical   = int(yres + 0.5f);
 }
 
-int PixmapRenderSurfaceEcoreX::GetOrientation() const
+int PixmapRenderSurfaceEcoreX::GetSurfaceOrientation() const
+{
+  return 0;
+}
+
+int PixmapRenderSurfaceEcoreX::GetScreenOrientation() const
 {
   return 0;
 }
index 4970520..9e549bb 100644 (file)
@@ -78,9 +78,14 @@ public: // from Dali::RenderSurfaceInterface
   void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+   * @copydoc Dali::RenderSurfaceInterface::GetSurfaceOrientation()
    */
-  int GetOrientation() const override;
+  int GetSurfaceOrientation() const override;
+
+  /**
+   * @copydoc Dali::RenderSurfaceInterface::GetScreenOrientation()
+   */
+  int GetScreenOrientation() const override;
 
   /**
    * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
index 3afc70e..0104a36 100644 (file)
@@ -867,7 +867,7 @@ void WindowBaseEcoreX::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVert
   dpiVertical   = ecore_x_dpi_get();
 }
 
-int WindowBaseEcoreX::GetOrientation() const
+int WindowBaseEcoreX::GetWindowRotationAngle() const
 {
   return 0;
 }
index 5739c19..d0b069d 100644 (file)
@@ -365,9 +365,9 @@ public:
   void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
    */
-  int GetOrientation() const override;
+  int GetWindowRotationAngle() const override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
index 0a66241..22aa274 100644 (file)
@@ -494,7 +494,7 @@ void WindowBaseWin::SetTransparency(bool transparent)
 {
 }
 
-int WindowBaseWin::GetOrientation() const
+int WindowBaseWin::GetWindowRotationAngle() const
 {
   return 0;
 }
index 169fb18..748157a 100644 (file)
@@ -372,9 +372,9 @@ public:
   void SetTransparency(bool transparent) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
    */
-  int GetOrientation() const override;
+  int GetWindowRotationAngle() const override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
index 74e7258..2cf61e9 100644 (file)
@@ -139,7 +139,12 @@ void PixmapRenderSurfaceX::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpi
   WindowSystem::GetImplementation().GetDPI(dpiHorizontal, dpiVertical);
 }
 
-int PixmapRenderSurfaceX::GetOrientation() const
+int PixmapRenderSurfaceX::GetSurfaceOrientation() const
+{
+  return 0;
+}
+
+int PixmapRenderSurfaceX::GetScreenOrientation() const
 {
   return 0;
 }
index c003401..bd1f357 100644 (file)
@@ -76,9 +76,14 @@ public: // from Dali::RenderSurfaceInterface
   void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+   * @copydoc Dali::RenderSurfaceInterface::GetSurfaceOrientation()
    */
-  int GetOrientation() const override;
+  int GetSurfaceOrientation() const override;
+
+  /**
+   * @copydoc Dali::RenderSurfaceInterface::GetScreenOrientation()
+   */
+  int GetScreenOrientation() const override;
 
   /**
    * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
index 89232ab..c07f0e8 100644 (file)
@@ -812,7 +812,7 @@ void WindowBaseX::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
   WindowSystem::GetImplementation().GetDPI(dpiHorizontal, dpiVertical);
 }
 
-int WindowBaseX::GetOrientation() const
+int WindowBaseX::GetWindowRotationAngle() const
 {
   return 0;
 }
index ac305f8..bcd46be 100644 (file)
@@ -369,9 +369,9 @@ public:
   void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
    */
-  int GetOrientation() const override;
+  int GetWindowRotationAngle() const override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
index 4b34148..17b70b3 100644 (file)
@@ -36,10 +36,13 @@ EncodedImageBuffer::EncodedImageBuffer(Internal::EncodedImageBuffer* internal)
 {
 }
 
-EncodedImageBuffer::EncodedImageBuffer(const EncodedImageBuffer& handle)
-: BaseHandle(handle)
-{
-}
+EncodedImageBuffer::EncodedImageBuffer(const EncodedImageBuffer& handle) = default;
+
+EncodedImageBuffer& EncodedImageBuffer::operator=(const EncodedImageBuffer& handle) = default;
+
+EncodedImageBuffer::EncodedImageBuffer(EncodedImageBuffer&& handle) = default;
+
+EncodedImageBuffer& EncodedImageBuffer::operator=(EncodedImageBuffer&& handle) = default;
 
 const EncodedImageBuffer::RawBufferType& EncodedImageBuffer::GetRawBuffer() const
 {
@@ -51,12 +54,6 @@ const std::size_t EncodedImageBuffer::GetHash() const
   return GetImplementation(*this).GetHash();
 }
 
-EncodedImageBuffer& EncodedImageBuffer::operator=(const EncodedImageBuffer& handle)
-{
-  BaseHandle::operator=(handle);
-  return *this;
-}
-
 EncodedImageBuffer EncodedImageBuffer::New(const RawBufferType& buffer)
 {
   IntrusivePtr<Internal::EncodedImageBuffer> internal = Internal::EncodedImageBuffer::New(buffer);
index 3e1f65c..4e45adf 100644 (file)
@@ -78,6 +78,21 @@ public:
   EncodedImageBuffer& operator=(const EncodedImageBuffer& handle);
 
   /**
+   * @brief This move constructor is required for (smart) pointer semantics.
+   *
+   * @param [in] handle A reference to the moved handle
+   */
+  EncodedImageBuffer(EncodedImageBuffer&& handle);
+
+  /**
+   * @brief This move assignment operator is required for (smart) pointer semantics.
+   *
+   * @param [in] handle  A reference to the moved handle
+   * @return A reference to this
+   */
+  EncodedImageBuffer& operator=(EncodedImageBuffer&& handle);
+
+  /**
    * @brief Get raw buffer data
    * @note this method return const value. Mean, you cannot change raw buffer
    * @return A RawBufferType this buffer have
index edb98e0..741b832 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -83,6 +83,11 @@ Window::Window(Window&& rhs) = default;
 
 Window& Window::operator=(Window&& rhs) = default;
 
+Window Window::DownCast(BaseHandle handle)
+{
+  return Window(dynamic_cast<Dali::Internal::Adaptor::Window*>(handle.GetObjectPtr()));
+}
+
 void Window::Add(Dali::Actor actor)
 {
   GetImplementation(*this).Add(actor);
@@ -303,12 +308,12 @@ Window::WindowSize Window::GetSize() const
   return GetImplementation(*this).GetSize();
 }
 
-void Window::SetPosition(Window::WindowPosition position)
+void Window::SetPosition(Dali::Window::WindowPosition position)
 {
   GetImplementation(*this).SetPosition(position);
 }
 
-Window::WindowPosition Window::GetPosition() const
+Dali::Window::WindowPosition Window::GetPosition() const
 {
   return GetImplementation(*this).GetPosition();
 }
index e0c8d34..f646677 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_WINDOW_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/window-enumerations.h>
+#include <dali/public-api/math/int-pair.h>
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/math/uint-16-pair.h>
 #include <dali/public-api/math/vector2.h>
@@ -71,7 +72,7 @@ class DALI_ADAPTOR_API Window : public BaseHandle
 {
 public:
   using WindowSize     = Uint16Pair; ///< Window size type @SINCE_1_2.60
-  using WindowPosition = Uint16Pair; ///< Window position type @SINCE_1_2.60
+  using WindowPosition = Int32Pair;  ///< Window position type @SINCE_2_1.45
 
   using FocusChangeSignalType = Signal<void(Window, bool)>;       ///< Window focus signal type @SINCE_1_4.35
   using ResizeSignalType      = Signal<void(Window, WindowSize)>; ///< Window resized signal type @SINCE_1_4.35
@@ -156,6 +157,15 @@ public:
   Window& operator=(Window&& rhs);
 
   /**
+   * @brief Downcast sceneHolder to window
+   *
+   * @SINCE_2_1.46
+   * @param[in] handle The handle need to downcast
+   * @return Whether it's a valid window or not
+   */
+  static Window DownCast(BaseHandle handle);
+
+  /**
    * @brief Adds a child Actor to the Window.
    *
    * The child will be referenced.
index b21fa53..535f463 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 {
 const unsigned int ADAPTOR_MAJOR_VERSION = 2;
 const unsigned int ADAPTOR_MINOR_VERSION = 1;
-const unsigned int ADAPTOR_MICRO_VERSION = 42;
+const unsigned int ADAPTOR_MICRO_VERSION = 46;
 const char* const  ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index f6dfc8b..1fbafaa 100644 (file)
@@ -17,7 +17,7 @@
 
 Name:       dali2-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    2.1.42
+Version:    2.1.46
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT