Merge branch 'devel/master' into tizen
authorjoogab.yun <joogab.yun@samsung.com>
Wed, 14 Dec 2022 01:34:02 +0000 (10:34 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Wed, 14 Dec 2022 01:34:02 +0000 (10:34 +0900)
Change-Id: I61f5e8e89ea499c05caafea098c1a23c01bea4c1

31 files changed:
dali/devel-api/adaptor-framework/native-image-source-queue.cpp
dali/devel-api/adaptor-framework/native-image-source-queue.h
dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h
dali/devel-api/adaptor-framework/vector-animation-renderer.cpp
dali/devel-api/adaptor-framework/vector-animation-renderer.h
dali/internal/adaptor/common/application-impl.cpp
dali/internal/imaging/android/native-image-source-queue-impl-android.cpp
dali/internal/imaging/android/native-image-source-queue-impl-android.h
dali/internal/imaging/common/native-image-source-queue-impl.h
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h
dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.cpp
dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h
dali/internal/imaging/x11/native-image-source-queue-impl-x.cpp
dali/internal/imaging/x11/native-image-source-queue-impl-x.h
dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp
dali/internal/vector-animation/common/vector-animation-renderer-impl.h
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h
dali/internal/window-system/android/window-system-android.cpp
dali/internal/window-system/common/window-system.h
dali/internal/window-system/macos/window-system-mac.mm
dali/internal/window-system/tizen-wayland/ecore-wl/window-system-ecore-wl.cpp
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/ecore-wl2/window-system-ecore-wl2.cpp
dali/internal/window-system/ubuntu-x11/window-system-ecore-x.cpp
dali/internal/window-system/windows/window-system-win.cpp
dali/internal/window-system/x11/window-system-x.cpp
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index 9655a5a..4bf089b 100644 (file)
@@ -76,6 +76,11 @@ bool NativeImageSourceQueue::EnqueueBuffer(uint8_t* buffer)
   return mImpl->EnqueueBuffer(buffer);
 }
 
