summaryrefslogtreecommitdiffstats
path: root/printing/emf_win.cc
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-21 22:16:43 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-21 22:16:43 +0000
commitd2fdcf03dce0560f23b26f2aa59802ab39f6a3c6 (patch)
tree91ec530f6bfef8c95349075641f3347e52974c43 /printing/emf_win.cc
parente16b8af74c13f79282c608042d92fc1000fb5e62 (diff)
downloadchromium_src-d2fdcf03dce0560f23b26f2aa59802ab39f6a3c6.zip
chromium_src-d2fdcf03dce0560f23b26f2aa59802ab39f6a3c6.tar.gz
chromium_src-d2fdcf03dce0560f23b26f2aa59802ab39f6a3c6.tar.bz2
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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=78812 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=78815 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=78859 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=78860 Review URL: http://codereview.chromium.org/6665046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78935 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/emf_win.cc')
-rw-r--r--printing/emf_win.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/printing/emf_win.cc b/printing/emf_win.cc
index de652f1..8609c34 100644
--- a/printing/emf_win.cc
+++ b/printing/emf_win.cc
@@ -9,6 +9,7 @@
#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"
@@ -412,10 +413,21 @@ 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(scale_factor, 1);
+ DCHECK_EQ(1.0f, scale_factor); // We don't support scaling here.
DCHECK(hdc_);
if (!hdc_)
return false;