aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/imagefiltersscaled.cpp
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2015-08-20 11:10:41 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-20 11:10:41 -0700
commit0abdf766d395ed3b7059511425f431589eca05f6 (patch)
tree126ea7aaedced4f4aa7b22d72567d32217e8ccbd /gm/imagefiltersscaled.cpp
parent02833bf0553787484dcb8b602c8ce329ee97d9c3 (diff)
Reland of Implement canComputeFastBounds() for image filters. (patchset #1 id:1 of https://codereview.chromium.org/1300403003/ )
Reason for revert: The Mac compile issue was fixed here: https://chromium.googlesource.com/chromium/src/+/fdd331a42ae0b9a6909a121020735161ab61c6e5 Original issue's description: > Revert of Implement canComputeFastBounds() for image filters. (patchset #8 id:130001 of https://codereview.chromium.org/1296943002/ ) > > Reason for revert: > This causes a syntax error. > > http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/87819/steps/compile%20%28with%20patch%29/logs/stdio > > Original issue's 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 > > TBR=reed@google.com,senorblanco@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=4212 > > Committed: https://skia.googlesource.com/skia/+/12d8472d31ea5edb636d7d5214db253570115c40 TBR=reed@google.com,herb@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=4212 Review URL: https://codereview.chromium.org/1301823005
Diffstat (limited to 'gm/imagefiltersscaled.cpp')
-rw-r--r--gm/imagefiltersscaled.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/gm/imagefiltersscaled.cpp b/gm/imagefiltersscaled.cpp
index e7a68d747d..2e4756a9b3 100644
--- a/gm/imagefiltersscaled.cpp
+++ b/gm/imagefiltersscaled.cpp
@@ -131,6 +131,7 @@ protected:
paint.setAntiAlias(true);
canvas->save();
canvas->scale(scales[j].fX, scales[j].fY);
+ canvas->clipRect(r);
if (5 == i) {
canvas->translate(SkIntToScalar(-32), 0);
} else if (6 == i) {