aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp')
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp
index ba9952e19d..09eae137bb 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode.cpp
@@ -375,21 +375,7 @@ void QSGSoftwareInternalImageNode::setVerticalWrapMode(QSGTexture::WrapMode wrap
void QSGSoftwareInternalImageNode::update()
{
- if (m_cachedMirroredPixmapIsDirty) {
- if (m_mirrorHorizontally || m_mirrorVertically || m_textureIsLayer) {
- QTransform transform(
- (m_mirrorHorizontally ? -1 : 1), 0,
- 0 , (m_textureIsLayer ? -1 : 1) * (m_mirrorVertically ? -1 : 1),
- 0 , 0
- );
- m_cachedMirroredPixmap = pixmap().transformed(transform);
- } else {
- //Cleanup cached pixmap if necessary
- if (!m_cachedMirroredPixmap.isNull())
- m_cachedMirroredPixmap = QPixmap();
- }
- m_cachedMirroredPixmapIsDirty = false;
- }
+ updateCachedMirroredPixmap();
}
void QSGSoftwareInternalImageNode::preprocess()
@@ -423,6 +409,7 @@ void QSGSoftwareInternalImageNode::paint(QPainter *painter)
// Disable antialiased clipping. It causes transformed tiles to have gaps.
painter->setRenderHint(QPainter::Antialiasing, false);
+ updateCachedMirroredPixmap();
const QPixmap &pm = m_mirrorHorizontally || m_mirrorVertically || m_textureIsLayer ? m_cachedMirroredPixmap : pixmap();
if (m_innerTargetRect != m_targetRect) {
@@ -468,4 +455,23 @@ const QPixmap &QSGSoftwareInternalImageNode::pixmap() const
return nullPixmap;
}
+void QSGSoftwareInternalImageNode::updateCachedMirroredPixmap()
+{
+ if (m_cachedMirroredPixmapIsDirty) {
+ if (m_mirrorHorizontally || m_mirrorVertically || m_textureIsLayer) {
+ QTransform transform(
+ (m_mirrorHorizontally ? -1 : 1), 0,
+ 0 , (m_textureIsLayer ? -1 : 1) * (m_mirrorVertically ? -1 : 1),
+ 0 , 0
+ );
+ m_cachedMirroredPixmap = pixmap().transformed(transform);
+ } else {
+ //Cleanup cached pixmap if necessary
+ if (!m_cachedMirroredPixmap.isNull())
+ m_cachedMirroredPixmap = QPixmap();
+ }
+ m_cachedMirroredPixmapIsDirty = false;
+ }
+}
+
QT_END_NAMESPACE