diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 03:52:55 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 03:52:55 +0000 |
commit | 0a7031a43ea2b15e606882e9c5e3da58f565b701 (patch) | |
tree | a5cc48ab501d0f6bb21ffb0d02815e858c3d9fdc /printing | |
parent | 063f8db1c4ec940c6391a36f85c9bcb124fbed9a (diff) | |
download | chromium_src-0a7031a43ea2b15e606882e9c5e3da58f565b701.zip chromium_src-0a7031a43ea2b15e606882e9c5e3da58f565b701.tar.gz chromium_src-0a7031a43ea2b15e606882e9c5e3da58f565b701.tar.bz2 |
Revert 78662 - Unfork VectorPlatformCanvas.
Unfork VectorPlatformCanvas by making NativeMetafile know how to create an appropriate VectorPlatformDevice. This will also be useful when we have multiple NativeMetafile implemenations (each requiring a different VectorPlatformDevices).
BUG=NONE
TEST=NONE
Review URL: http://codereview.chromium.org/6665046
TBR=vandebo@chromium.org
Review URL: http://codereview.chromium.org/6713029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78663 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r-- | printing/emf_win.cc | 13 | ||||
-rw-r--r-- | printing/emf_win.h | 4 | ||||
-rw-r--r-- | printing/native_metafile.h | 11 | ||||
-rw-r--r-- | printing/pdf_metafile_mac.cc | 7 | ||||
-rw-r--r-- | printing/pdf_metafile_mac.h | 4 | ||||
-rw-r--r-- | printing/pdf_ps_metafile_cairo.cc | 13 | ||||
-rw-r--r-- | printing/pdf_ps_metafile_cairo.h | 3 |
7 files changed, 0 insertions, 55 deletions
diff --git a/printing/emf_win.cc b/printing/emf_win.cc index dd9d8d6..6fea291 100644 --- a/printing/emf_win.cc +++ b/printing/emf_win.cc @@ -9,7 +9,6 @@ #include "base/metrics/histogram.h" #include "base/scoped_ptr.h" #include "base/time.h" -#include "skia/ext/vector_platform_device_win.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/codec/jpeg_codec.h" #include "ui/gfx/codec/png_codec.h" @@ -411,18 +410,6 @@ bool Emf::Record::SafePlayback(const XFORM* base_matrix) const { return res; } -skia::PlatformDevice* Emf::StartPageForVectorCanvas( - const gfx::Size& page_size, const gfx::Point& /*content_origin*/, - const float& scale_factor) { - DCHECK_EQ(1.0f, scale_factor); // We don't support scaling here. - if (!StartPage()) - return NULL; - - return skia::VectorPlatformDeviceFactory::CreateDevice(page_size.width(), - page_size.height(), - true, hdc_); -} - bool Emf::StartPage() { DCHECK(hdc_); if (!hdc_) diff --git a/printing/emf_win.h b/printing/emf_win.h index 241b4e4..5150356 100644 --- a/printing/emf_win.h +++ b/printing/emf_win.h @@ -15,7 +15,6 @@ class FilePath; namespace gfx { -class Point; class Rect; } @@ -34,9 +33,6 @@ class Emf : public NativeMetafile { virtual bool Init() { return true; } virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size); - virtual skia::PlatformDevice* StartPageForVectorCanvas( - const gfx::Size& page_size, const gfx::Point& content_origin, - const float& scale_factor); virtual bool StartPage(); virtual bool FinishPage(); virtual bool Close(); diff --git a/printing/native_metafile.h b/printing/native_metafile.h index ce43740..a076b32 100644 --- a/printing/native_metafile.h +++ b/printing/native_metafile.h @@ -26,10 +26,6 @@ class Size; class Point; } -namespace skia { -class PlatformDevice; -} - #if defined(OS_CHROMEOS) namespace base { class FileDescriptor; @@ -54,13 +50,6 @@ class NativeMetafile { // Note: It should only be called from within the browser process. virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size) = 0; - // This method calls StartPage and then returns an appropriate - // VectorPlatformDevice implementation bound to the context created by - // StartPage or NULL on error. - virtual skia::PlatformDevice* StartPageForVectorCanvas( - const gfx::Size& page_size, const gfx::Point& content_origin, - const float& scale_factor) = 0; - #if defined(OS_WIN) // Inserts a custom GDICOMMENT records indicating StartPage/EndPage calls // (since StartPage and EndPage do not work in a metafile DC). Only valid diff --git a/printing/pdf_metafile_mac.cc b/printing/pdf_metafile_mac.cc index 157950c..6c53de9 100644 --- a/printing/pdf_metafile_mac.cc +++ b/printing/pdf_metafile_mac.cc @@ -62,13 +62,6 @@ bool PdfMetafile::InitFromData(const void* src_buffer, uint32 src_buffer_size) { return true; } -skia::PlatformDevice* PdfMetafile::StartPageForVectorCanvas( - const gfx::Size& page_size, const gfx::Point& content_origin, - const float& scale_factor) { - NOTIMPLEMENTED(); - return NULL; -} - CGContextRef PdfMetafile::StartPage(const gfx::Size& page_size, const gfx::Point& content_origin, const float& scale_factor) { DCHECK(context_.get()); diff --git a/printing/pdf_metafile_mac.h b/printing/pdf_metafile_mac.h index 728ae10..d1dbbef 100644 --- a/printing/pdf_metafile_mac.h +++ b/printing/pdf_metafile_mac.h @@ -33,10 +33,6 @@ class PdfMetafile : public NativeMetafile { virtual bool Init(); virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size); - // Not implemented on mac. - skia::PlatformDevice* StartPageForVectorCanvas( - const gfx::Size& page_size, const gfx::Point& content_origin, - const float& scale_factor); virtual CGContextRef StartPage(const gfx::Size& page_size, const gfx::Point& content_origin, const float& scale_factor); diff --git a/printing/pdf_ps_metafile_cairo.cc b/printing/pdf_ps_metafile_cairo.cc index 9f59eca..cfa89e4 100644 --- a/printing/pdf_ps_metafile_cairo.cc +++ b/printing/pdf_ps_metafile_cairo.cc @@ -145,19 +145,6 @@ bool PdfPsMetafile::SetRawData(const void* src_buffer, return true; } -skia::PlatformDevice* PdfPsMetafile::StartPageForVectorCanvas( - const gfx::Size& page_size, const gfx::Point& content_origin, - const float& scale_factor) { - DCHECK_EQ(1.0f, scale_factor); // We don't yet support scale_factor. - if (!StartPage(page_size, content_origin.y(), content_origin.x())) - return NULL; - - return skia::VectorPlatformDeviceFactory::CreateDevice(context_, - page_size.width(), - page_size.height(), - true); -} - cairo_t* PdfPsMetafile::StartPage(const gfx::Size& page_size, double margin_top_in_points, double margin_left_in_points) { diff --git a/printing/pdf_ps_metafile_cairo.h b/printing/pdf_ps_metafile_cairo.h index faacdb0..1294862 100644 --- a/printing/pdf_ps_metafile_cairo.h +++ b/printing/pdf_ps_metafile_cairo.h @@ -25,9 +25,6 @@ class PdfPsMetafile : public NativeMetafile { virtual bool Init(); virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size); - virtual skia::PlatformDevice* StartPageForVectorCanvas( - const gfx::Size& page_size, const gfx::Point& content_origin, - const float& scale_factor); virtual cairo_t* StartPage(const gfx::Size& page_size, double margin_top_in_points, double margin_left_in_points); |