Chinmay Garde ff0997d0b2 Directly use 4x4 matrices with surface textures instead of converting to and from the 3x3 variants. (flutter/engine#54126)
SurfaceTextureGetTransformMatrix returns a col-major 4x4 matrix. We used to convert it to a 3x3 matrix. Then when applying the transformation in the shader, I'd convert it back to a 4x4 matrix.

Instead of all this (potentially lossy) flip-flopping, store the matrix just as we get it in 4x4 form and perform the conversion just once if necessary. Today, it is necessary only in the Skia backend. SkM44 already has a converter to convert to and from a 3x3 SkMatrix. So, use that instead of rolling our own.

I spent a lot of time debugging these conversions and transformations because we had rolled our own and the printers seemed to dump in row-major order irrespective of storage order. This caused a lot of confusion.

No change in functionality. Hopefully, the next person debugging transformations has an easier go at this.
2024-07-26 02:20:04 +00:00
..