aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects/SkColorFilterImageFilter.h
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2015-08-20 07:42:11 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-20 07:42:11 -0700
commit915881fe743f9a789037695f543bc6ea189cd0cb (patch)
tree9236b8acd8ef7ca0f7ee33bded19532c1b7833fc /include/effects/SkColorFilterImageFilter.h
parenta7f4c435bc1dcd845990a5515828bbe8cccfab41 (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/SkColorFilterImageFilter.h')
-rw-r--r--include/effects/SkColorFilterImageFilter.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/effects/SkColorFilterImageFilter.h b/include/effects/SkColorFilterImageFilter.h
index 0076a87c20..f23f16dfd1 100644
--- a/include/effects/SkColorFilterImageFilter.h
+++ b/include/effects/SkColorFilterImageFilter.h
@@ -29,6 +29,7 @@ protected:
SkBitmap* result, SkIPoint* loc) const override;
bool onIsColorFilterNode(SkColorFilter**) const override;
+ bool affectsTransparentBlack() const override;
private:
SkColorFilterImageFilter(SkColorFilter* cf,