Rename onCreateDevice -> onCreateCompatibleDevice
This is a port of https://codereview.chromium.org/723743002/ with the
following changes:
* drop the legacy onCreateDevice variant completely
* also convert SkXPSDevice & SkGatherPixelRefsAndRects to the new API
This is expected to break canaries and will require a manual/cowboy
roll.
TBR=reed@google.com
NOTREECHECKS=true
Review URL: https://codereview.chromium.org/720213002
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index b14ca72..fb8df83 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -567,19 +567,19 @@
}
}
-SkBaseDevice* SkPDFDevice::onCreateDevice(const SkImageInfo& info, Usage usage) {
+SkBaseDevice* SkPDFDevice::onCreateCompatibleDevice(const CreateInfo& cinfo) {
// PDF does not support image filters, so render them on CPU.
// Note that this rendering is done at "screen" resolution (100dpi), not
// printer resolution.
// FIXME: It may be possible to express some filters natively using PDF
// to improve quality and file size (http://skbug.com/3043)
- if (kImageFilter_Usage == usage) {
- return SkBitmapDevice::Create(info);
+ if (kImageFilter_Usage == cinfo.fUsage) {
+ return SkBitmapDevice::Create(cinfo.fInfo);
}
SkMatrix initialTransform;
initialTransform.reset();
- SkISize size = SkISize::Make(info.width(), info.height());
+ SkISize size = SkISize::Make(cinfo.fInfo.width(), cinfo.fInfo.height());
return SkNEW_ARGS(SkPDFDevice, (size, size, initialTransform));
}
@@ -1231,7 +1231,7 @@
void SkPDFDevice::drawDevice(const SkDraw& d, SkBaseDevice* device,
int x, int y, const SkPaint& paint) {
- // our onCreateDevice() always creates SkPDFDevice subclasses.
+ // our onCreateCompatibleDevice() always creates SkPDFDevice subclasses.
SkPDFDevice* pdfDevice = static_cast<SkPDFDevice*>(device);
if (pdfDevice->isContentEmpty()) {
return;