--- /dev/null
+/*
+ * 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
Graphics::StencilOp op{Graphics::StencilOp::KEEP};
};
-inline Graphics::Viewport ViewportFromClippingBox(ClippingBox clippingBox, int orientation)
+inline Graphics::Viewport ViewportFromClippingBox(const Uint16Pair& sceneSize, 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;
}
useScissorBox.y = (instruction.mFrameBuffer->GetHeight() - useScissorBox.height) - useScissorBox.y;
}
- Graphics::Viewport graphicsViewport = ViewportFromClippingBox(mViewportRectangle, 0);
+ 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};
commandBuffer.SetScissor(Rect2DFromClippingBox(useScissorBox, orientation, graphicsViewport));
}
}
const RenderInstruction& instruction,
const Rect<int32_t>& viewport,
const Rect<int>& rootClippingRect,
- int orientation)
+ int orientation,
+ const Uint16Pair& sceneSize)
{
DALI_PRINT_RENDER_LIST(renderList);
auto* mutableRenderList = const_cast<RenderList*>(&renderList);
auto& secondaryCommandBuffer = mutableRenderList->GetCommandBuffer(mGraphicsController);
secondaryCommandBuffer.Reset();
-
- secondaryCommandBuffer.SetViewport(ViewportFromClippingBox(mViewportRectangle, orientation));
+ secondaryCommandBuffer.SetViewport(ViewportFromClippingBox(sceneSize, mViewportRectangle, orientation));
mHasLayerScissor = false;
// Setup Scissor testing (for both viewport and per-node scissor)
// on the bottom of the stack
if(!rootClippingRect.IsEmpty())
{
- Graphics::Viewport graphicsViewport = ViewportFromClippingBox(mViewportRectangle, 0);
+ 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};
secondaryCommandBuffer.SetScissorTestEnable(true);
secondaryCommandBuffer.SetScissor(Rect2DFromRect(rootClippingRect, orientation, graphicsViewport));
mScissorStack.push_back(rootClippingRect);
if(renderList.IsClipping())
{
- Graphics::Viewport graphicsViewport = ViewportFromClippingBox(mViewportRectangle, 0);
+ 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};
secondaryCommandBuffer.SetScissorTestEnable(true);
const ClippingBox& layerScissorBox = renderList.GetClippingBox();
secondaryCommandBuffer.SetScissor(Rect2DFromClippingBox(layerScissorBox, orientation, graphicsViewport));
Vector<Graphics::Texture*>& boundTextures,
const Rect<int32_t>& viewport,
const Rect<int>& rootClippingRect,
- int orientation)
+ int orientation,
+ const Uint16Pair& sceneSize)
{
DALI_PRINT_RENDER_INSTRUCTION(instruction, bufferIndex);
instruction, //added for reflection effect
viewport,
rootClippingRect,
- orientation);
+ orientation,
+ sceneSize);
// Execute command buffer
auto* commandBuffer = renderList->GetCommandBuffer();
* @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,
Vector<Graphics::Texture*>& boundTextures,
const Rect<int32_t>& viewport,
const Rect<int>& rootClippingRect,
- int orientation);
+ int orientation,
+ const Uint16Pair& sceneSize);
/**
* Resets main command buffer (per scene)
* @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,
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);
+ int orientation,
+ const Uint16Pair& sceneSize);
// Member variables: