From eab4a72e463a76a82f50faa61130bea10b687515 Mon Sep 17 00:00:00 2001 From: tscholb Date: Wed, 2 Nov 2022 16:38:54 +0900 Subject: [PATCH] Revert "[Tizen] Fix Window Rotation issue" This reverts commit 9643232d147ac0dbca37d9649c498defab6a9dab. --- dali/devel-api/actors/camera-actor-devel.cpp | 34 ---------------------- dali/devel-api/actors/camera-actor-devel.h | 8 ------ dali/devel-api/file.list | 1 - dali/internal/render/common/render-algorithms.cpp | 35 ++++++----------------- dali/internal/render/common/render-algorithms.h | 8 ++---- dali/internal/render/common/render-manager.cpp | 5 ++-- 6 files changed, 13 insertions(+), 78 deletions(-) delete mode 100644 dali/devel-api/actors/camera-actor-devel.cpp diff --git a/dali/devel-api/actors/camera-actor-devel.cpp b/dali/devel-api/actors/camera-actor-devel.cpp deleted file mode 100644 index ed942e6..0000000 --- a/dali/devel-api/actors/camera-actor-devel.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2020 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// INTERNAL INCLUDES -#include -#include - -namespace Dali -{ -namespace DevelCameraActor -{ - -void RotateProjection(Dali::CameraActor camera, int32_t rotationAngle) -{ - Dali::GetImplementation(camera).RotateProjection(rotationAngle); -} - -} // namespace DevelCustomActor - -} // namespace Dali diff --git a/dali/devel-api/actors/camera-actor-devel.h b/dali/devel-api/actors/camera-actor-devel.h index 563118e..eedf33a 100644 --- a/dali/devel-api/actors/camera-actor-devel.h +++ b/dali/devel-api/actors/camera-actor-devel.h @@ -37,14 +37,6 @@ enum }; } // Namespace Property - -/** - * @brief Request to rotate window after MVP matrix is multiplied. - * It is used in case that the target buffer direction is different from the window direction. - * @param [in] camera Dali::CameraActor that will be rotated. - * @param [in] rotationAngle The rotation angle (0, 90, 180, and 270. Note Dali::WindowOrientation.) - */ -DALI_CORE_API void RotateProjection(Dali::CameraActor camera, int32_t rotationAngle); } // namespace DevelCameraActor } // Namespace Dali diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index ab12aaf..7f48c24 100644 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -4,7 +4,6 @@ SET( devel_api_src_dir ${ROOT_SRC_DIR}/dali/devel-api ) # Add devel source files here for DALi internal developer files used by Adaptor & Toolkit SET( devel_api_src_files ${devel_api_src_dir}/actors/actor-devel.cpp - ${devel_api_src_dir}/actors/camera-actor-devel.cpp ${devel_api_src_dir}/actors/custom-actor-devel.cpp ${devel_api_src_dir}/animation/animation-data.cpp ${devel_api_src_dir}/animation/animation-devel.cpp diff --git a/dali/internal/render/common/render-algorithms.cpp b/dali/internal/render/common/render-algorithms.cpp index 9d6d3f5..2cfd8a9 100644 --- a/dali/internal/render/common/render-algorithms.cpp +++ b/dali/internal/render/common/render-algorithms.cpp @@ -143,30 +143,15 @@ struct GraphicsStencilOp Graphics::StencilOp op{Graphics::StencilOp::KEEP}; }; -inline Graphics::Viewport ViewportFromClippingBox(const Uint16Pair& sceneSize, ClippingBox clippingBox, int orientation) +inline Graphics::Viewport ViewportFromClippingBox(ClippingBox clippingBox, int orientation) { Graphics::Viewport viewport{static_cast(clippingBox.x), static_cast(clippingBox.y), static_cast(clippingBox.width), static_cast(clippingBox.height), 0.0f, 0.0f}; if(orientation == 90 || orientation == 270) { - if(orientation == 90) - { - viewport.x = sceneSize.GetY() - (clippingBox.y + clippingBox.height); - viewport.y = clippingBox.x; - } - else // orientation == 270 - { - viewport.x = clippingBox.y; - viewport.y = sceneSize.GetX() - (clippingBox.x + clippingBox.width); - } viewport.width = static_cast(clippingBox.height); viewport.height = static_cast(clippingBox.width); } - else if(orientation == 180) - { - viewport.x = sceneSize.GetX() - (clippingBox.x + clippingBox.width); - viewport.y = sceneSize.GetY() - (clippingBox.y + clippingBox.height); - } return viewport; } @@ -474,7 +459,7 @@ inline void RenderAlgorithms::SetupScissorClipping( useScissorBox.y = (instruction.mFrameBuffer->GetHeight() - useScissorBox.height) - useScissorBox.y; } - Graphics::Viewport graphicsViewport{static_cast(mViewportRectangle.x), static_cast(mViewportRectangle.y), static_cast(mViewportRectangle.width), static_cast(mViewportRectangle.height), 0.0f, 0.0f}; + Graphics::Viewport graphicsViewport = ViewportFromClippingBox(mViewportRectangle, 0); commandBuffer.SetScissor(Rect2DFromClippingBox(useScissorBox, orientation, graphicsViewport)); } } @@ -589,8 +574,7 @@ inline void RenderAlgorithms::ProcessRenderList(const RenderList& const RenderInstruction& instruction, const Rect& viewport, const Rect& rootClippingRect, - int orientation, - const Uint16Pair& sceneSize) + int orientation) { DALI_PRINT_RENDER_LIST(renderList); @@ -610,7 +594,8 @@ inline void RenderAlgorithms::ProcessRenderList(const RenderList& auto* mutableRenderList = const_cast(&renderList); auto& secondaryCommandBuffer = mutableRenderList->GetCommandBuffer(mGraphicsController); secondaryCommandBuffer.Reset(); - secondaryCommandBuffer.SetViewport(ViewportFromClippingBox(sceneSize, mViewportRectangle, orientation)); + + secondaryCommandBuffer.SetViewport(ViewportFromClippingBox(mViewportRectangle, orientation)); mHasLayerScissor = false; // Setup Scissor testing (for both viewport and per-node scissor) @@ -620,7 +605,7 @@ inline void RenderAlgorithms::ProcessRenderList(const RenderList& // on the bottom of the stack if(!rootClippingRect.IsEmpty()) { - Graphics::Viewport graphicsViewport{static_cast(mViewportRectangle.x), static_cast(mViewportRectangle.y), static_cast(mViewportRectangle.width), static_cast(mViewportRectangle.height), 0.0f, 0.0f}; + Graphics::Viewport graphicsViewport = ViewportFromClippingBox(mViewportRectangle, 0); secondaryCommandBuffer.SetScissorTestEnable(true); secondaryCommandBuffer.SetScissor(Rect2DFromRect(rootClippingRect, orientation, graphicsViewport)); mScissorStack.push_back(rootClippingRect); @@ -634,7 +619,7 @@ inline void RenderAlgorithms::ProcessRenderList(const RenderList& if(renderList.IsClipping()) { - Graphics::Viewport graphicsViewport{static_cast(mViewportRectangle.x), static_cast(mViewportRectangle.y), static_cast(mViewportRectangle.width), static_cast(mViewportRectangle.height), 0.0f, 0.0f}; + Graphics::Viewport graphicsViewport = ViewportFromClippingBox(mViewportRectangle, 0); secondaryCommandBuffer.SetScissorTestEnable(true); const ClippingBox& layerScissorBox = renderList.GetClippingBox(); secondaryCommandBuffer.SetScissor(Rect2DFromClippingBox(layerScissorBox, orientation, graphicsViewport)); @@ -738,8 +723,7 @@ void RenderAlgorithms::ProcessRenderInstruction(const RenderInstruction& Vector& boundTextures, const Rect& viewport, const Rect& rootClippingRect, - int orientation, - const Uint16Pair& sceneSize) + int orientation) { DALI_PRINT_RENDER_INSTRUCTION(instruction, bufferIndex); @@ -772,8 +756,7 @@ void RenderAlgorithms::ProcessRenderInstruction(const RenderInstruction& instruction, //added for reflection effect viewport, rootClippingRect, - orientation, - sceneSize); + orientation); // Execute command buffer auto* commandBuffer = renderList->GetCommandBuffer(); diff --git a/dali/internal/render/common/render-algorithms.h b/dali/internal/render/common/render-algorithms.h index 4639811..84d5807 100644 --- a/dali/internal/render/common/render-algorithms.h +++ b/dali/internal/render/common/render-algorithms.h @@ -61,7 +61,6 @@ public: * @param[in] viewport The viewport for drawing * @param[in] rootClippingRect The clipping rectangle * @param[in] orientation The Scene's surface orientation. - * @param[in] sceneSize The Scene's surface size. */ void ProcessRenderInstruction(const SceneGraph::RenderInstruction& instruction, BufferIndex bufferIndex, @@ -70,8 +69,7 @@ public: Vector& boundTextures, const Rect& viewport, const Rect& rootClippingRect, - int orientation, - const Uint16Pair& sceneSize); + int orientation); /** * Resets main command buffer (per scene) @@ -157,7 +155,6 @@ private: * @param[in] viewport The Viewport * @param[in] rootClippingRect The root clipping rectangle * @param[in] orientation The Scene's surface orientation - * @param[in] sceneSize The Scene's surface size. */ inline void ProcessRenderList(const Dali::Internal::SceneGraph::RenderList& renderList, BufferIndex bufferIndex, @@ -169,8 +166,7 @@ private: const Dali::Internal::SceneGraph::RenderInstruction& instruction, // in the case of reflection, things like CullFace need to be adjusted for reflection world const Rect& viewport, const Rect& rootClippingRect, - int orientation, - const Uint16Pair& sceneSize); + int orientation); // Member variables: diff --git a/dali/internal/render/common/render-manager.cpp b/dali/internal/render/common/render-manager.cpp index 3c6af61..6f28e02 100644 --- a/dali/internal/render/common/render-manager.cpp +++ b/dali/internal/render/common/render-manager.cpp @@ -908,7 +908,7 @@ void RenderManager::RenderScene(Integration::RenderStatus& status, Integration:: // Scissor's value should be set based on the default system coordinates. // When the surface is rotated, the input values already were set with the rotated angle. // So, re-calculation is needed. - scissorArea = RecalculateScissorArea(scissorArea, surfaceOrientation, surfaceRect); + scissorArea = RecalculateScissorArea(scissorArea, surfaceOrientation, viewportRect); // Begin render pass mainCommandBuffer->BeginRenderPass( @@ -933,8 +933,7 @@ void RenderManager::RenderScene(Integration::RenderStatus& status, Integration:: mImpl->boundTextures, viewportRect, clippingRect, - surfaceOrientation, - Uint16Pair(surfaceRect.width, surfaceRect.height)); + surfaceOrientation); Graphics::SyncObject* syncObject{nullptr}; // If the render instruction has an associated render tracker (owned separately) -- 2.7.4