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

Side by Side Diff: printing/metafile.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 unified diff | Download patch
« no previous file with comments | « printing/image_win.cc ('k') | printing/pdf_metafile_cg_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PRINTING_METAFILE_H_ 5 #ifndef PRINTING_METAFILE_H_
6 #define PRINTING_METAFILE_H_ 6 #define PRINTING_METAFILE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "printing/native_drawing_context.h" 14 #include "printing/native_drawing_context.h"
15 #include "printing/printing_export.h" 15 #include "printing/printing_export.h"
16 16
17 #if defined(OS_WIN)
18 #include <windows.h>
19 #endif
20
21 namespace base { 17 namespace base {
22 class File; 18 class File;
23 } 19 }
24 20
25 namespace gfx { 21 namespace gfx {
26 class Rect; 22 class Rect;
27 class Size; 23 class Size;
28 } 24 }
29 25
30 namespace printing { 26 namespace printing {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // Copies the first |dst_buffer_size| bytes of the underlying data stream into 92 // Copies the first |dst_buffer_size| bytes of the underlying data stream into
97 // |dst_buffer|. This function should ONLY be called after Close() is invoked. 93 // |dst_buffer|. This function should ONLY be called after Close() is invoked.
98 // Returns true if the copy succeeds. 94 // Returns true if the copy succeeds.
99 virtual bool GetData(void* dst_buffer, uint32_t dst_buffer_size) const = 0; 95 virtual bool GetData(void* dst_buffer, uint32_t dst_buffer_size) const = 0;
100 96
101 virtual gfx::Rect GetPageBounds(unsigned int page_number) const = 0; 97 virtual gfx::Rect GetPageBounds(unsigned int page_number) const = 0;
102 virtual unsigned int GetPageCount() const = 0; 98 virtual unsigned int GetPageCount() const = 0;
103 99
104 virtual skia::NativeDrawingContext context() const = 0; 100 virtual skia::NativeDrawingContext context() const = 0;
105 101
106 #if defined(OS_WIN)
107 // "Plays" the EMF buffer in a HDC. It is the same effect as calling the
108 // original GDI function that were called when recording the EMF. |rect| is in
109 // "logical units" and is optional. If |rect| is NULL, the natural EMF bounds
110 // are used.
111 // Note: Windows has been known to have stack buffer overflow in its GDI
112 // functions, whether used directly or indirectly through precompiled EMF
113 // data. We have to accept the risk here. Since it is used only for printing,
114 // it requires user intervention.
115 virtual bool Playback(skia::NativeDrawingContext hdc,
116 const RECT* rect) const = 0;
117 #endif // OS_WIN
118
119 // MetfilePlayer 102 // MetfilePlayer
120 bool GetDataAsVector(std::vector<char>* buffer) const override; 103 bool GetDataAsVector(std::vector<char>* buffer) const override;
121 bool SaveTo(base::File* file) const override; 104 bool SaveTo(base::File* file) const override;
122 105
123 private: 106 private:
124 DISALLOW_COPY_AND_ASSIGN(Metafile); 107 DISALLOW_COPY_AND_ASSIGN(Metafile);
125 }; 108 };
126 109
127 } // namespace printing 110 } // namespace printing
128 111
129 #endif // PRINTING_METAFILE_H_ 112 #endif // PRINTING_METAFILE_H_
OLDNEW
« 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