+void NativeImageSourceQueue::FreeReleasedBuffers()
+{
+  mImpl->FreeReleasedBuffers();
+}
+
 bool NativeImageSourceQueue::CreateResource()
 {
   return mImpl->CreateResource();
index cba01ca..d6995d9 100644 (file)
@@ -145,6 +145,11 @@ public:
   bool EnqueueBuffer(uint8_t* buffer);
 
   /**
+   * @brief Free all released buffers.
+   */
+  void FreeReleasedBuffers();
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetTextureTarget()
    */
   int GetTextureTarget() const override;
index 6c96e76..3b87f4a 100644 (file)
@@ -89,6 +89,11 @@ public:
   virtual bool Render(uint32_t frameNumber) = 0;
 
   /**
+   * @brief Notify the Renderer that rendering is stopped.
+   */
+  virtual void RenderStopped() = 0;
+
+  /**
    * @brief Gets the total number of frames of the file.
    *
    * @return The total number of frames
index 5663e81..33ea624 100644 (file)
@@ -78,6 +78,11 @@ bool VectorAnimationRenderer::Render(uint32_t frameNumber)
   return GetImplementation(*this).Render(frameNumber);
 }
 
+void VectorAnimationRenderer::RenderStopped()
+{
+  GetImplementation(*this).RenderStopped();
+}
+
 uint32_t VectorAnimationRenderer::GetTotalFrameNumber() const
 {
   return GetImplementation(*this).GetTotalFrameNumber();
index 8f9c4af..1636c1f 100644 (file)
@@ -133,6 +133,11 @@ public:
   bool Render(uint32_t frameNumber);
 
   /**
+   * @brief Notify the Renderer that rendering is stopped.
+   */
+  void RenderStopped();
+
+  /**
    * @brief Gets the total number of frames of the file
    *
    * @return The total number of frames
index 1032b3a..c44318e 100644 (file)
@@ -156,6 +156,9 @@ void Application::StoreWindowPositionSize(PositionSize positionSize)
 
 void Application::ChangePreInitializedWindowSize()
 {
+  // The real screen size may be different from the value of the preinitialized state. Update it.
+  Dali::Internal::Adaptor::WindowSystem::UpdateScreenSize();
+
   int screenWidth, screenHeight;
   Dali::Internal::Adaptor::WindowSystem::GetScreenSize(screenWidth, screenHeight);
 
index 79e009f..ff0addc 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.
@@ -80,6 +80,10 @@ bool NativeImageSourceQueueAndroid::EnqueueBuffer(uint8_t* buffer)
   return false;
 }
 
+void NativeImageSourceQueueAndroid::FreeReleasedBuffers()
+{
+}
+
 bool NativeImageSourceQueueAndroid::CreateResource()
 {
   return true;
index 28a5c2e..0ed28c3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_ANDROID_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.
@@ -80,6 +80,11 @@ public:
   bool EnqueueBuffer(uint8_t* buffer) override;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::EnqueueBuffer
+   */
+  void FreeReleasedBuffers() override;
+
+  /**
    * destructor
    */
   ~NativeImageSourceQueueAndroid() override;
index 8c9028b..19ea0c6 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_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.
@@ -69,6 +69,11 @@ public:
   virtual bool EnqueueBuffer(uint8_t* buffer) = 0;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::FreeReleasedBuffers
+   */
+  virtual void FreeReleasedBuffers() = 0;
+
+  /**
    * destructor
    */
   virtual ~NativeImageSourceQueue() = default;
index c47b775..b5d926b 100644 (file)
@@ -92,7 +92,8 @@ NativeImageSourceQueueTizen::NativeImageSourceQueueTizen(uint32_t width, uint32_
   mEglImageExtensions(NULL),
   mOwnTbmQueue(false),
   mBlendingRequired(false),
-  mIsResized(false)
+  mIsResized(false),
+  mFreeRequest(false)
 {
   DALI_ASSERT_ALWAYS(Adaptor::IsAvailable());
 
@@ -302,6 +303,12 @@ bool NativeImageSourceQueueTizen::EnqueueBuffer(uint8_t* buffer)
   return false;
 }
 
+void NativeImageSourceQueueTizen::FreeReleasedBuffers()
+{
+  Dali::Mutex::ScopedLock lock(mMutex);
+  mFreeRequest = true;
+}
+
 bool NativeImageSourceQueueTizen::CreateResource()
 {
   mEglImageExtensions = mEglGraphics->GetImageExtensions();
@@ -326,24 +333,37 @@ void NativeImageSourceQueueTizen::PrepareTexture()
 {
   Dali::Mutex::ScopedLock lock(mMutex);
 
-  tbm_surface_h oldSurface = mConsumeSurface;
+  bool updated = false;
 
-  if(tbm_surface_queue_can_acquire(mTbmQueue, 0))
+  do
   {
-    if(tbm_surface_queue_acquire(mTbmQueue, &mConsumeSurface) != TBM_SURFACE_QUEUE_ERROR_NONE)
-    {
-      DALI_LOG_ERROR("Failed to aquire a tbm_surface\n");
-      return;
-    }
+    tbm_surface_h oldSurface = mConsumeSurface;
 
-    if(oldSurface)
+    if(tbm_surface_queue_can_acquire(mTbmQueue, 0))
     {
-      if(tbm_surface_internal_is_valid(oldSurface))
+      if(tbm_surface_queue_acquire(mTbmQueue, &mConsumeSurface) != TBM_SURFACE_QUEUE_ERROR_NONE)
+      {
+        DALI_LOG_ERROR("Failed to aquire a tbm_surface\n");
+        return;
+      }
+
+      if(oldSurface)
       {
-        tbm_surface_queue_release(mTbmQueue, oldSurface);
+        if(tbm_surface_internal_is_valid(oldSurface))
+        {
+          tbm_surface_queue_release(mTbmQueue, oldSurface);
+        }
       }
+      updated = true;
+    }
+    else
+    {
+      break;
     }
+  } while(mFreeRequest); // Get the last one if buffer free was requested
 
+  if(updated)
+  {
     if(mIsResized)
     {
       ResetEglImageList(false);
@@ -376,6 +396,19 @@ void NativeImageSourceQueueTizen::PrepareTexture()
       }
     }
   }
+
+  if(mFreeRequest)
+  {
+    auto iter = std::remove_if(mEglImages.begin(), mEglImages.end(), [&](EglImagePair& eglImage) {
+        if(mConsumeSurface == eglImage.first) return false;
+        mEglImageExtensions->DestroyImageKHR(eglImage.second);
+        tbm_surface_internal_unref(eglImage.first);
+        return true; });
+    mEglImages.erase(iter, mEglImages.end());
+
+    tbm_surface_queue_free_flush(mTbmQueue);
+    mFreeRequest = false;
+  }
 }
 
 bool NativeImageSourceQueueTizen::ApplyNativeFragmentShader(std::string& shader)
index 3556448..736ab60 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_TIZEN_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.
@@ -84,6 +84,11 @@ public:
   bool EnqueueBuffer(uint8_t* buffer) override;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::EnqueueBuffer
+   */
+  void FreeReleasedBuffers() override;
+
+  /**
    * destructor
    */
   ~NativeImageSourceQueueTizen() override;
@@ -199,6 +204,7 @@ private:
   bool                      mOwnTbmQueue;        ///< Whether we created tbm queue
   bool                      mBlendingRequired;   ///< Whether blending is required
   bool                      mIsResized;          ///< Whether the size has changed
+  bool                      mFreeRequest;        ///< Whether it is requested to free the released buffers
 };
 
 } // namespace Adaptor
