SkPDF: eliminate unnecessary clip for each page

Somehow this improves the imagefilterscropped gm.

This also makes it easier for me to manually parse
PDF output for debugging.

Change-Id: I3af39f4b0ca3fc7fcdeec4825bf8649bd9544917
Reviewed-on: https://skia-review.googlesource.com/17413
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This commit is contained in:
Hal Canary 2017-05-19 17:03:49 -04:00 committed by Skia Commit-Bot
parent 75c7d77a0c
commit 66f6b1fb48

View File

@ -218,8 +218,10 @@ SkCanvas* SkPDFDocument::onBeginPage(SkScalar width, SkScalar height,
fPageDevice.reset(
SkPDFDevice::Create(pageSize, fRasterDpi, this));
fCanvas.reset(new SkPDFCanvas(fPageDevice));
fCanvas->clipRect(trimBox);
fCanvas->translate(trimBox.x(), trimBox.y());
if (SkRect::MakeWH(width, height) != trimBox) {
fCanvas->clipRect(trimBox);
fCanvas->translate(trimBox.x(), trimBox.y());
}
return fCanvas.get();
}