opengl: Correct order of transforms in GLTexturePrivate::updateMatrix
The textureToTransformMatrix should be applied first, otherwise the scale transform is going to change the winding order of rotations. In practice though, it shouldn't matter because these matrices are used to downscale or upscale uv coordinates.
This commit is contained in:
parent
428758d33a
commit
cffacc514d
1 changed files with 2 additions and 2 deletions
|
@ -500,14 +500,14 @@ void GLTexturePrivate::updateMatrix()
|
|||
}
|
||||
|
||||
m_matrix[NormalizedCoordinates].translate(0.5, 0.5);
|
||||
m_matrix[NormalizedCoordinates] *= textureToBufferMatrix;
|
||||
// our Y axis is flipped vs OpenGL
|
||||
m_matrix[NormalizedCoordinates].scale(1, -1);
|
||||
m_matrix[NormalizedCoordinates] *= textureToBufferMatrix;
|
||||
m_matrix[NormalizedCoordinates].translate(-0.5, -0.5);
|
||||
|
||||
m_matrix[UnnormalizedCoordinates].translate(m_size.width() / 2, m_size.height() / 2);
|
||||
m_matrix[UnnormalizedCoordinates] *= textureToBufferMatrix;
|
||||
m_matrix[UnnormalizedCoordinates].scale(1, -1);
|
||||
m_matrix[UnnormalizedCoordinates] *= textureToBufferMatrix;
|
||||
m_matrix[UnnormalizedCoordinates].translate(-m_size.width() / 2, -m_size.height() / 2);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue