[Tizen](Partial Update) partiall update after window rotation works well. 88/281188/1 accepted/tizen/unified/20220914.164050
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 8 Sep 2022 02:23:26 +0000 (11:23 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 14 Sep 2022 06:04:37 +0000 (15:04 +0900)
Currently, mDamagedRects should be "rotated" rects,
and others (clippingRect, mDamagedBufferRects) are not be rotated.

But current clippingRect merged by rotated rects.

This patch make clippingRect calculate well.

And also, if clippingRect become empty, mDamagedRects should be cleared.

Change-Id: I4c71d91ee01da67b42f446fb438c0e2fe29d1d67

dali/internal/window-system/common/window-render-surface.cpp
dali/internal/window-system/common/window-render-surface.h

index 2eb946a..4f00430 100644 (file)
@@ -623,7 +623,7 @@ bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector<Rect
     Rect<int> surfaceRect = scene.GetCurrentSurfaceRect();
     if(clippingRect == surfaceRect)
     {
-      mDamagedRects.assign(1, surfaceRect);
+      mDamagedRects.assign(1, RecalculateRect[std::min(scene.GetCurrentSurfaceOrientation() / 90, 3)](surfaceRect, surfaceRect));
     }
   }
 
@@ -867,7 +867,6 @@ void WindowRenderSurface::SetBufferDamagedRects(const std::vector<Rect<int>>& da
     {
       InsertRects(mBufferDamagedRects, surfaceRect);
       clippingRect = surfaceRect;
-      mDamagedRects.assign(1, RecalculateRect[orientation](surfaceRect, surfaceRect));
       return;
     }
 
@@ -875,6 +874,7 @@ void WindowRenderSurface::SetBufferDamagedRects(const std::vector<Rect<int>>& da
     {
       // Empty damaged rect. We don't need rendering
       clippingRect = Rect<int>();
+      // Clean up current damanged rects.
       mDamagedRects.clear();
       return;
     }
@@ -888,7 +888,6 @@ void WindowRenderSurface::SetBufferDamagedRects(const std::vector<Rect<int>>& da
     {
       InsertRects(mBufferDamagedRects, surfaceRect);
       clippingRect = surfaceRect;
-      mDamagedRects.assign(1, RecalculateRect[orientation](surfaceRect, surfaceRect));
       return;
     }
 
index 05e7bf7..660dfdb 100644 (file)
@@ -338,7 +338,7 @@ private: // Data
   int                                    mScreenRotationAngle;
   uint32_t                               mDpiHorizontal;
   uint32_t                               mDpiVertical;
-  std::vector<Rect<int>>                 mDamagedRects{}; ///< Keeps collected damaged render items rects for one render pass
+  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;