From: Eunki, Hong Date: Thu, 18 Nov 2021 10:07:53 +0000 (+0900) Subject: (Partial update) Fix clipping area issue during window rotation X-Git-Tag: dali_2.1.0~4 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=e6a69cad03f49c25af199383f30ff750495242e2 (Partial update) Fix clipping area issue during window rotation When window rotation events come from ecore, the result will be stored at mPositionSize, and send event message to render thread. But when the event is not comes to render thread, the window's size value (mPositionSize) and the scene's size value (scene.GetCurrentSurfaceRect()) mismatched So the clippingRect will calculate wrong value. This patch make clipping area always use current scene surface Change-Id: Id70fd2819b84314db5ef441512a7e042da1b1c81 Signed-off-by: Eunki, Hong --- diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index 8e3c997..6c714a8 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -555,16 +555,19 @@ bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector surfaceRect(0, 0, mPositionSize.width, mPositionSize.height); - if(clippingRect == surfaceRect) - { - mDamagedRects.assign(1, surfaceRect); - } - else if(mDamagedRects.empty() && !clippingRect.IsEmpty()) + if(scene) { - // We will render clippingRect area but mDamagedRects is empty. - // So make mDamagedRects same with clippingRect to swap buffers. - mDamagedRects.assign(1, clippingRect); + Rect surfaceRect = scene.GetCurrentSurfaceRect(); + if(clippingRect == surfaceRect) + { + mDamagedRects.assign(1, surfaceRect); + } + else if(mDamagedRects.empty() && !clippingRect.IsEmpty()) + { + // We will render clippingRect area but mDamagedRects is empty. + // So make mDamagedRects same with clippingRect to swap buffers. + mDamagedRects.assign(1, clippingRect); + } } // This is now done when the render pass for the render surface begins @@ -786,8 +789,15 @@ void WindowRenderSurface::SetBufferDamagedRects(const std::vector>& da auto eglGraphics = static_cast(mGraphics); if(eglGraphics) { + // If scene is not exist, just use stored mPositionSize. Rect surfaceRect(0, 0, mPositionSize.width, mPositionSize.height); + Dali::Integration::Scene scene = mScene.GetHandle(); + if(scene) + { + surfaceRect = scene.GetCurrentSurfaceRect(); + } + Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); if(!eglImpl.IsPartialUpdateRequired() || mFullSwapNextFrame) { @@ -828,8 +838,7 @@ void WindowRenderSurface::SetBufferDamagedRects(const std::vector>& da if(!clippingRect.IsEmpty()) { - std::vector> damagedRegion; - Dali::Integration::Scene scene = mScene.GetHandle(); + std::vector> damagedRegion; if(scene) { damagedRegion.push_back(RecalculateRect[std::min(scene.GetCurrentSurfaceOrientation() / 90, 3)](clippingRect, scene.GetCurrentSurfaceRect()));