index 8023374..5198ee3 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.
@@ -85,6 +85,10 @@ bool NativeImageSourceQueueX::EnqueueBuffer(uint8_t* buffer)
   return false;
 }
 
+void NativeImageSourceQueueX::FreeReleasedBuffers()
+{
+}
+
 bool NativeImageSourceQueueX::CreateResource()
 {
   return true;
index 5711b6c..279b368 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_X_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.
@@ -80,6 +80,11 @@ public:
   bool EnqueueBuffer(uint8_t* buffer) override;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::EnqueueBuffer
+   */
+  void FreeReleasedBuffers() override;
+
+  /**
    * destructor
    */
   ~NativeImageSourceQueueX() override;
index 8f26e41..d5c5da5 100644 (file)
@@ -28,7 +28,6 @@ namespace Internal
 {
 namespace Adaptor
 {
-
 NativeImageSourceQueueX* NativeImageSourceQueueX::New(uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue)
 {
   NativeImageSourceQueueX* image = new NativeImageSourceQueueX(width, height, colorFormat, nativeImageSourceQueue);
@@ -76,6 +75,10 @@ bool NativeImageSourceQueueX::EnqueueBuffer(uint8_t* buffer)
   return false;
 }
 
+void NativeImageSourceQueueX::FreeReleasedBuffers()
+{
+}
+
 bool NativeImageSourceQueueX::CreateResource()
 {
   return true;
index 61d1eff..279b368 100644 (file)
@@ -80,6 +80,11 @@ public:
   bool EnqueueBuffer(uint8_t* buffer) override;
 
   /**
+   * @copydoc Dali::NativeImageSourceQueue::EnqueueBuffer
+   */
+  void FreeReleasedBuffers() override;
+
+  /**
    * destructor
    */
   ~NativeImageSourceQueueX() override;
index 3ff18f2..a4af959 100644 (file)
@@ -81,6 +81,11 @@ bool VectorAnimationRenderer::Render(uint32_t frameNumber)
   return mPlugin.Render(frameNumber);
 }
 
+void VectorAnimationRenderer::RenderStopped()
+{
+  mPlugin.RenderStopped();
+}
+
 uint32_t VectorAnimationRenderer::GetTotalFrameNumber() const
 {
   return mPlugin.GetTotalFrameNumber();
index b9522cb..94d9cdd 100644 (file)
@@ -73,6 +73,11 @@ public:
   bool Render(uint32_t frameNumber);
 
   /**
+   * @copydoc Dali::VectorAnimationRenderer::RenderStopped()
+   */
+  void RenderStopped();
+
+  /**
    * @copydoc Dali::VectorAnimationRenderer::GetTotalFrameNumber()
    */
   uint32_t GetTotalFrameNumber() const;
index 000c319..011c9cd 100644 (file)
@@ -139,6 +139,14 @@ bool VectorAnimationRendererPluginProxy::Render(uint32_t frameNumber)
   return false;
 }
 
+void VectorAnimationRendererPluginProxy::RenderStopped()
+{
+  if(mPlugin)
+  {
+    mPlugin->RenderStopped();
+  }
+}
+
 uint32_t VectorAnimationRendererPluginProxy::GetTotalFrameNumber() const
 {
   if(mPlugin)
index 6537256..2be98ea 100644 (file)
@@ -69,6 +69,11 @@ public:
   bool Render(uint32_t frameNumber);
 
   /**
+   * @copydoc Dali::VectorAnimationRendererPlugin::RenderStopped()
+   */
+  void RenderStopped();
+
+  /**
    * @copydoc Dali::VectorAnimationRendererPlugin::GetTotalFrameNumber()
    */
   uint32_t GetTotalFrameNumber() const;
index 749e140..1f6b120 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.
@@ -39,7 +39,7 @@ void Shutdown()
 {
 }
 
-void GetScreenSize(int& width, int& height)
+void GetScreenSize(int32_t& width, int32_t& height)
 {
   ANativeWindow* window = Dali::Integration::AndroidFramework::Get().GetApplicationWindow();
   width                 = ANativeWindow_getWidth(window);
@@ -47,6 +47,10 @@ void GetScreenSize(int& width, int& height)
   DALI_LOG_WARNING("Native window width %d, height %d", width, height);
 }
 
+void UpdateScreenSize()
+{
+}
+
 bool SetKeyboardRepeatInfo(float rate, float delay)
 {
   return false;
index ee92762..d669791 100644 (file)
@@ -18,7 +18,9 @@
  *
  */
 
+// EXTERNAL_HEADERS
 #include <dali/public-api/object/any.h>
+#include <cstdint>
 
 namespace Dali
 {
@@ -41,7 +43,13 @@ void Shutdown();
 /**
  * @brief Get the screen size
  */
-void GetScreenSize(int& width, int& height);
+void GetScreenSize(int32_t& width, int32_t& height);
+
+/**
+ * @brief Update the screen size
+ * @note The screen size may be updated while application is running. So update the stored size.
+ */
+void UpdateScreenSize();
 
 /**
  * @copydoc Dali::Keyboard::SetRepeatInfo()
@@ -136,7 +144,7 @@ public:
    * @param[out] width The width of the screen
    * @param[out] height The height of the screen
    */
-  virtual void GetScreenSize(int& width, int& height) = 0;
+  virtual void GetScreenSize(int32_t& width, int32_t& height) = 0;
 };
 
 } // namespace Adaptor
index 9d2ee83..70aa68c 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,11 +27,15 @@ void Initialize()
 {
 }
 
-void GetScreenSize( int& width, int& height )
+void GetScreenSize( int32_t& width, int32_t& height )
 {
   NSRect r = [[NSScreen mainScreen] frame];
-  width = static_cast<int>(r.size.width);
-  height = static_cast<int>(r.size.height);
+  width = static_cast<int32_t>(r.size.width);
+  height = static_cast<int32_t>(r.size.height);
+}
+
+void UpdateScreenSize()
+{
 }
 
 bool SetKeyboardRepeatInfo( float rate, float delay )
index 626ee7e..4f57a10 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.
@@ -39,11 +39,15 @@ void Shutdown()
   ecore_wl_shutdown();
 }
 
-void GetScreenSize(int& width, int& height)
+void GetScreenSize(int32_t& width, int32_t& height)
 {
   ecore_wl_screen_size_get(&width, &height);
 }
 
+void UpdateScreenSize()
+{
+}
+
 bool SetKeyboardRepeatInfo(float rate, float delay)
 {
   return ecore_wl_keyboard_repeat_info_set(static_cast<double>(rate), static_cast<double>(delay));
index d2ebb00..3c086b6 100644 (file)
@@ -718,8 +718,6 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2(Dali::PositionSize positionSize, Any surf
   mWindowRotationAngle(0),
   mScreenRotationAngle(0),
   mSupportedPreProtation(0),
-  mScreenWidth(0),
-  mScreenHeight(0),
   mNotificationChangeState(0),
   mScreenOffModeChangeState(0),
   mBrightnessChangeState(0),
@@ -1692,24 +1690,26 @@ bool WindowBaseEcoreWl2::IsEglWindowRotationSupported()
 PositionSize WindowBaseEcoreWl2::RecalculatePositionSizeToSystem(PositionSize positionSize)
 {
   PositionSize newPositionSize;
+  int32_t      screenWidth, screenHeight;
+  WindowSystem::GetScreenSize(screenWidth, screenHeight);
 
   if(mWindowRotationAngle == 90)
   {
     newPositionSize.x      = positionSize.y;
-    newPositionSize.y      = mScreenHeight - (positionSize.x + positionSize.width);
+    newPositionSize.y      = screenHeight - (positionSize.x + positionSize.width);
     newPositionSize.width  = positionSize.height;
     newPositionSize.height = positionSize.width;
   }
   else if(mWindowRotationAngle == 180)
   {
-    newPositionSize.x      = mScreenWidth - (positionSize.x + positionSize.width);
-    newPositionSize.y      = mScreenHeight - (positionSize.y + positionSize.height);
+    newPositionSize.x      = screenWidth - (positionSize.x + positionSize.width);
+    newPositionSize.y      = screenHeight - (positionSize.y + positionSize.height);
     newPositionSize.width  = positionSize.width;
     newPositionSize.height = positionSize.height;
   }
   else if(mWindowRotationAngle == 270)
   {
-    newPositionSize.x      = mScreenWidth - (positionSize.y + positionSize.height);
+    newPositionSize.x      = screenWidth - (positionSize.y + positionSize.height);
     newPositionSize.y      = positionSize.x;
     newPositionSize.width  = positionSize.height;
     newPositionSize.height = positionSize.width;
@@ -1728,25 +1728,27 @@ PositionSize WindowBaseEcoreWl2::RecalculatePositionSizeToSystem(PositionSize po
 PositionSize WindowBaseEcoreWl2::RecalculatePositionSizeToCurrentOrientation(PositionSize positionSize)
 {
   PositionSize newPositionSize;
+  int32_t      screenWidth, screenHeight;
+  WindowSystem::GetScreenSize(screenWidth, screenHeight);
 
   if(mWindowRotationAngle == 90)
   {
-    newPositionSize.x      = mScreenHeight - (positionSize.y + positionSize.height);
+    newPositionSize.x      = screenHeight - (positionSize.y + positionSize.height);
     newPositionSize.y      = positionSize.x;
     newPositionSize.width  = positionSize.height;
     newPositionSize.height = positionSize.width;
   }
   else if(mWindowRotationAngle == 180)
   {
-    newPositionSize.x      = mScreenWidth - (positionSize.x + positionSize.width);
-    newPositionSize.y      = mScreenHeight - (positionSize.y + positionSize.height);
+    newPositionSize.x      = screenWidth - (positionSize.x + positionSize.width);
+    newPositionSize.y      = screenHeight - (positionSize.y + positionSize.height);
     newPositionSize.width  = positionSize.width;
     newPositionSize.height = positionSize.height;
   }
   else if(mWindowRotationAngle == 270)
   {
     newPositionSize.x      = positionSize.y;
-    newPositionSize.y      = mScreenWidth - (positionSize.x + positionSize.width);
+    newPositionSize.y      = screenWidth - (positionSize.x + positionSize.width);
     newPositionSize.width  = positionSize.height;
     newPositionSize.height = positionSize.width;
   }
@@ -2636,9 +2638,6 @@ void WindowBaseEcoreWl2::CreateWindow(PositionSize positionSize)
 
   // Set default type
   ecore_wl2_window_type_set(mEcoreWindow, ECORE_WL2_WINDOW_TYPE_TOPLEVEL);
-
-  // Get Screen width, height
-  ecore_wl2_display_screen_size_get(display, &mScreenWidth, &mScreenHeight);
 }
 
 void WindowBaseEcoreWl2::SetParent(WindowBase* parentWinBase, bool belowParent)
index 6b66478..d5789ed 100644 (file)
@@ -618,8 +618,6 @@ private:
   int        mWindowRotationAngle;
   int        mScreenRotationAngle;
   int        mSupportedPreProtation;
-  int        mScreenWidth;
-  int        mScreenHeight;
 
   uint32_t          mNotificationChangeState;
   uint32_t          mScreenOffModeChangeState;
index b10af4c..514c38b 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.
@@ -30,6 +30,12 @@ namespace Adaptor
 {
 namespace WindowSystem
 {
+namespace
+{
+static int32_t gScreenWidth  = 0;
+static int32_t gScreenHeight = 0;
+} // unnamed namespace
+
 void Initialize()
 {
   ecore_wl2_init();
@@ -40,14 +46,28 @@ void Shutdown()
   ecore_wl2_shutdown();
 }
 
-void GetScreenSize(int& width, int& height)
+void GetScreenSize(int32_t& width, int32_t& height)
+{
+  if(gScreenWidth == 0 || gScreenHeight == 0)
+  {
+    Ecore_Wl2_Display* display = ecore_wl2_display_connect(NULL);
+    if(display)
+    {
+      ecore_wl2_display_screen_size_get(display, &gScreenWidth, &gScreenHeight);
+      DALI_ASSERT_ALWAYS((gScreenWidth > 0) && "screen width is 0");
+      DALI_ASSERT_ALWAYS((gScreenHeight > 0) && "screen height is 0");
+    }
+  }
+  width  = gScreenWidth;
+  height = gScreenHeight;
+}
+
+void UpdateScreenSize()
 {
   Ecore_Wl2_Display* display = ecore_wl2_display_connect(NULL);
   if(display)
   {
-    ecore_wl2_display_screen_size_get(display, &width, &height);
-    DALI_ASSERT_ALWAYS((width > 0) && "screen width is 0");
-    DALI_ASSERT_ALWAYS((height > 0) && "screen height is 0");
+    ecore_wl2_display_screen_size_get(display, &gScreenWidth, &gScreenHeight);
   }
 }
 
index aa91438..71f840e 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.
@@ -40,11 +40,15 @@ void Shutdown()
   ecore_x_shutdown();
 }
 
-void GetScreenSize(int& width, int& height)
+void GetScreenSize(int32_t& width, int32_t& height)
 {
   ecore_x_screen_size_get(ecore_x_default_screen_get(), &width, &height);
 }
 
+void UpdateScreenSize()
+{
+}
+
 bool SetKeyboardRepeatInfo(float rate, float delay)
 {
   return false;
index 1536d0d..7740edd 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.
@@ -33,12 +33,16 @@ void Initialize()
 {
 }
 
-void GetScreenSize(int& width, int& height)
+void GetScreenSize(int32_t& width, int32_t& height)
 {
   width  = GetSystemMetrics(SM_CXSCREEN);
   height = GetSystemMetrics(SM_CYSCREEN);
 }
 
+void UpdateScreenSize()
+{
+}
+
 bool SetKeyboardRepeatInfo(float rate, float delay)
 {
   return false;
index 13c5618..d439812 100644 (file)
@@ -1044,6 +1044,10 @@ void GetScreenSize(int& width, int& height)
   }
 }
 
+void UpdateScreenSize()
+{
+}
+
 bool SetKeyboardRepeatInfo(float rate, float delay)
 {
   return false;
index e98c02f..1fcdf45 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 {
 const unsigned int ADAPTOR_MAJOR_VERSION = 2;
 const unsigned int ADAPTOR_MINOR_VERSION = 2;
-const unsigned int ADAPTOR_MICRO_VERSION = 4;
+const unsigned int ADAPTOR_MICRO_VERSION = 5;
 const char* const  ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index ebe6a75..d00b6c7 100644 (file)
@@ -17,7 +17,7 @@
 
 Name:       dali2-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    2.2.4
+Version:    2.2.5
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT