diff options
author | twiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-28 16:51:31 +0000 |
---|---|---|
committer | twiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-28 16:51:31 +0000 |
commit | 8ebe83a40a7a025bce3a69b46a696311bdade196 (patch) | |
tree | 42e55bd04422d08ba37670719f44bb84e1b1b5d8 /printing | |
parent | 96e636f2a301cf9c17ff4118eb16adc3b431c8be (diff) | |
download | chromium_src-8ebe83a40a7a025bce3a69b46a696311bdade196.zip chromium_src-8ebe83a40a7a025bce3a69b46a696311bdade196.tar.gz chromium_src-8ebe83a40a7a025bce3a69b46a696311bdade196.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
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98230
Review URL: http://codereview.chromium.org/7633040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r-- | printing/pdf_metafile_skia.cc | 11 |
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, |