TransformationMatrix::rotate(angle) currently just calls TransformationMatrix::rotate3d(0, 0, 1, angle), which has a fast path for the case where we're rotating about the z-axis. However, we should be able to make this *slightly* faster by omitting the hypotenuse computation, several floating point comparisons, and several assignments.
Created attachment 407580 [details] For EWS
Comment on attachment 407580 [details] For EWS View in context: https://bugs.webkit.org/attachment.cgi?id=407580&action=review > Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:905 > + multiply({ cosZ, sinZ, -sinZ, cosZ, 0, 0 }); I assume something extends this with the 1s in the diagonals to preserve the other columns?
Comment on attachment 407580 [details] For EWS View in context: https://bugs.webkit.org/attachment.cgi?id=407580&action=review >> Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:905 >> + multiply({ cosZ, sinZ, -sinZ, cosZ, 0, 0 }); > > I assume something extends this with the 1s in the diagonals to preserve the other columns? Indeed — this uses the a, b, c, d, e, f constructor for TransformationMatrix, which ensures that the last two values along the diagonal are 1: constexpr TransformationMatrix(double a, double b, double c, double d, double e, double f) : m_matrix { { a, b, 0, 0 }, { c, d, 0, 0 }, { 0, 0, 1, 0 }, { e, f, 0, 1 }, } { }
Committed r266353: <https://trac.webkit.org/changeset/266353> All reviewed patches have been landed. Closing bug and clearing flags on attachment 407580 [details].
<rdar://problem/68076663>