summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-03-22 13:34:10 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-03-22 14:45:35 +0000
commit364a6c091bcc12c5e08f0616d6fc29b5650e964c (patch)
tree8251e86adfbc02542d69f29e47bfac1697778fc0 /src/core
parent17eefd8f92adb71da25b8c9d67b3e973684a8bf9 (diff)
Do not reuse render passes when we have dynamic 3D layers
They can be clipped and culled based on visibility which is a property we do want to support changing. Task-number: QTBUG-67232 Change-Id: I6b670fd84d1e5c18283ea8f4ee1d8e81b94dcd57 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/delegated_frame_node.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp
index 2ce1616af..83a39ba22 100644
--- a/src/core/delegated_frame_node.cpp
+++ b/src/core/delegated_frame_node.cpp
@@ -219,6 +219,7 @@ public:
void setupRenderPassNode(QSGTexture *layer, const QRect &rect, QSGNode *) override
{
Q_ASSERT(layer);
+ Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
QSGInternalImageNode *imageNode = static_cast<QSGInternalImageNode*>(*m_nodeIterator++);
imageNode->setTargetRect(rect);
imageNode->setInnerTargetRect(rect);
@@ -231,6 +232,7 @@ public:
QSGTextureNode::TextureCoordinatesTransformMode texCoordTransForm,
QSGNode *) override
{
+ Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
QSGTextureNode *textureNode = static_cast<QSGTextureNode*>(*m_nodeIterator++);
if (textureNode->texture() != texture) {
textureNode->setTexture(texture);
@@ -249,6 +251,7 @@ public:
void setupTiledContentNode(QSGTexture *texture, const QRect &rect, const QRectF &sourceRect,
QSGTexture::Filtering filtering, QSGNode *) override
{
+ Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
QSGTextureNode *textureNode = static_cast<QSGTextureNode*>(*m_nodeIterator++);
if (textureNode->texture() != texture) {
textureNode->setTexture(texture);
@@ -264,6 +267,7 @@ public:
}
void setupSolidColorNode(const QRect &rect, const QColor &color, QSGNode *) override
{
+ Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
QSGRectangleNode *rectangleNode = static_cast<QSGRectangleNode*>(*m_nodeIterator++);
if (rectangleNode->rect() != rect)
@@ -275,6 +279,7 @@ public:
void setupDebugBorderNode(QSGGeometry *geometry, QSGFlatColorMaterial *material,
QSGNode *) override
{
+ Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
QSGGeometryNode *geometryNode = static_cast<QSGGeometryNode*>(*m_nodeIterator++);
geometryNode->setGeometry(geometry);
@@ -754,6 +759,8 @@ void DelegatedFrameNode::preprocess()
static bool areSharedQuadStatesEqual(const viz::SharedQuadState *layerState,
const viz::SharedQuadState *prevLayerState)
{
+ if (layerState->sorting_context_id != 0 || prevLayerState->sorting_context_id != 0)
+ return false;
if (layerState->is_clipped != prevLayerState->is_clipped
|| layerState->clip_rect != prevLayerState->clip_rect)
return false;
@@ -791,8 +798,6 @@ static bool areRenderPassStructuresEqual(viz::CompositorFrame *frameData,
for (; it != end && prevIt != prevEnd; ++it, ++prevIt) {
const viz::DrawQuad *quad = *it;
const viz::DrawQuad *prevQuad = *prevIt;
- if (!areSharedQuadStatesEqual(quad->shared_quad_state, prevQuad->shared_quad_state))
- return false;
if (quad->material != prevQuad->material)
return false;
#ifndef QT_NO_OPENGL
@@ -803,7 +808,8 @@ static bool areRenderPassStructuresEqual(viz::CompositorFrame *frameData,
return false;
#endif // GL_OES_EGL_image_external
#endif // QT_NO_OPENGL
-
+ if (!areSharedQuadStatesEqual(quad->shared_quad_state, prevQuad->shared_quad_state))
+ return false;
}
}
return true;