Revert "[Tizen] Fix Window Rotation issue"
authortscholb <scholb.kim@samsung.com>
Wed, 2 Nov 2022 07:38:54 +0000 (16:38 +0900)
committertscholb <scholb.kim@samsung.com>
Wed, 2 Nov 2022 07:38:54 +0000 (16:38 +0900)
This reverts commit 9643232d147ac0dbca37d9649c498defab6a9dab.

dali/devel-api/actors/camera-actor-devel.cpp [deleted file]
dali/devel-api/actors/camera-actor-devel.h
dali/devel-api/file.list
dali/internal/render/common/render-algorithms.cpp
dali/internal/render/common/render-algorithms.h
dali/internal/render/common/render-manager.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 (file)
index ed942e6..0000000
+++ /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 <dali/devel-api/actors/camera-actor-devel.h>
-#include <dali/internal/event/actors/camera-actor-impl.h>
-
-namespace Dali
-{
-namespace DevelCameraActor
-{
-
-void RotateProjection(Dali::CameraActor camera, int32_t rotationAngle)
-{
-  Dali::GetImplementation(camera).RotateProjection(rotationAngle);
-}
-
-} // namespace DevelCustomActor
-
-} // namespace Dali
index 563118e..eedf33a 100644 (file)
@@ -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
 
index ab12aaf..7f48c24 100644 (file)
@@ -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
index 9d6d3f5..2cfd8a9 100644 (file)
@@ -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<float>(clippingBox.x), static_cast<float>(clippingBox.y), static_cast<float>(clippingBox.width), static_cast<float>(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<float>(clippingBox.height);
     viewport.height = static_cast<float>(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<float>(mViewportRectangle.x), static_cast<float>(mViewportRectangle.y), static_cast<float>(mViewportRectangle.width), static_cast<float>(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<int32_t>&                viewport,
                                                 const Rect<int>&                    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*>(&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<float>(mViewportRectangle.x), static_cast<float>(mViewportRectangle.y), static_cast<float>(mViewportRectangle.width), static_cast<float>(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<float>(mViewportRectangle.x), static_cast<float>(mViewportRectangle.y), static_cast<float>(mViewportRectangle.width), static_cast<float>(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<Graphics::Texture*>&         boundTextures,
                                                 const Rect<int32_t>&                viewport,
                                                 const Rect<int>&                    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();
index 4639811..84d5807 100644 (file)
@@ -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<Graphics::Texture*>&          boundTextures,
                                 const Rect<int32_t>&                 viewport,
                                 const Rect<int>&                     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<int32_t>&                                 viewport,
                                 const Rect<int>&                                     rootClippingRect,
-                                int                                                  orientation,
-                                const Uint16Pair&                                    sceneSize);
+                                int                                                  orientation);
 
   // Member variables:
 
index 3c6af61..6f28e02 100644 (file)
@@ -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)