+ }
+}
+
+inline void RenderAlgorithms::ProcessRenderList(const RenderList& renderList,
+ BufferIndex bufferIndex,
+ const Matrix& viewMatrix,
+ const Matrix& projectionMatrix,
+ Integration::DepthBufferAvailable depthBufferAvailable,
+ Integration::StencilBufferAvailable stencilBufferAvailable,
+ Vector<Graphics::Texture*>& boundTextures,
+ const RenderInstruction& instruction,
+ const Rect<int32_t>& viewport,
+ const Rect<int>& rootClippingRect,
+ int orientation,
+ const Uint16Pair& sceneSize)
+{
+ DALI_PRINT_RENDER_LIST(renderList);
+
+ // Note: The depth buffer is enabled or disabled on a per-renderer basis.
+ // Here we pre-calculate the value to use if these modes are set to AUTO.
+ const bool autoDepthTestMode((depthBufferAvailable == Integration::DepthBufferAvailable::TRUE) &&
+ !(renderList.GetSourceLayer()->IsDepthTestDisabled()) &&
+ renderList.HasColorRenderItems());
+ const std::size_t count = renderList.Count();
+ uint32_t lastClippingDepth(0u);
+ uint32_t lastClippingId(0u);
+ bool usedStencilBuffer(false);
+ bool firstDepthBufferUse(true);
+
+ mViewportRectangle = viewport;
+
+ auto* mutableRenderList = const_cast<RenderList*>(&renderList);
+ auto& secondaryCommandBuffer = mutableRenderList->GetCommandBuffer(mGraphicsController);
+ secondaryCommandBuffer.Reset();
+ secondaryCommandBuffer.SetViewport(ViewportFromClippingBox(sceneSize, mViewportRectangle, orientation));
+ mHasLayerScissor = false;
+
+ // Setup Scissor testing (for both viewport and per-node scissor)
+ mScissorStack.clear();
+
+ // Add root clipping rect (set manually for Render function by partial update for example)
+ // on the bottom of the stack
+ if(!rootClippingRect.IsEmpty())
+ {
+ Graphics::Viewport graphicsViewport = ViewportFromClippingBox(sceneSize, mViewportRectangle, 0);
+ secondaryCommandBuffer.SetScissorTestEnable(true);
+ secondaryCommandBuffer.SetScissor(Rect2DFromRect(rootClippingRect, orientation, graphicsViewport));
+ mScissorStack.push_back(rootClippingRect);
+ }
+ // We are not performing a layer clip and no clipping rect set. Add the viewport as the root scissor rectangle.
+ else if(!renderList.IsClipping())
+ {
+ secondaryCommandBuffer.SetScissorTestEnable(false);
+ mScissorStack.push_back(mViewportRectangle);
+ }