aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-01-28 20:53:01 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-06 16:02:02 +0100
commitb70ab35b21665510a7af85c549964ebe6d39b115 (patch)
treea5f33a6b23ade62043c0e6e6626fd811272acf32 /src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
parent4e835a592901364599da364cfe2006f99e34a6c9 (diff)
Avoid renderlist rebuilds in the scene graph renderer.
Transform, material, opacity and geometry changes all used to trigger full rebuilds, which meant that very little geometry could be retained between frames. For instance, a rotating spinner on top of a gridview this would cause a full rebuild where nothing is retained. This change introduces new concept to the renderer: partial rebuilding based on render order ranges. Since the render order of nodes is strictly defined by their position in the tree and nothing else, we should use that for the majority of rebuilds. When a change comes in for a node, we invalidate its batch and all batches which it has overlapping render orders with. Render order rebuilds only happen when nodes are added and removed. Change-Id: Ib4cb284164892b409e3fff5c492a54d60a5de2d7 Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h')
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
index 0aa84da185..379c0ee00e 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
@@ -264,6 +264,8 @@ struct Batch
int vertexCount;
int indexCount;
+ int lastOrderInBatch;
+
uint isOpaque : 1;
uint needsUpload : 1;
uint merged : 1;
@@ -351,6 +353,7 @@ private:
int m_added;
int m_transformChange;
+ int m_opacityChange;
QMatrix4x4 m_identityMatrix;
};
@@ -422,7 +425,7 @@ private:
void prepareOpaqueBatches();
bool checkOverlap(int first, int last, const Rect &bounds);
void prepareAlphaBatches();
- void invalidateAlphaBatchesForRoot(Node *root);
+ void invalidateBatchAndOverlappingRenderOrders(Batch *batch);
void uploadBatch(Batch *b);
void uploadMergedElement(Element *e, int vaOffset, char **vertexData, char **zData, char **indexData, quint16 *iBase, int *indexCount);