aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-06-13 15:10:14 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-06-13 15:20:01 +0200
commit2e25ec139d6b2394650b165e71eba246423fb492 (patch)
tree207cabe202695814e53ede86a2bb98bff713cdb1 /src/quick
parent1eb3a6febec8fa8bb616a3765c1a899210135f31 (diff)
Fix graphical artifacts after changing only texture
If the size of the texture changes, but subrect stays the same, the geometry changed and is now dirty. Change-Id: I5a4de88fd3f788a686fb2186185da2a0a3faad82 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/scenegraph/util/qsgdefaultimagenode.cpp4
-rw-r--r--src/quick/scenegraph/util/qsgdefaultimagenode_p.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/scenegraph/util/qsgdefaultimagenode.cpp b/src/quick/scenegraph/util/qsgdefaultimagenode.cpp
index 7186ee4265..48ec8f01d3 100644
--- a/src/quick/scenegraph/util/qsgdefaultimagenode.cpp
+++ b/src/quick/scenegraph/util/qsgdefaultimagenode.cpp
@@ -156,6 +156,10 @@ void QSGDefaultImageNode::setTexture(QSGTexture *texture)
m_isAtlasTexture = texture->isAtlasTexture();
if (wasAtlas || m_isAtlasTexture)
dirty |= DirtyGeometry;
+ // The geometry has also changed if the texture size changed.
+ if (m_textureSize != texture->textureSize())
+ dirty |= DirtyGeometry;
+ m_textureSize = texture->textureSize();
markDirty(dirty);
}
diff --git a/src/quick/scenegraph/util/qsgdefaultimagenode_p.h b/src/quick/scenegraph/util/qsgdefaultimagenode_p.h
index cb23e759d3..7b26daf541 100644
--- a/src/quick/scenegraph/util/qsgdefaultimagenode_p.h
+++ b/src/quick/scenegraph/util/qsgdefaultimagenode_p.h
@@ -95,6 +95,7 @@ private:
QSGTextureMaterial m_material;
QRectF m_rect;
QRectF m_sourceRect;
+ QSize m_textureSize;
TextureCoordinatesTransformMode m_texCoordMode;
uint m_isAtlasTexture : 1;
uint m_ownsTexture : 1;