OLD | NEW |
---|---|
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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "printing/printing_export.h" | 12 #include "printing/printing_export.h" |
13 #include "skia/ext/refptr.h" | |
14 #include "skia/ext/vector_canvas.h" | |
13 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
14 | 16 |
15 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
16 #include <windows.h> | 18 #include <windows.h> |
17 #elif defined(OS_MACOSX) | 19 #elif defined(OS_MACOSX) |
18 #include <ApplicationServices/ApplicationServices.h> | 20 #include <ApplicationServices/ApplicationServices.h> |
19 #include <CoreFoundation/CoreFoundation.h> | 21 #include <CoreFoundation/CoreFoundation.h> |
20 #include "base/mac/scoped_cftyperef.h" | 22 #include "base/mac/scoped_cftyperef.h" |
21 #endif | 23 #endif |
22 | 24 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 // Note: It should only be called from within the renderer process to allocate | 107 // Note: It should only be called from within the renderer process to allocate |
106 // rendering resources. | 108 // rendering resources. |
107 virtual bool Init() = 0; | 109 virtual bool Init() = 0; |
108 | 110 |
109 // Initializes the metafile with the data in |src_buffer|. Returns true | 111 // Initializes the metafile with the data in |src_buffer|. Returns true |
110 // on success. | 112 // on success. |
111 // Note: It should only be called from within the browser process. | 113 // Note: It should only be called from within the browser process. |
112 virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size) = 0; | 114 virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size) = 0; |
113 | 115 |
114 // This method calls StartPage and then returns an appropriate | 116 // This method calls StartPage and then returns an appropriate |
117 // VectorCanvas implementation bound to the context created by | |
118 // StartPage or NULL on error. The default implementation calls | |
Vitaly Buka (NO REVIEWS)
2014/11/04 19:23:55
Let's remove them from Metafile.
https://coderevie
hal.canary
2014/11/05 14:31:33
Sounds good. I'll rebase this CL on top of yours.
| |
119 // StartPageForVectorCanvas. This method is preferred. | |
120 virtual skia::RefPtr<skia::VectorCanvas> GetVectorCanvasForNewPage( | |
121 const gfx::Size& page_size, const gfx::Rect& content_area, | |
122 const float& scale_factor); | |
123 | |
124 // This method calls StartPage and then returns an appropriate | |
115 // VectorPlatformDevice implementation bound to the context created by | 125 // VectorPlatformDevice implementation bound to the context created by |
116 // StartPage or NULL on error. | 126 // StartPage or NULL on error. |
117 virtual SkBaseDevice* StartPageForVectorCanvas(const gfx::Size& page_size, | 127 virtual SkBaseDevice* StartPageForVectorCanvas(const gfx::Size& page_size, |
118 const gfx::Rect& content_area, | 128 const gfx::Rect& content_area, |
119 const float& scale_factor) = 0; | 129 const float& scale_factor) = 0; |
120 | 130 |
121 // Prepares a context for rendering a new page with the given |page_size|, | 131 // Prepares a context for rendering a new page with the given |page_size|, |
122 // |content_area| and a |scale_factor| to use for the drawing. The units are | 132 // |content_area| and a |scale_factor| to use for the drawing. The units are |
123 // in points (=1/72 in). Returns true on success. | 133 // in points (=1/72 in). Returns true on success. |
124 virtual bool StartPage(const gfx::Size& page_size, | 134 virtual bool StartPage(const gfx::Size& page_size, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 | 175 |
166 bool SaveTo(base::File* file) const override; | 176 bool SaveTo(base::File* file) const override; |
167 | 177 |
168 private: | 178 private: |
169 DISALLOW_COPY_AND_ASSIGN(Metafile); | 179 DISALLOW_COPY_AND_ASSIGN(Metafile); |
170 }; | 180 }; |
171 | 181 |
172 } // namespace printing | 182 } // namespace printing |
173 | 183 |
174 #endif // PRINTING_METAFILE_H_ | 184 #endif // PRINTING_METAFILE_H_ |
OLD | NEW |