From: Wonsik Jung Date: Tue, 3 Jan 2023 03:11:42 +0000 (+0900) Subject: [Tizen] Fix the screen rotation issue X-Git-Tag: accepted/tizen/7.0/unified/20230106.165624~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=483e420a2a2198b7295299c15a12f10eeed95f37;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [Tizen] Fix the screen rotation issue Fix the screen rotation issue in FHub Device. When glViewport/glScissor is set, the screen rotation should be considered. Change-Id: I34b3c07f4efd678806d05c9b651ad44a05269909 --- diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index 2e23548..bfc4462 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -580,7 +580,12 @@ bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector surfaceRect = scene.GetCurrentSurfaceRect(); if(clippingRect == surfaceRect) { - mDamagedRects.assign(1, RecalculateRect[std::min(scene.GetCurrentSurfaceOrientation() / 90, 3)](surfaceRect, surfaceRect)); + int32_t totalAngle = scene.GetCurrentSurfaceOrientation() + scene.GetCurrentScreenOrientation(); + if(totalAngle >= 360) + { + totalAngle -= 360; + } + mDamagedRects.assign(1, RecalculateRect[std::min(totalAngle / 90, 3)](surfaceRect, surfaceRect)); } } @@ -805,7 +810,12 @@ void WindowRenderSurface::SetBufferDamagedRects(const std::vector>& da if(scene) { surfaceRect = scene.GetCurrentSurfaceRect(); - orientation = std::min(scene.GetCurrentSurfaceOrientation() / 90, 3); + int32_t totalAngle = scene.GetCurrentSurfaceOrientation() + scene.GetCurrentScreenOrientation(); + if(totalAngle >= 360) + { + totalAngle -= 360; + } + orientation = std::min(totalAngle / 90, 3); } Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();