summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2025-11-20 15:41:51 +0100
committerMarc Mutz <marc.mutz@qt.io>2025-12-08 13:50:18 +0000
commita7bf6eb368286f183cbab0d67640c51f9a38a235 (patch)
tree1b18ba092992d72eb531f0c83b3314297420ab76 /src
parent9418c280d3eab4479aedd3adb92473e0458d884c (diff)
QMatrix4x4: restore NRVO in op*(M,M) 1/5: remove compound assignments
Replace them with the equivalent non-compound assignment, so we can, in a follow-up patch, replace the references to `m` on the RHS of the expressions with references to `m1`. This is the first step for porting the 2D case, like the 3D case, to Qt::Uninitialized, which, in turn is a prerequisite for re-enabling NRVO. Amends 13b3545e833f6175f686c9776e1510db3f3f11eb. Pick-to: 6.11 6.10 6.8 Change-Id: I8f32e413912f42f11aac4dcee4738d1b387c94d4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/math3d/qmatrix4x4.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h
index 2ba274d4517..ecbbb199cc9 100644
--- a/src/gui/math3d/qmatrix4x4.h
+++ b/src/gui/math3d/qmatrix4x4.h
@@ -611,13 +611,13 @@ inline QMatrix4x4 operator*(const QMatrix4x4& m1, const QMatrix4x4& m2)
QMatrix4x4::Flags flagBits = m1.flagBits | m2.flagBits;
if (flagBits.toInt() < QMatrix4x4::Rotation2D) {
QMatrix4x4 m = m1;
- m.m[3][0] += m.m[0][0] * m2.m[3][0];
- m.m[3][1] += m.m[1][1] * m2.m[3][1];
- m.m[3][2] += m.m[2][2] * m2.m[3][2];
+ m.m[3][0] = m.m[3][0] + m.m[0][0] * m2.m[3][0];
+ m.m[3][1] = m.m[3][1] + m.m[1][1] * m2.m[3][1];
+ m.m[3][2] = m.m[3][2] + m.m[2][2] * m2.m[3][2];
- m.m[0][0] *= m2.m[0][0];
- m.m[1][1] *= m2.m[1][1];
- m.m[2][2] *= m2.m[2][2];
+ m.m[0][0] = m.m[0][0] * m2.m[0][0];
+ m.m[1][1] = m.m[1][1] * m2.m[1][1];
+ m.m[2][2] = m.m[2][2] * m2.m[2][2];
m.flagBits = flagBits;
return m;
}