summaryrefslogtreecommitdiffstats
path: root/src/core/delegated_frame_node.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-05-08 14:44:17 +0200
committerJani Heikkinen <jani.heikkinen@qt.io>2017-05-10 04:16:52 +0000
commit637beda0062ff65918823147830b52e29ae550a6 (patch)
treeb7d2ef4aa1c05dc4ba7ba4c0032544090ace638b /src/core/delegated_frame_node.cpp
parent757d5b1cea0d3d70b97b31f331df9ada82f45d2d (diff)
Fix backwards compatibility
QtWebEngine supports building with last stable and last LTS Qt releases. Guard some 5.7-5.9 API from being used when not available, and reinstate the default features for 5.6 LTS builds. Change-Id: Ia288a49109d011a2bee883d4a2d38d994b497d59 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/delegated_frame_node.cpp')
-rw-r--r--src/core/delegated_frame_node.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp
index a4b2a4036..e49bc553f 100644
--- a/src/core/delegated_frame_node.cpp
+++ b/src/core/delegated_frame_node.cpp
@@ -209,6 +209,7 @@ protected:
QVector<QSGNode*> *m_sceneGraphNodes;
};
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
class DelegatedNodeTreeUpdater : public DelegatedNodeTreeHandler
{
public:
@@ -303,6 +304,7 @@ public:
private:
QVector<QSGNode*>::iterator m_nodeIterator;
};
+#endif
class DelegatedNodeTreeCreator : public DelegatedNodeTreeHandler
{
@@ -872,8 +874,13 @@ void DelegatedFrameNode::commit(ChromiumCompositorData *chromiumCompositorData,
// We first compare if the render passes from the previous frame data are structurally
// equivalent to the render passes in the current frame data. If they are, we are going
// to reuse the old nodes. Otherwise, we will delete the old nodes and build a new tree.
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
cc::DelegatedFrameData *previousFrameData = m_chromiumCompositorData->previousFrameData.get();
const bool buildNewTree = !areRenderPassStructuresEqual(frameData, previousFrameData) || m_sceneGraphNodes.empty();
+#else
+ // No updates possible with old scenegraph nodes
+ const bool buildNewTree = true;
+#endif
m_chromiumCompositorData->previousFrameData = nullptr;
SGObjects previousSGObjects;
@@ -887,11 +894,13 @@ void DelegatedFrameNode::commit(ChromiumCompositorData *chromiumCompositorData,
delete oldChain;
m_sceneGraphNodes.clear();
nodeHandler.reset(new DelegatedNodeTreeCreator(&m_sceneGraphNodes, apiDelegate));
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
} else {
// Save the texture strong refs so they only go out of scope when the method returns and
// the new vector of texture strong refs has been filled.
qSwap(m_sgObjects.textureStrongRefs, textureStrongRefs);
nodeHandler.reset(new DelegatedNodeTreeUpdater(&m_sceneGraphNodes));
+#endif
}
// The RenderPasses list is actually a tree where a parent RenderPass is connected
// to its dependencies through a RenderPassId reference in one or more RenderPassQuads.