summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 06:00:29 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 06:00:29 +0000
commit01cec0a407740bd2b5b92a80b1cbaef8e5ee8f9b (patch)
tree3e15937592d13ee16813323327439f07f24a879b /printing
parent6903090e8ee9ab8c67977d139c4b51369ed70bc7 (diff)
downloadchromium_src-01cec0a407740bd2b5b92a80b1cbaef8e5ee8f9b.zip
chromium_src-01cec0a407740bd2b5b92a80b1cbaef8e5ee8f9b.tar.gz
chromium_src-01cec0a407740bd2b5b92a80b1cbaef8e5ee8f9b.tar.bz2
Revert 78812 - 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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=78662 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=78663 Review URL: http://codereview.chromium.org/6665046 TBR=vandebo@chromium.org Review URL: http://codereview.chromium.org/6708046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78815 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r--printing/emf_win.cc14
-rw-r--r--printing/emf_win.h3
-rw-r--r--printing/native_metafile.h11
-rw-r--r--printing/pdf_metafile_mac.cc7
-rw-r--r--printing/pdf_metafile_mac.h4
-rw-r--r--printing/pdf_ps_metafile_cairo.cc12
-rw-r--r--printing/pdf_ps_metafile_cairo.h3
7 files changed, 1 insertions, 53 deletions
diff --git a/printing/emf_win.cc b/printing/emf_win.cc
index 8609c34..de652f1 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"
@@ -413,21 +412,10 @@ 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) {
- if (!StartPage(page_size, content_origin, scale_factor))
- return NULL;
-
- return skia::VectorPlatformDeviceFactory::CreateDevice(page_size.width(),
- page_size.height(),
- true, hdc_);
-}
-
bool Emf::StartPage(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.
+ DCHECK_EQ(scale_factor, 1);
DCHECK(hdc_);
if (!hdc_)
return false;
diff --git a/printing/emf_win.h b/printing/emf_win.h
index f2ccffd..e3a0a8e 100644
--- a/printing/emf_win.h
+++ b/printing/emf_win.h
@@ -35,9 +35,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);
// Inserts a custom GDICOMMENT records indicating StartPage/EndPage calls
// (since StartPage and EndPage do not work in a metafile DC). Only valid
// when hdc_ is non-NULL. |page_size| and |content_origin| are ignored.
diff --git a/printing/native_metafile.h b/printing/native_metafile.h
index 742ee27..ef1e546 100644
--- a/printing/native_metafile.h
+++ b/printing/native_metafile.h
@@ -26,10 +26,6 @@ class Rect;
class Size;
}
-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;
-
// Prepares a context for rendering a new page at the specified
// |content_origin| with the given |page_size| and a |scale_factor| to use for
// the drawing. The units are in points (=1/72 in). Returns true on success.
diff --git a/printing/pdf_metafile_mac.cc b/printing/pdf_metafile_mac.cc
index 913f6aa..f5a36f8 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;
-}
-
bool PdfMetafile::StartPage(const gfx::Size& page_size,
const gfx::Point& content_origin,
const float& scale_factor) {
diff --git a/printing/pdf_metafile_mac.h b/printing/pdf_metafile_mac.h
index 496b275..c5a2a4a 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.
- virtual skia::PlatformDevice* StartPageForVectorCanvas(
- const gfx::Size& page_size, const gfx::Point& content_origin,
- const float& scale_factor);
virtual bool 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 4a8a1ff..6c42bd4 100644
--- a/printing/pdf_ps_metafile_cairo.cc
+++ b/printing/pdf_ps_metafile_cairo.cc
@@ -145,18 +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) {
- if (!StartPage(page_size, content_origin, scale_factor))
- return NULL;
-
- return skia::VectorPlatformDeviceFactory::CreateDevice(context_,
- page_size.width(),
- page_size.height(),
- true);
-}
-
bool PdfPsMetafile::StartPage(const gfx::Size& page_size,
const gfx::Point& content_origin,
const float& scale_factor) {
diff --git a/printing/pdf_ps_metafile_cairo.h b/printing/pdf_ps_metafile_cairo.h
index 3e1e811..5ff59db 100644
--- a/printing/pdf_ps_metafile_cairo.h
+++ b/printing/pdf_ps_metafile_cairo.h
@@ -31,9 +31,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 bool StartPage(const gfx::Size& page_size,
const gfx::Point& content_origin,
const float& scale_factor);