aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@qt.io>2016-08-25 12:54:05 +0200
committerYoann Lopes <yoann.lopes@qt.io>2016-10-06 15:35:14 +0000
commita292697222dd85e586f26bd7133f3e17e30992c2 (patch)
tree8f630391a8f2702a544bf5c74e70ad08e9ec989d
parent97a78aece3250dd0d58cf243a16327694abc33ca (diff)
Fix FastFBOResizing hint for QQuickPaintedItem
The item updates the node in an order that would never actually take that flag into account. We now makes sure the FBO size is updated when the flag is set. Change-Id: I7aaaf64ed802ec0b53a3b47a39bbdea8195b4092 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
-rw-r--r--src/quick/scenegraph/util/qsgdefaultpainternode.cpp16
-rw-r--r--src/quick/scenegraph/util/qsgdefaultpainternode_p.h2
2 files changed, 15 insertions, 3 deletions
diff --git a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
index 7a92d61016..3f3eb4b88e 100644
--- a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
+++ b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
@@ -436,9 +436,21 @@ void QSGDefaultPainterNode::setContentsScale(qreal s)
markDirty(DirtyMaterial);
}
-void QSGDefaultPainterNode::setFastFBOResizing(bool dynamic)
+void QSGDefaultPainterNode::setFastFBOResizing(bool fastResizing)
{
- m_fastFBOResizing = dynamic;
+ if (m_fastFBOResizing == fastResizing)
+ return;
+
+ m_fastFBOResizing = fastResizing;
+ updateFBOSize();
+
+ if ((m_preferredRenderTarget == QQuickPaintedItem::FramebufferObject
+ || m_preferredRenderTarget == QQuickPaintedItem::InvertedYFramebufferObject)
+ && (!m_fbo || (m_fbo && m_fbo->size() != m_fboSize))) {
+ m_dirtyRenderTarget = true;
+ m_dirtyGeometry = true;
+ m_dirtyTexture = true;
+ }
}
QImage QSGDefaultPainterNode::toImage() const
diff --git a/src/quick/scenegraph/util/qsgdefaultpainternode_p.h b/src/quick/scenegraph/util/qsgdefaultpainternode_p.h
index 6b6f485915..b00c9df4c0 100644
--- a/src/quick/scenegraph/util/qsgdefaultpainternode_p.h
+++ b/src/quick/scenegraph/util/qsgdefaultpainternode_p.h
@@ -102,7 +102,7 @@ public:
void setContentsScale(qreal s);
qreal contentsScale() const { return m_contentsScale; }
- void setFastFBOResizing(bool dynamic);
+ void setFastFBOResizing(bool fastResizing);
bool fastFBOResizing() const { return m_fastFBOResizing; }
void setTextureSize(const QSize &textureSize);