From a292697222dd85e586f26bd7133f3e17e30992c2 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Thu, 25 Aug 2016 12:54:05 +0200 Subject: 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 --- src/quick/scenegraph/util/qsgdefaultpainternode.cpp | 16 ++++++++++++++-- src/quick/scenegraph/util/qsgdefaultpainternode_p.h | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src/quick/scenegraph/util') 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); -- cgit v1.2.3