From 483e420a2a2198b7295299c15a12f10eeed95f37 Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Tue, 3 Jan 2023 12:11:42 +0900 Subject: [PATCH] [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 --- .../window-system/common/window-render-surface.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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(); -- 2.7.4