Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Side by Side Diff: printing/pdf_metafile_skia.h

Issue 694213002: Remove calls to deprecated SkPDFDevice and SkPDFDocuemnt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments from Vitaly Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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().
43 // TODO: Remove from Metafile class. http://crbug.com/278148
38 SkBaseDevice* StartPageForVectorCanvas(const gfx::Size& page_size, 44 SkBaseDevice* StartPageForVectorCanvas(const gfx::Size& page_size,
Vitaly Buka (NO REVIEWS) 2014/11/04 19:23:55 Please just remove StartPageForVectorCanvas. There
39 const gfx::Rect& content_area, 45 const gfx::Rect& content_area,
40 const float& scale_factor) override; 46 const float& scale_factor) override;
41 47
42 bool StartPage(const gfx::Size& page_size, 48 bool StartPage(const gfx::Size& page_size,
43 const gfx::Rect& content_area, 49 const gfx::Rect& content_area,
44 const float& scale_factor) override; 50 const float& scale_factor) override;
45 bool FinishPage() override; 51 bool FinishPage() override;
46 bool FinishDocument() override; 52 bool FinishDocument() override;
47 53
48 uint32 GetDataSize() const override; 54 uint32 GetDataSize() const override;
(...skipping 13 matching lines...) Expand all
62 gfx::NativeDrawingContext context, 68 gfx::NativeDrawingContext context,
63 const CGRect rect, 69 const CGRect rect,
64 const MacRenderPageParams& params) const override; 70 const MacRenderPageParams& params) const override;
65 #endif 71 #endif
66 72
67 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) 73 #if defined(OS_CHROMEOS) || defined(OS_ANDROID)
68 // TODO(vitalybuka): replace with SaveTo(). 74 // TODO(vitalybuka): replace with SaveTo().
69 bool SaveToFD(const base::FileDescriptor& fd) const; 75 bool SaveToFD(const base::FileDescriptor& fd) const;
70 #endif // if defined(OS_CHROMEOS) || defined(OS_ANDROID) 76 #endif // if defined(OS_CHROMEOS) || defined(OS_ANDROID)
71 77
72 // Return a new metafile containing just the current page in draft mode. 78 // Return a new metafile containing just the current page.
73 scoped_ptr<PdfMetafileSkia> GetMetafileForCurrentPage(); 79 scoped_ptr<PdfMetafileSkia> GetMetafileForCurrentPage();
74 80
81 bool SaveTo(base::File* file) const override;
82
75 private: 83 private:
76 scoped_ptr<PdfMetafileSkiaData> data_; 84 scoped_ptr<PdfMetafileSkiaData> data_;
77 85
78 // True when finish page is outstanding for current page.
79 bool page_outstanding_;
80
81 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia); 86 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia);
82 }; 87 };
83 88
84 } // namespace printing 89 } // namespace printing
85 90
86 #endif // PRINTING_PDF_METAFILE_SKIA_H_ 91 #endif // PRINTING_PDF_METAFILE_SKIA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698