diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-22 06:36:58 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-22 06:36:58 +0000 |
commit | 481edc5493d2a5bd85ee882b3cf1a21f487a2a94 (patch) | |
tree | b35c073123e217e8306d0d96467a7297bc7e6991 /printing/emf_win.h | |
parent | 12b251a3514d18fc598766a1277bb3ca36bc9448 (diff) | |
download | chromium_src-481edc5493d2a5bd85ee882b3cf1a21f487a2a94.zip chromium_src-481edc5493d2a5bd85ee882b3cf1a21f487a2a94.tar.gz chromium_src-481edc5493d2a5bd85ee882b3cf1a21f487a2a94.tar.bz2 |
Cleanup NativeMetafile (win) interface and EMF class.
- Rename CreateDc to Init() and remove unused argument (all non-test calls were CreateDc(NULL, NULL). [This matches cross platform interface.]
- Remove CreateFileBackedDc from the NativeMetafile interface and make InitToFile() in the EMF class.
- Remove CreateFromFile from the NativeMetafile interface and make it InitFromFile() in the EMF class.
- Move the CloseEmf method into the destructor, making the Emf class a use once class (matches actual use).
BUG=NONE
TEST=NONE
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=78666
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=78669
Review URL: http://codereview.chromium.org/6695013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/emf_win.h')
-rw-r--r-- | printing/emf_win.h | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/printing/emf_win.h b/printing/emf_win.h index f2ccffd..f4ee30f 100644 --- a/printing/emf_win.h +++ b/printing/emf_win.h @@ -29,10 +29,20 @@ class Emf : public NativeMetafile { class Enumerator; struct EnumerationContext; + // Generates a virtual HDC that will record every GDI commands and compile + // it in a EMF data stream. + Emf(); virtual ~Emf(); + // Generates a new metafile that will record every GDI command, and will + // be saved to |metafile_path|. + virtual bool InitToFile(const FilePath& metafile_path); + + // Initializes the Emf with the data in |metafile_path|. + virtual bool InitFromFile(const FilePath& metafile_path); + // NativeMetafile methods. - virtual bool Init() { return true; } + virtual bool Init(); virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size); virtual skia::PlatformDevice* StartPageForVectorCanvas( @@ -68,14 +78,6 @@ class Emf : public NativeMetafile { return hdc_; } - virtual bool CreateDc(HDC sibling, const RECT* rect); - virtual bool CreateFileBackedDc(HDC sibling, - const RECT* rect, - const FilePath& path); - virtual bool CreateFromFile(const FilePath& file_path); - - virtual void CloseEmf(); - virtual bool Playback(HDC hdc, const RECT* rect) const; virtual bool SafePlayback(HDC hdc) const; @@ -85,16 +87,7 @@ class Emf : public NativeMetafile { return emf_; } - protected: - Emf(); - private: - friend class NativeMetafileFactory; - FRIEND_TEST_ALL_PREFIXES(EmfTest, DC); - FRIEND_TEST_ALL_PREFIXES(EmfTest, FileBackedDC); - FRIEND_TEST_ALL_PREFIXES(EmfPrintingTest, Enumerate); - FRIEND_TEST_ALL_PREFIXES(EmfPrintingTest, PageBreak); - // Playbacks safely one EMF record. static int CALLBACK SafePlaybackProc(HDC hdc, HANDLETABLE* handle_table, |