DescriptionImplement canComputeFastBounds() for image filters.
Image filters have never implemented this check, which means that
filters which affect transparent black falsely claim they can compute
their bounds.
Implemented an affectsTransparentBlack() virtual for image
filters, and a similar helper function for color filters.
This will affect the following GMs: imagefiltersscaled
(lighting, perlin noise now filter to clip),
colorfilterimagefilter (new test case), imagefiltersclipped
(perlin noise now filters to clip).
Note: I de-inlined SkPaint::canComputeFastBounds() to avoid adding
a dependency from SkPaint.h to SkImageFilter.h.h. Skia benches show
no impact from this change, but will watch the perf bots carefully.
BUG=4212
Committed: https://skia.googlesource.com/skia/+/915881fe743f9a789037695f543bc6ea189cd0cb
Patch Set 1 #Patch Set 2 : Add a unit test #Patch Set 3 : Add some more unit tests. #Patch Set 4 : SkRectShaderImageFilter also affects transparent black; adjust GM to test #Patch Set 5 : Move affectsTransparentBlack() check up to SkImageFilter::asAColorFilter(). #
Total comments: 4
Patch Set 6 : Remove SkColorFilter::affectsTransparentBlack() #Patch Set 7 : Restore looper logic in SkPaint::canComputeFastBounds() #Patch Set 8 : Put SkColorFilter::affectsTransparentBlack() back as a non-virtual helper. #
Messages
Total messages: 33 (12 generated)
|