+ break;
+ }
+ }
+}
+
+inline void RenderAlgorithms::ProcessRenderList( const RenderList& renderList,
+ Context& context,
+ BufferIndex bufferIndex,
+ const Matrix& viewMatrix,
+ const Matrix& projectionMatrix,
+ Integration::DepthBufferAvailable depthBufferAvailable,
+ Integration::StencilBufferAvailable stencilBufferAvailable,
+ Vector<GLuint>& boundTextures,
+ int orientation,
+ Dali::ClippingBox& scissorBox )
+{
+ 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 = context.GetViewport();
+ mHasLayerScissor = false;
+
+ if( orientation == 90 || orientation == 270 )
+ {
+ int temp = mViewportRectangle.width;
+ mViewportRectangle.width = mViewportRectangle.height;
+ mViewportRectangle.height = temp;
+ }
+
+ // Setup Scissor testing (for both viewport and per-node scissor)
+ mScissorStack.clear();
+ if( renderList.IsClipping() )
+ {
+ context.SetScissorTest( true );
+ const ClippingBox& layerScissorBox = renderList.GetClippingBox();
+ GLint x = layerScissorBox.x;
+ GLint y = layerScissorBox.y;
+
+ if( orientation == 90 )
+ {
+ x = mViewportRectangle.height - (layerScissorBox.y + layerScissorBox.height);
+ y = layerScissorBox.x;
+ context.Scissor( x, y, layerScissorBox.height, layerScissorBox.width );
+ }
+ else if( orientation == 180 )
+ {
+ x = mViewportRectangle.width - (layerScissorBox.x + layerScissorBox.width);
+ y = mViewportRectangle.height - (layerScissorBox.y + layerScissorBox.height);
+ context.Scissor( x, y, layerScissorBox.width, layerScissorBox.height );
+ }
+ else if( orientation == 270 )
+ {
+ x = layerScissorBox.y;
+ y = mViewportRectangle.width - (layerScissorBox.x + layerScissorBox.width);
+ context.Scissor( x, y, layerScissorBox.height, layerScissorBox.width );