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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 // This class uses Skia graphics library to generate a PDF document. | 28 // This class uses Skia graphics library to generate a PDF document. |
29 class PRINTING_EXPORT PdfMetafileSkia : public Metafile { | 29 class PRINTING_EXPORT PdfMetafileSkia : public Metafile { |
30 public: | 30 public: |
31 PdfMetafileSkia(); | 31 PdfMetafileSkia(); |
32 ~PdfMetafileSkia() override; | 32 ~PdfMetafileSkia() override; |
33 | 33 |
34 // Metafile methods. | 34 // Metafile methods. |
35 bool Init() override; | 35 bool Init() override; |
36 bool InitFromData(const void* src_buffer, uint32 src_buffer_size) override; | 36 bool InitFromData(const void* src_buffer, uint32 src_buffer_size) override; |
37 | 37 |
38 skia::RefPtr<skia::VectorCanvas> GetVectorCanvasForNewPage( | |
39 const gfx::Size& page_size, const gfx::Rect& content_area, | |
40 const float& scale_factor) override; | |
41 | |
42 // Deprecated. Please use GetVectorCanvasForNewPage(). | |
Vitaly Buka (NO REVIEWS)
2014/11/03 19:57:02
I guess we are going to remove that soon after rol
hal.canary
2014/11/04 15:30:35
Done.
| |
38 SkBaseDevice* StartPageForVectorCanvas(const gfx::Size& page_size, | 43 SkBaseDevice* StartPageForVectorCanvas(const gfx::Size& page_size, |
39 const gfx::Rect& content_area, | 44 const gfx::Rect& content_area, |
40 const float& scale_factor) override; | 45 const float& scale_factor) override; |
41 | 46 |
42 bool StartPage(const gfx::Size& page_size, | 47 bool StartPage(const gfx::Size& page_size, |
43 const gfx::Rect& content_area, | 48 const gfx::Rect& content_area, |
44 const float& scale_factor) override; | 49 const float& scale_factor) override; |
45 bool FinishPage() override; | 50 bool FinishPage() override; |
46 bool FinishDocument() override; | 51 bool FinishDocument() override; |
47 | 52 |
(...skipping 14 matching lines...) Expand all Loading... | |
62 gfx::NativeDrawingContext context, | 67 gfx::NativeDrawingContext context, |
63 const CGRect rect, | 68 const CGRect rect, |
64 const MacRenderPageParams& params) const override; | 69 const MacRenderPageParams& params) const override; |
65 #endif | 70 #endif |
66 | 71 |
67 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 72 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) |
68 // TODO(vitalybuka): replace with SaveTo(). | 73 // TODO(vitalybuka): replace with SaveTo(). |
69 bool SaveToFD(const base::FileDescriptor& fd) const; | 74 bool SaveToFD(const base::FileDescriptor& fd) const; |
70 #endif // if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 75 #endif // if defined(OS_CHROMEOS) || defined(OS_ANDROID) |
71 | 76 |
72 // Return a new metafile containing just the current page in draft mode. | 77 // Return a new metafile containing just the current page. |
73 scoped_ptr<PdfMetafileSkia> GetMetafileForCurrentPage(); | 78 scoped_ptr<PdfMetafileSkia> GetMetafileForCurrentPage(); |
74 | 79 |
80 bool SaveTo(base::File* file) const override; | |
81 | |
75 private: | 82 private: |
76 scoped_ptr<PdfMetafileSkiaData> data_; | 83 scoped_ptr<PdfMetafileSkiaData> data_; |
77 | 84 |
78 // True when finish page is outstanding for current page. | |
79 bool page_outstanding_; | |
80 | |
81 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia); | 85 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia); |
82 }; | 86 }; |
83 | 87 |
84 } // namespace printing | 88 } // namespace printing |
85 | 89 |
86 #endif // PRINTING_PDF_METAFILE_SKIA_H_ | 90 #endif // PRINTING_PDF_METAFILE_SKIA_H_ |
OLD | NEW |