Refactor complex CTM management for image filters

This consolidates the scale decomposition and SkMatrixImageFilter logic
that SkCanvas did during a layer save into an applyCTM function. It is
expanded to handle the extra transformation steps for backdrops.

The backdrop logic in SkCanvas has also been updated to only snap the
necessary portion of the buffer, and also use applyCTM. Previously any
backdrop filter with a CTM beyond scale/translate would do no filtering.

Unfortunately, perspective has caused too many headaches to solve in a
single CL, so its issues are recorded at skbug.com/9074.

Other minor fixes that were encountered while working on this:
- Raster's CopyFromRaster() incorrectly held onto the subset after copying.
  (unfortunately it looks like snapBackImage() needs to copy; referencing
   the subset directly corrupted the output).
- SkLocalMatrixImageFilter now supports complex CTMs assuming its input
  supports CTMs.
- CropRects need to apply in the source coordinate system, but are not
  aware of complex CTMs when performing clipping. For a simple fix, any
  filter with a crop rect set cannot support complex CTMs until that's
  updated.

Bug: skia:9074, chromium:959412
Change-Id: I1276a4ec400dfefb958c14beda078bdf1d087baa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213080
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
8 files changed