Index: printing/pdf_metafile_skia.cc |
diff --git a/printing/pdf_metafile_skia.cc b/printing/pdf_metafile_skia.cc |
index 72d89082c750822c220a2c9f8f8b2df45ba335f6..98d685ce1052ca80c0433f58f430af1ce3b33d46 100644 |
--- a/printing/pdf_metafile_skia.cc |
+++ b/printing/pdf_metafile_skia.cc |
@@ -40,11 +40,14 @@ skia::PlatformDevice* PdfMetafileSkia::StartPageForVectorCanvas( |
const float& scale_factor) { |
DCHECK(data_->current_page_.get() == NULL); |
+ // Adjust for the margins and apply the scale factor. |
+ SkMatrix transform; |
+ transform.setTranslate(content_origin.x(), content_origin.y()); |
+ transform.preScale(scale_factor, scale_factor); |
+ |
skia::VectorPlatformDeviceSkia* device = |
new skia::VectorPlatformDeviceSkia(page_size.width(), page_size.height(), |
- SkPDFDevice::kFlip_OriginTransform); |
- device->setInitialTransform(content_origin.x(), content_origin.y(), |
- scale_factor); |
+ transform); |
data_->current_page_ = device->PdfDevice(); |
return device; |
} |