Is the implementation of the non-apple CGAffineTransform correct?
Several things seem "off". For one, the implementation of inverted() simply negates the matrix's components. On other implementations, however, such as the Foundation and SwiftWin32 ones, it's much more complex — calculating a determinant, examining if inversion is possible, etc. Furthermore, rotated(by:) — despite claiming to rotate an existing transformation — ignores the translation components of the matrix (tx and ty) and existing scaling and rotation adjustments.
Perhaps, the current return value of rotated(by:) was intended to be appended to self before being returned.
If this is indeed incorrect, I'd be happy to submit a PR to fix it and add a test coverage — although tests in Tokamak seem to cover higher-level rendering behavior.