Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Issue 1296943002: Implement canComputeFastBounds() for image filters. (Closed)

Created:
5 years, 4 months ago by Stephen White
Modified:
5 years, 4 months ago
Reviewers:
reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

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 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -8 lines) Patch
M gm/colorfilterimagefilter.cpp View 2 chunks +7 lines, -1 line 0 comments Download
M gm/imagefiltersscaled.cpp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkColorFilter.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M include/core/SkImageFilter.h View 1 2 3 4 3 chunks +12 lines, -0 lines 0 comments Download
M include/core/SkPaint.h View 3 chunks +2 lines, -7 lines 0 comments Download
M include/effects/SkColorFilterImageFilter.h View 1 chunk +1 line, -0 lines 0 comments Download
M include/effects/SkLightingImageFilter.h View 1 chunk +1 line, -0 lines 0 comments Download
M include/effects/SkRectShaderImageFilter.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/core/SkImageFilter.cpp View 1 chunk +17 lines, -0 lines 0 comments Download
M src/core/SkPaint.cpp View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
M src/effects/SkColorFilterImageFilter.cpp View 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M src/effects/SkRectShaderImageFilter.cpp View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M tests/ImageFilterTest.cpp View 1 2 6 7 2 chunks +53 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (12 generated)
Stephen White
reed@: PTAL. Thanks!
5 years, 4 months ago (2015-08-17 16:54:53 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1296943002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1296943002/20001
5 years, 4 months ago (2015-08-17 17:29:22 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-17 17:36:04 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1296943002/40002 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1296943002/40002
5 years, 4 months ago (2015-08-17 20:43:22 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-17 20:49:46 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1296943002/70001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1296943002/70001
5 years, 4 months ago (2015-08-18 15:37:43 UTC) #12
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-18 15:49:26 UTC) #14
Stephen White
reed@: Friendly ping. :)
5 years, 4 months ago (2015-08-19 20:42:03 UTC) #15
reed1
seems fine, but I wonder if we can avoid another virtual to add to various ...
5 years, 4 months ago (2015-08-19 21:19:24 UTC) #16
Stephen White
New patch up. https://codereview.chromium.org/1296943002/diff/70001/include/core/SkColorFilter.h File include/core/SkColorFilter.h (right): https://codereview.chromium.org/1296943002/diff/70001/include/core/SkColorFilter.h#newcode143 include/core/SkColorFilter.h:143: virtual bool affectsTransparentBlack() const { On ...
5 years, 4 months ago (2015-08-19 21:57:08 UTC) #17
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1296943002/110001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1296943002/110001
5 years, 4 months ago (2015-08-19 22:00:12 UTC) #19
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-19 22:06:57 UTC) #21
reed1
https://codereview.chromium.org/1296943002/diff/70001/src/core/SkColorFilter.cpp File src/core/SkColorFilter.cpp (right): https://codereview.chromium.org/1296943002/diff/70001/src/core/SkColorFilter.cpp#newcode78 src/core/SkColorFilter.cpp:78: virtual bool affectsTransparentBlack() const override { Hmm, I still ...
5 years, 4 months ago (2015-08-20 14:06:05 UTC) #22
Stephen White
https://codereview.chromium.org/1296943002/diff/70001/src/core/SkColorFilter.cpp File src/core/SkColorFilter.cpp (right): https://codereview.chromium.org/1296943002/diff/70001/src/core/SkColorFilter.cpp#newcode78 src/core/SkColorFilter.cpp:78: virtual bool affectsTransparentBlack() const override { On 2015/08/20 14:06:05, ...
5 years, 4 months ago (2015-08-20 14:23:32 UTC) #23
Stephen White
New patch up. PTAL.
5 years, 4 months ago (2015-08-20 14:31:03 UTC) #24
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1296943002/130001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1296943002/130001
5 years, 4 months ago (2015-08-20 14:31:18 UTC) #26
reed1
doh!, you're right about an older patch. lgtm
5 years, 4 months ago (2015-08-20 14:34:03 UTC) #27
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-20 14:37:40 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1296943002/130001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1296943002/130001
5 years, 4 months ago (2015-08-20 14:41:37 UTC) #31
commit-bot: I haz the power
Committed patchset #8 (id:130001) as https://skia.googlesource.com/skia/+/915881fe743f9a789037695f543bc6ea189cd0cb
5 years, 4 months ago (2015-08-20 14:42:14 UTC) #32
herb_g
5 years, 4 months ago (2015-08-20 16:28:31 UTC) #33
Message was sent while issue was closed.
A revert of this CL (patchset #8 id:130001) has been created in
https://codereview.chromium.org/1300403003/ by herb@google.com.

The reason for reverting is: This causes a syntax error.

http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp....

Powered by Google App Engine
This is Rietveld 408576698