Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Unified Diff: printing/image_win.cc

Issue 2812263002: clean up printing::Image and printing::Metafile (Closed)
Patch Set: definition matches declaration Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/image_mac.cc ('k') | printing/metafile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/image_win.cc
diff --git a/printing/image_win.cc b/printing/image_win.cc
index 787c24aa52716951b01484d1a3a054cd35e9f706..647374054568b6db8c5e439cb217b84f6c099e71 100644
--- a/printing/image_win.cc
+++ b/printing/image_win.cc
@@ -11,7 +11,7 @@
#include "base/win/scoped_gdi_object.h"
#include "base/win/scoped_hdc.h"
#include "base/win/scoped_select_object.h"
-#include "printing/metafile.h"
+#include "printing/emf_win.h"
#include "skia/ext/skia_utils_win.h"
#include "ui/gfx/gdi_util.h" // EMF support
#include "ui/gfx/geometry/rect.h"
@@ -53,8 +53,13 @@ class DisableFontSmoothing {
namespace printing {
-bool Image::LoadMetafile(const Metafile& metafile) {
- gfx::Rect rect(metafile.GetPageBounds(1));
+bool Image::LoadMetafile(const void* metafile_src_buffer,
+ size_t metafile_src_buffer_size) {
+ Emf metafile;
+ if (!metafile.InitFromData(metafile_src_buffer, metafile_src_buffer_size)) {
+ return false;
+ }
+ gfx::Rect rect(metafile.GetPageBounds(1));
DisableFontSmoothing disable_in_this_scope;
// Create a temporary HDC and bitmap to retrieve the rendered data.
« no previous file with comments | « printing/image_mac.cc ('k') | printing/metafile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698