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

Unified Diff: printing/metafile.h

Issue 2835193007: Revert of clean up printing::Image and printing::Metafile (Closed)
Patch Set: 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_win.cc ('k') | printing/pdf_metafile_cg_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/metafile.h
diff --git a/printing/metafile.h b/printing/metafile.h
index 88ab032b89ebda9dd27b2ddabf581111eca1bfd5..98eaa39702f7064171dc255d740e6c260168b5da 100644
--- a/printing/metafile.h
+++ b/printing/metafile.h
@@ -13,6 +13,10 @@
#include "build/build_config.h"
#include "printing/native_drawing_context.h"
#include "printing/printing_export.h"
+
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
namespace base {
class File;
@@ -99,6 +103,19 @@
virtual skia::NativeDrawingContext context() const = 0;
+#if defined(OS_WIN)
+ // "Plays" the EMF buffer in a HDC. It is the same effect as calling the
+ // original GDI function that were called when recording the EMF. |rect| is in
+ // "logical units" and is optional. If |rect| is NULL, the natural EMF bounds
+ // are used.
+ // Note: Windows has been known to have stack buffer overflow in its GDI
+ // functions, whether used directly or indirectly through precompiled EMF
+ // data. We have to accept the risk here. Since it is used only for printing,
+ // it requires user intervention.
+ virtual bool Playback(skia::NativeDrawingContext hdc,
+ const RECT* rect) const = 0;
+#endif // OS_WIN
+
// MetfilePlayer
bool GetDataAsVector(std::vector<char>* buffer) const override;
bool SaveTo(base::File* file) const override;
« no previous file with comments | « printing/image_win.cc ('k') | printing/pdf_metafile_cg_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698