diff options
author | senorblanco <senorblanco@chromium.org> | 2015-08-20 07:42:11 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-20 07:42:11 -0700 |
commit | 915881fe743f9a789037695f543bc6ea189cd0cb (patch) | |
tree | 9236b8acd8ef7ca0f7ee33bded19532c1b7833fc /include/effects/SkLightingImageFilter.h | |
parent | a7f4c435bc1dcd845990a5515828bbe8cccfab41 (diff) |
Implement 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
Review URL: https://codereview.chromium.org/1296943002
Diffstat (limited to 'include/effects/SkLightingImageFilter.h')
-rw-r--r-- | include/effects/SkLightingImageFilter.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/effects/SkLightingImageFilter.h b/include/effects/SkLightingImageFilter.h index d0b489d6a8..fb356c52e4 100644 --- a/include/effects/SkLightingImageFilter.h +++ b/include/effects/SkLightingImageFilter.h @@ -49,6 +49,7 @@ protected: void flatten(SkWriteBuffer&) const override; const SkImageFilterLight* light() const { return fLight.get(); } SkScalar surfaceScale() const { return fSurfaceScale; } + bool affectsTransparentBlack() const override { return true; } private: typedef SkImageFilter INHERITED; |