summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
authortwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 15:02:23 +0000
committertwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 15:02:23 +0000
commita602d87983b0775ec00f7f0c073189723a02306d (patch)
tree5b98cd87f4e4f32006c7f7d01775cdd7c1461c25 /printing
parent567ffeaa47098fd761d082c0f7b5d4b958260537 (diff)
downloadchromium_src-a602d87983b0775ec00f7f0c073189723a02306d.zip
chromium_src-a602d87983b0775ec00f7f0c073189723a02306d.tar.gz
chromium_src-a602d87983b0775ec00f7f0c073189723a02306d.tar.bz2
CL removing inheritance of SkDevice from PlatformDevice.
PlatformDevice is now a base interface, which is implemented by the various flavours of BitmapPlatformDevice, and VectorPlatformDevice. The BitmapPlatformDevice and VectorPlatformDevice classes now inherit directly from SkDevice, or SkPDFDevice, as appropriate. PlatformDevice helper functions access the PlatformDevice interface attached to a SkDevice via meta-data on the SkDevice. BUG=none TEST=none Review URL: http://codereview.chromium.org/7633040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98230 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r--printing/pdf_metafile_skia.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/printing/pdf_metafile_skia.cc b/printing/pdf_metafile_skia.cc
index bc44131..0ec540e 100644
--- a/printing/pdf_metafile_skia.cc
+++ b/printing/pdf_metafile_skia.cc
@@ -61,17 +61,14 @@ SkDevice* PdfMetafileSkia::StartPageForVectorCanvas(
transform.preScale(SkFloatToScalar(scale_factor),
SkFloatToScalar(scale_factor));
- // TODO(ctguil): Refactor: don't create the PDF device explicitly here.
SkISize pdf_page_size = SkISize::Make(page_size.width(), page_size.height());
SkISize pdf_content_size =
SkISize::Make(content_area.width(), content_area.height());
SkRefPtr<SkPDFDevice> pdf_device =
- new SkPDFDevice(pdf_page_size, pdf_content_size, transform);
- pdf_device->unref(); // SkRefPtr and new both took a reference.
- skia::VectorPlatformDeviceSkia* device =
- new skia::VectorPlatformDeviceSkia(pdf_device.get());
- data_->current_page_ = device->PdfDevice();
- return device;
+ new skia::VectorPlatformDeviceSkia(pdf_page_size, pdf_content_size,
+ transform);
+ data_->current_page_ = pdf_device;
+ return pdf_device.get();
}
bool PdfMetafileSkia::StartPage(const gfx::Size& page_size,