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_PDF_METAFILE_SKIA_H_ | 5 #ifndef PRINTING_PDF_METAFILE_SKIA_H_ |
6 #define PRINTING_PDF_METAFILE_SKIA_H_ | 6 #define PRINTING_PDF_METAFILE_SKIA_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 uint32_t GetDataSize() const override; | 48 uint32_t GetDataSize() const override; |
49 bool GetData(void* dst_buffer, uint32_t dst_buffer_size) const override; | 49 bool GetData(void* dst_buffer, uint32_t dst_buffer_size) const override; |
50 | 50 |
51 gfx::Rect GetPageBounds(unsigned int page_number) const override; | 51 gfx::Rect GetPageBounds(unsigned int page_number) const override; |
52 unsigned int GetPageCount() const override; | 52 unsigned int GetPageCount() const override; |
53 | 53 |
54 skia::NativeDrawingContext context() const override; | 54 skia::NativeDrawingContext context() const override; |
55 | 55 |
56 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
| 57 bool Playback(skia::NativeDrawingContext hdc, |
| 58 const RECT* rect) const override; |
57 bool SafePlayback(skia::NativeDrawingContext hdc) const override; | 59 bool SafePlayback(skia::NativeDrawingContext hdc) const override; |
58 #endif | 60 #endif |
59 | 61 |
60 bool SaveTo(base::File* file) const override; | 62 bool SaveTo(base::File* file) const override; |
61 | 63 |
62 // Return a new metafile containing just the current page in draft mode. | 64 // Return a new metafile containing just the current page in draft mode. |
63 std::unique_ptr<PdfMetafileSkia> GetMetafileForCurrentPage( | 65 std::unique_ptr<PdfMetafileSkia> GetMetafileForCurrentPage( |
64 SkiaDocumentType type); | 66 SkiaDocumentType type); |
65 | 67 |
66 // This method calls StartPage and then returns an appropriate | 68 // This method calls StartPage and then returns an appropriate |
67 // PlatformCanvas implementation bound to the context created by | 69 // PlatformCanvas implementation bound to the context created by |
68 // StartPage or NULL on error. The PaintCanvas pointer that | 70 // StartPage or NULL on error. The PaintCanvas pointer that |
69 // is returned is owned by this PdfMetafileSkia object and does not | 71 // is returned is owned by this PdfMetafileSkia object and does not |
70 // need to be ref()ed or unref()ed. The canvas will remain valid | 72 // need to be ref()ed or unref()ed. The canvas will remain valid |
71 // until FinishPage() or FinishDocument() is called. | 73 // until FinishPage() or FinishDocument() is called. |
72 cc::PaintCanvas* GetVectorCanvasForNewPage(const gfx::Size& page_size, | 74 cc::PaintCanvas* GetVectorCanvasForNewPage(const gfx::Size& page_size, |
73 const gfx::Rect& content_area, | 75 const gfx::Rect& content_area, |
74 const float& scale_factor); | 76 const float& scale_factor); |
75 | 77 |
76 private: | 78 private: |
77 std::unique_ptr<PdfMetafileSkiaData> data_; | 79 std::unique_ptr<PdfMetafileSkiaData> data_; |
78 | 80 |
79 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia); | 81 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia); |
80 }; | 82 }; |
81 | 83 |
82 } // namespace printing | 84 } // namespace printing |
83 | 85 |
84 #endif // PRINTING_PDF_METAFILE_SKIA_H_ | 86 #endif // PRINTING_PDF_METAFILE_SKIA_H_ |
OLD | NEW |