From 23f970650fa44edfc18706c277ce87000fd12632 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Wed, 19 Jul 2023 15:10:25 +0200 Subject: [PATCH] always use stencil clipping - unfortunately the batch renderer introduces rounding errors for the significantly faster scissor clips --- src/nodes/QskBoxClipNode.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/nodes/QskBoxClipNode.cpp b/src/nodes/QskBoxClipNode.cpp index 759717a8..fe1fe4fc 100644 --- a/src/nodes/QskBoxClipNode.cpp +++ b/src/nodes/QskBoxClipNode.cpp @@ -39,7 +39,25 @@ void QskBoxClipNode::setBox( const QRectF& rect, m_rect = rect; m_hash = hash; + bool isRectangular = false; + +#if 0 + /* + Depending on isRectangular the "renderer can use scissoring instead of stencil, + which is significantly faster." + + However the batch renderer ( qsgbatchrenderer.cpp ) is rounding the clip rectangle + to integers and the clip might become too small/large. + + So we always have to use stencil clipping - even if it might have a negative + impact on the performance. TODO ... + */ + if ( shape.isRectangle() ) + isRectangular = true; +#endif + + if ( isRectangular ) { if ( m_geometry.vertexCount() > 0 ) m_geometry.allocate( 0 );