diff options
author | robertphillips <robertphillips@google.com> | 2016-05-12 10:46:39 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-12 10:46:40 -0700 |
commit | 3806b8fb7ffe757cf42f13024dbaf9f24856ccd3 (patch) | |
tree | c87790bb4bfab27b0ea9c2134e730dd2b4610d24 | |
parent | be463bba2ea4c33bac9267102d8865ac2ca6a391 (diff) |
Fix bug & add code to catch ImageFilter clearing bugs
Follow on to https://codereview.chromium.org/1969193002/ (SkPictureImageFilter - clear local canvas before use)
BUG=610667
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1972213002
Review-Url: https://codereview.chromium.org/1972213002
-rw-r--r-- | gm/pictureimagefilter.cpp | 1 | ||||
-rw-r--r-- | src/core/SkSpecialSurface.cpp | 6 | ||||
-rw-r--r-- | src/effects/SkXfermodeImageFilter.cpp | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/gm/pictureimagefilter.cpp b/gm/pictureimagefilter.cpp index 30586b3dbe..244ed87afd 100644 --- a/gm/pictureimagefilter.cpp +++ b/gm/pictureimagefilter.cpp @@ -26,7 +26,6 @@ static void fill_rect_filtered(SkCanvas* canvas, static sk_sp<SkPicture> make_picture() { SkPictureRecorder recorder; SkCanvas* canvas = recorder.beginRecording(100, 100, nullptr, 0); - canvas->clear(SK_ColorBLACK); SkPaint paint; paint.setAntiAlias(true); sk_tool_utils::set_portable_typeface(&paint); diff --git a/src/core/SkSpecialSurface.cpp b/src/core/SkSpecialSurface.cpp index 335e206a6a..dee9811f95 100644 --- a/src/core/SkSpecialSurface.cpp +++ b/src/core/SkSpecialSurface.cpp @@ -74,6 +74,9 @@ public: fCanvas.reset(new SkCanvas(fBitmap, this->props())); fCanvas->clipRect(SkRect::Make(subset)); +#ifdef SK_IS_BOT + fCanvas->clear(SK_ColorRED); // catch any imageFilter sloppiness +#endif } ~SkSpecialSurface_Raster() override { } @@ -130,6 +133,9 @@ public: fCanvas.reset(new SkCanvas(device.get())); fCanvas->clipRect(SkRect::Make(subset)); +#ifdef SK_IS_BOT + fCanvas->clear(SK_ColorRED); // catch any imageFilter sloppiness +#endif } ~SkSpecialSurface_Gpu() override { } diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp index 99ce24f129..d4756e8e78 100644 --- a/src/effects/SkXfermodeImageFilter.cpp +++ b/src/effects/SkXfermodeImageFilter.cpp @@ -104,6 +104,8 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::onFilterImage(SkSpecialImage* sourc SkCanvas* canvas = surf->getCanvas(); SkASSERT(canvas); + canvas->clear(0x0); // can't count on background to fully clear the background + canvas->translate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top())); SkPaint paint; |