[skif] Add applyColorFilter to FilterResult

Adds applyColorFilter() to FilterResult, which attempts to compose any
new color filter with a prior CF, as well as other effects like crops
and transforms.

This lifts the SkSpecialImage subsetting into utility function so it
can be used outside of just resolve(). It lifts the layer bounds crop
detection that had been in applyTransform() into a new isCropped()
function.

The various composition logics in applyTransform() and
applyCrop() have been updated to factor in the possibility of a color
filter (particularly one that affects transparent black).

FilterResultTest harness is updated to have applyColorFilter() as well
as updated desired-output calculations when an expected image could
technically be "infinite" and it's not usually doing back propagation
(which always restricts infinite bounds).

Adds many unit tests for color filters and how they interact with
transforms and crops. In many cases because of bounds propagation and
the tight contains checks, transparency-affecting color filters can
still avoid an intermediate image.

Other than these unit tests, nothing uses applyColorFilter() directly
although it will be used to simplify SkColorFilterImageFilter in the
next CL.

Bug: skia:9283
Change-Id: I91e3a51f2d67100c7748444c112bda7413400e4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/683199
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
3 files changed