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; |