summaryrefslogtreecommitdiffstats
path: root/src/core/delegated_frame_node.h
diff options
context:
space:
mode:
authorMichael BrĂ¼ning <michael.bruning@qt.io>2016-12-23 14:03:03 +0100
committerMichael BrĂ¼ning <michael.bruning@qt.io>2017-01-11 08:49:37 +0000
commit4804e331304c5bcb79ebc785485793e5f1d8759e (patch)
tree7f484e566ef7bab9a5dae07410510d7b872eaf65 /src/core/delegated_frame_node.h
parent17f9e58022b181b1a097ec75cf824714778c8946 (diff)
Optimize scene graph rendering by reusing old nodes if possible
Previously, Qt WebEngine always dropped all existing scene graph nodes that were created for previous frames and built up a whole new tree. The main reason for this was that the render pass structure is not guaranteed to remain the same across two frames. This resulted in a full repaint of every new frame, even if only a small area had changed. We now check first if the structure of the frame data has changed across two sequential frames. We only discard the old nodes if there actually has been a change. Otherwise, we reuse the scene graph nodes and only update the nodes that have changed. A general exception to this at the moment is video. In case any streaming video or yuv video nodes are found in the render pass, all nodes get recreated. Task-number: QTBUG-57720 Change-Id: I8998577af48a163d54144f205c316ee427ed0307 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/delegated_frame_node.h')
-rw-r--r--src/core/delegated_frame_node.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/delegated_frame_node.h b/src/core/delegated_frame_node.h
index 36ec20f1d..6178bd232 100644
--- a/src/core/delegated_frame_node.h
+++ b/src/core/delegated_frame_node.h
@@ -74,6 +74,7 @@ public:
ChromiumCompositorData() : frameDevicePixelRatio(1) { }
QHash<unsigned, QSharedPointer<ResourceHolder> > resourceHolders;
std::unique_ptr<cc::DelegatedFrameData> frameData;
+ std::unique_ptr<cc::DelegatedFrameData> previousFrameData;
qreal frameDevicePixelRatio;
};
@@ -100,6 +101,7 @@ private:
QVector<QSharedPointer<QSGRootNode> > renderPassRootNodes;
QVector<QSharedPointer<QSGTexture> > textureStrongRefs;
} m_sgObjects;
+ QVector<QSGNode*> m_sceneGraphNodes;
int m_numPendingSyncPoints;
QWaitCondition m_mailboxesFetchedWaitCond;
QMutex m_mutex;