From c1d726fe19c83cf081042e55ace9d9d7b31c40e6 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Thu, 25 Aug 2016 12:31:20 +0200 Subject: Correctly update the geometry of QSGDefaultPainterNode When using a FBO, the source rect should be the painted part (m_textureSize) of the FBO. Also, the texture size is now correctly set when using an Image render target. Task-number: QTBUG-52054 Change-Id: If5d7a9c0b02f16f5d4be2cdf8c3c4cb15cb0583e Reviewed-by: Andy Shaw Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quick/scenegraph/util/qsgdefaultpainternode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp index e3103341cd..7a92d61016 100644 --- a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp +++ b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp @@ -218,7 +218,7 @@ void QSGDefaultPainterNode::updateGeometry() if (m_actualRenderTarget == QQuickPaintedItem::Image) source = QRectF(0, 0, 1, 1); else - source = QRectF(0, 0, qreal(m_size.width()) / m_fboSize.width(), qreal(m_size.height()) / m_fboSize.height()); + source = QRectF(0, 0, qreal(m_textureSize.width()) / m_fboSize.width(), qreal(m_textureSize.height()) / m_fboSize.height()); QRectF dest(0, 0, m_size.width(), m_size.height()); if (m_actualRenderTarget == QQuickPaintedItem::InvertedYFramebufferObject) dest = QRectF(QPointF(0, m_size.height()), QPointF(m_size.width(), 0)); @@ -300,7 +300,7 @@ void QSGDefaultPainterNode::updateRenderTarget() QSGPainterTexture *texture = new QSGPainterTexture; if (m_actualRenderTarget == QQuickPaintedItem::Image) { texture->setOwnsTexture(true); - texture->setTextureSize(m_size); + texture->setTextureSize(m_textureSize); } else { texture->setTextureId(m_fbo->texture()); texture->setOwnsTexture(false); -- cgit v1.2.3