| 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_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/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class PdfMetafileSkia : public Metafile { | 23 class PdfMetafileSkia : public Metafile { |
| 24 public: | 24 public: |
| 25 PdfMetafileSkia(); | 25 PdfMetafileSkia(); |
| 26 virtual ~PdfMetafileSkia(); | 26 virtual ~PdfMetafileSkia(); |
| 27 | 27 |
| 28 // Metafile methods. | 28 // Metafile methods. |
| 29 virtual bool Init(); | 29 virtual bool Init(); |
| 30 virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size); | 30 virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size); |
| 31 | 31 |
| 32 virtual SkDevice* StartPageForVectorCanvas( | 32 virtual SkDevice* StartPageForVectorCanvas( |
| 33 int page_number, | |
| 34 const gfx::Size& page_size, | 33 const gfx::Size& page_size, |
| 35 const gfx::Rect& content_area, | 34 const gfx::Rect& content_area, |
| 36 const float& scale_factor); | 35 const float& scale_factor); |
| 37 | 36 |
| 38 virtual bool StartPage(const gfx::Size& page_size, | 37 virtual bool StartPage(const gfx::Size& page_size, |
| 39 const gfx::Rect& content_area, | 38 const gfx::Rect& content_area, |
| 40 const float& scale_factor); | 39 const float& scale_factor); |
| 41 virtual bool FinishPage(); | 40 virtual bool FinishPage(); |
| 42 virtual bool FinishDocument(); | 41 virtual bool FinishDocument(); |
| 43 | 42 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 66 #endif | 65 #endif |
| 67 | 66 |
| 68 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
| 69 virtual bool SaveToFD(const base::FileDescriptor& fd) const; | 68 virtual bool SaveToFD(const base::FileDescriptor& fd) const; |
| 70 #endif // if defined(OS_CHROMEOS) | 69 #endif // if defined(OS_CHROMEOS) |
| 71 | 70 |
| 72 // Return a new metafile containing just the current page in draft mode. | 71 // Return a new metafile containing just the current page in draft mode. |
| 73 PdfMetafileSkia* GetMetafileForCurrentPage(); | 72 PdfMetafileSkia* GetMetafileForCurrentPage(); |
| 74 | 73 |
| 75 private: | 74 private: |
| 76 static const int kNoOutstandingPage = -1; | |
| 77 | |
| 78 scoped_ptr<PdfMetafileSkiaData> data_; | 75 scoped_ptr<PdfMetafileSkiaData> data_; |
| 79 | 76 |
| 80 // Page number of the outstanding page, or kNoOutstandingPage. | 77 // True when finish page is outstanding for current page. |
| 81 int outstanding_page_number_; | 78 bool page_outstanding_; |
| 82 | 79 |
| 83 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia); | 80 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia); |
| 84 }; | 81 }; |
| 85 | 82 |
| 86 } // namespace printing | 83 } // namespace printing |
| 87 | 84 |
| 88 #endif // PRINTING_PDF_METAFILE_SKIA_H_ | 85 #endif // PRINTING_PDF_METAFILE_SKIA_H_ |
| OLD | NEW |