diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-09-14 13:05:58 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-09-17 11:56:12 +0200 |
commit | 383b70aba1e27adb3e836db6f41edd2c8b6275ef (patch) | |
tree | b4eef11653fc9f89843fb87917cb1aa756d7a9f6 | |
parent | 2774ecb191862071bd1cb2dea1266feff377e3bc (diff) |
Ensure init of m_current_projection_matrix in single-clipped-item scene
If there is only one item in the scene, based on QSGRenderNode, with
clipping turned on, then we did not end up in render(Un)MergedBatch(),
so the usual initialization was not done, and the custom item was
effectively invisible. This is because of directly calling
renderRenderNode() from renderBatches(), bypassing the other places
where it would normally be done; so now we initialize it only in that
case in renderBatches().
Fixes: QTBUG-95881
Change-Id: Ic306ae16690103ad65a2e2ccc2f58907577e5b1b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index e6c2c1b573..fae9f78ddf 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -4042,12 +4042,14 @@ void Renderer::renderBatches() if (Q_LIKELY(renderAlpha)) { for (int i=0; i<m_alphaBatches.size(); ++i) { Batch *b = m_alphaBatches.at(i); - if (b->merged) + if (b->merged) { renderMergedBatch(b); - else if (b->isRenderNode) + } else if (b->isRenderNode) { + m_current_projection_matrix = projectionMatrix(); renderRenderNode(b); - else + } else { renderUnmergedBatch(b); + } } } |