SkPictureImageFilter - clear local canvas before use

In SkPictureImageFilter::onFilterImage, we may create two new surfaces,
one for our final output, and one for a local resolution intermediate.

We clear the final output surface before use, removing any previous
content, however we do not do the same for the local surface. This can
lead to content being incorrectly layered on top of previous content
when we go down this path.

This change adds logic to clear the local surface as well.

BUG=610667
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1969193002

Review-Url: https://codereview.chromium.org/1969193002
This commit is contained in:
ericrk 2016-05-12 09:06:44 -07:00 committed by Commit bot
parent 97fc9308e3
commit a31312cddd

View File

@ -177,6 +177,8 @@ void SkPictureImageFilter::drawPictureAtLocalResolution(SkSpecialImage* source,
SkCanvas* localCanvas = localSurface->getCanvas();
SkASSERT(localCanvas);
localCanvas->clear(0x0);
localCanvas->translate(-SkIntToScalar(localIBounds.fLeft),
-SkIntToScalar(localIBounds.fTop));