diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-23 15:38:12 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-06-24 14:44:57 +0000 |
commit | a88fb838854daabe175440c010fcc99a094939c3 (patch) | |
tree | 5d48534d34701cf4e9acad3abe715caa246e4915 /src/quick/scenegraph/adaptations | |
parent | e7e34c727298f310698dfe476dda14461606a7e5 (diff) |
Fix rendering clipped texture and image nodes
The entire texture node was always used causing scaling for any node
with a source clip.
Change-Id: I7c6f946cee6d59ad3ae64302f3a28782eba8f5da
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph/adaptations')
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp index 53974a77bf..c8291edd10 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp @@ -73,10 +73,10 @@ void QSGSoftwareImageNode::paint(QPainter *painter) { if (QSGSoftwarePixmapTexture *pt = dynamic_cast<QSGSoftwarePixmapTexture *>(m_texture)) { const QPixmap &pm = pt->pixmap(); - painter->drawPixmap(m_rect, pm, QRectF(0, 0, pm.width(), pm.height())); + painter->drawPixmap(m_rect, pm, m_sourceRect); } else if (QSGPlainTexture *pt = dynamic_cast<QSGPlainTexture *>(m_texture)) { const QImage &im = pt->image(); - painter->drawImage(m_rect, im, QRectF(0, 0, im.width(), im.height())); + painter->drawImage(m_rect, im, m_sourceRect); } } diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp index 571f242b67..7cfbc2dfda 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp @@ -223,10 +223,10 @@ QRegion QSGSoftwareRenderableNode::renderNode(QPainter *painter, bool forceOpaqu QSGTexture *texture = m_handle.simpleTextureNode->texture(); if (QSGSoftwarePixmapTexture *pt = dynamic_cast<QSGSoftwarePixmapTexture *>(texture)) { const QPixmap &pm = pt->pixmap(); - painter->drawPixmap(m_handle.simpleTextureNode->rect(), pm, QRectF(0, 0, pm.width(), pm.height())); + painter->drawPixmap(m_handle.simpleTextureNode->rect(), pm, m_handle.simpleTextureNode->sourceRect()); } else if (QSGPlainTexture *pt = dynamic_cast<QSGPlainTexture *>(texture)) { const QImage &im = pt->image(); - painter->drawImage(m_handle.simpleTextureNode->rect(), im, QRectF(0, 0, im.width(), im.height())); + painter->drawImage(m_handle.simpleTextureNode->rect(), im, m_handle.simpleTextureNode->sourceRect()); } } break; |