diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-09-03 13:26:17 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-05 06:06:45 +0000 |
commit | fbc4b7adba4c5b2ff0cb16cff2993e18add5a9e2 (patch) | |
tree | 9b2e5568c4b485e141a0e30e7f54a61770d24f29 | |
parent | 421ef81980217ff7533f3796ac7092b7156dbfe5 (diff) |
Update the QRhiTexture size in QSGPlainTexture
An autotest is added separately for dev only because the necessary
infrastructure for sophisticated scenegraph tests only exists there
due to some earlier commits that are in dev and not in 6.2.
Fixes: QTBUG-96190
Change-Id: Ie2adee96864b60f982a83b9b2785a93d5401bd6a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 4de27382f9b5f05b8d5821247ea7653b44264c03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quick/scenegraph/util/qsgplaintexture.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quick/scenegraph/util/qsgplaintexture.cpp b/src/quick/scenegraph/util/qsgplaintexture.cpp index 6e59f9e607..ad6bfd450d 100644 --- a/src/quick/scenegraph/util/qsgplaintexture.cpp +++ b/src/quick/scenegraph/util/qsgplaintexture.cpp @@ -231,7 +231,12 @@ void QSGPlainTexture::commitTextureOperations(QRhi *rhi, QRhiResourceUpdateBatch } } - bool needsRebuild = m_texture && m_texture->pixelSize() != m_texture_size; + bool needsRebuild = false; + + if (m_texture && m_texture->pixelSize() != m_texture_size) { + m_texture->setPixelSize(m_texture_size); + needsRebuild = true; + } if (mipmappingChanged) { QRhiTexture::Flags f = m_texture->flags(); |