Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(716)

Unified Diff: printing/pdf_metafile_skia.cc

Issue 6820038: Push the initial transform down into SkPDFDevice. (Chrome side). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and roll Skia to r1111 Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | skia/ext/vector_platform_device_skia.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « DEPS ('k') | skia/ext/vector_platform_device_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698