Detect when perspective is really affine, and update the matrix as we handoff
the ctm to the device.

This catches cases where the matrix bottom-row might look like
   [ 0, 0, not_one ]

That would get categorized as perspective, but in reality that matrix
behaves like affine. If we can detect that pattern, and scale the entire
matrix by 1/not_one, we don't change its behavior, but it will now be
categorized as affine (seen as simpler/faster).

bug: skia:9698
Change-Id: Ib77b647c1d32f73538b1c0d8e9e49ec533610b3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260776
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
5 files changed