SkXPS: handle case where snapSpecial() returns null

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3415

Change-Id: I91bfbeb5751d5fd87e0361255ccb0350c3f3c850
Reviewed-on: https://skia-review.googlesource.com/3415
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This commit is contained in:
Hal Canary 2016-10-14 11:19:43 -04:00 committed by Skia Commit-Bot
parent aeb7959fd2
commit 43513543de

View File

@ -1415,8 +1415,9 @@ void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y, const SkPa
paint = &looper.paint();
SkImageFilter* filter = paint->getImageFilter();
SkIPoint pos = { x - iter.getX(), y - iter.getY() };
if (filter) {
dstDev->drawSpecial(iter, srcDev->snapSpecial().get(), pos.x(), pos.y(), *paint);
sk_sp<SkSpecialImage> specialImage;
if (filter && (specialImage = srcDev->snapSpecial())) {
dstDev->drawSpecial(iter, specialImage.get(), pos.x(), pos.y(), *paint);
} else {
dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint);
}