| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // rendering resources. | 46 // rendering resources. |
| 47 virtual bool Init() = 0; | 47 virtual bool Init() = 0; |
| 48 | 48 |
| 49 // Initializes the metafile with the data in |src_buffer|. Returns true | 49 // Initializes the metafile with the data in |src_buffer|. Returns true |
| 50 // on success. | 50 // on success. |
| 51 // Note: It should only be called from within the browser process. | 51 // Note: It should only be called from within the browser process. |
| 52 virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size) = 0; | 52 virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size) = 0; |
| 53 | 53 |
| 54 // This method calls StartPage and then returns an appropriate | 54 // This method calls StartPage and then returns an appropriate |
| 55 // VectorPlatformDevice implementation bound to the context created by | 55 // VectorPlatformDevice implementation bound to the context created by |
| 56 // StartPage or NULL on error. |page_number| is zero based. | 56 // StartPage or NULL on error. |
| 57 virtual SkDevice* StartPageForVectorCanvas( | 57 virtual SkDevice* StartPageForVectorCanvas( |
| 58 int page_number, | |
| 59 const gfx::Size& page_size, | 58 const gfx::Size& page_size, |
| 60 const gfx::Rect& content_area, | 59 const gfx::Rect& content_area, |
| 61 const float& scale_factor) = 0; | 60 const float& scale_factor) = 0; |
| 62 | 61 |
| 63 // Prepares a context for rendering a new page with the given |page_size|, | 62 // Prepares a context for rendering a new page with the given |page_size|, |
| 64 // |content_area| and a |scale_factor| to use for the drawing. The units are | 63 // |content_area| and a |scale_factor| to use for the drawing. The units are |
| 65 // in points (=1/72 in). Returns true on success. | 64 // in points (=1/72 in). Returns true on success. |
| 66 virtual bool StartPage(const gfx::Size& page_size, | 65 virtual bool StartPage(const gfx::Size& page_size, |
| 67 const gfx::Rect& content_area, | 66 const gfx::Rect& content_area, |
| 68 const float& scale_factor) = 0; | 67 const float& scale_factor) = 0; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Saves the underlying data to the file associated with fd. This function | 141 // Saves the underlying data to the file associated with fd. This function |
| 143 // should ONLY be called after the metafile is closed. | 142 // should ONLY be called after the metafile is closed. |
| 144 // Returns true if writing succeeded. | 143 // Returns true if writing succeeded. |
| 145 virtual bool SaveToFD(const base::FileDescriptor& fd) const = 0; | 144 virtual bool SaveToFD(const base::FileDescriptor& fd) const = 0; |
| 146 #endif // if defined(OS_CHROMEOS) | 145 #endif // if defined(OS_CHROMEOS) |
| 147 }; | 146 }; |
| 148 | 147 |
| 149 } // namespace printing | 148 } // namespace printing |
| 150 | 149 |
| 151 #endif // PRINTING_METAFILE_H_ | 150 #endif // PRINTING_METAFILE_H_ |
| OLD | NEW |