aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2013-11-06 12:08:42 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-09 22:46:47 +0100
commit59fb0d88a0ad354311d0f2e8f27c738f05f524c0 (patch)
treea77a82f584ec0501a09e8e670d97f264c698a89a /src/quick
parentafee694ce5d65518e5908b97e9a691c03fe0a844 (diff)
Fix assert with native text rendering.
The renderer only passed the very first node's material to updateState() as "new", yet pass the following node's materials to updateState() as "old". This triggered an assert in the QSGTextMaskMaterial's updateState as the native text nodes are invalid until they get called with their own material as "new". This goes against how the scene graph is supposed to be used, but update the code in the renderer regardless as this used to work and the fix there is not wrong. Every node in a batch has identical material, so pass the same instance for both "new" and "old" except for the first node in the batch which gets old==0. Change-Id: Ie8ae6fcd63adde08d80e9083e910836ede6694ee Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index 3ea4b2ee1e..940b8dd02b 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -2045,7 +2045,9 @@ void Renderer::renderUnmergedBatch(const Batch *batch)
program->updateState(state(dirty), material, m_currentMaterial);
- m_currentMaterial = gn->activeMaterial();
+ // We don't need to bother with asking each node for its material as they
+ // are all identical (compare==0) since they are in the same batch.
+ m_currentMaterial = material;
QSGGeometry* g = gn->geometry();
char const *const *attrNames = program->attributeNames();