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

Unified Diff: skia/ext/vector_platform_device_skia.cc

Issue 6879098: Fix print preview clipping issues due to scaling. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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
« printing/pdf_metafile_skia.cc ('K') | « skia/ext/vector_platform_device_skia.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/vector_platform_device_skia.cc
===================================================================
--- skia/ext/vector_platform_device_skia.cc (revision 83060)
+++ skia/ext/vector_platform_device_skia.cc (working copy)
@@ -25,7 +25,11 @@
initialTransform.setTranslate(0, height);
initialTransform.preScale(1, -1);
}
- return new VectorPlatformDeviceSkia(width, height, initialTransform);
+ SkISize size = SkISize::Make(width, height);
+ SkRefPtr<SkPDFDevice> pdf_device =
+ new SkPDFDevice(size, size, initialTransform);
+ pdf_device->unref(); // SkRefPtr and new both took a reference.
+ return new VectorPlatformDeviceSkia(pdf_device.get());
}
static inline SkBitmap makeABitmap(int width, int height) {
@@ -34,11 +38,9 @@
return bitmap;
}
-VectorPlatformDeviceSkia::VectorPlatformDeviceSkia(
- int width, int height, const SkMatrix& initialTransform)
- : PlatformDevice(makeABitmap(width, height)),
- pdf_device_(new SkPDFDevice(width, height, initialTransform)) {
- pdf_device_->unref(); // SkRefPtr and new both took a reference.
+VectorPlatformDeviceSkia::VectorPlatformDeviceSkia(SkPDFDevice* pdf_device)
+ : PlatformDevice(makeABitmap(pdf_device->width(), pdf_device->height())),
+ pdf_device_(pdf_device) {
}
VectorPlatformDeviceSkia::~VectorPlatformDeviceSkia() {
« printing/pdf_metafile_skia.cc ('K') | « skia/ext/vector_platform_device_skia.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698