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

Unified Diff: printing/emf_win.h

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 | « components/printing/test/mock_printer.cc ('k') | printing/image.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/emf_win.h
diff --git a/printing/emf_win.h b/printing/emf_win.h
index c66e9f24b989745c59ec07296e6ee67bc0a86826..c9a8f604724766f774ba77dc3cb055b3f267a28e 100644
--- a/printing/emf_win.h
+++ b/printing/emf_win.h
@@ -77,9 +77,19 @@ class PRINTING_EXPORT Emf : public Metafile {
unsigned int GetPageCount() const override;
HDC context() const override;
- bool Playback(HDC hdc, const RECT* rect) const override;
+
bool SafePlayback(HDC hdc) const override;
+ // "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.
+ bool Playback(HDC hdc, const RECT* rect) const;
+
HENHMETAFILE emf() const { return emf_; }
// Returns true if metafile contains alpha blend.
« no previous file with comments | « components/printing/test/mock_printer.cc ('k') | printing/image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698