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

Side by Side Diff: printing/pdf_metafile_skia.h

Issue 2839323002: Revert of printing::Metafile: Simplify OS_MACOSX-specific code path (Closed)
Patch Set: Created 3 years, 8 months 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
« no previous file with comments | « printing/pdf_metafile_cg_mac.cc ('k') | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 57 bool Playback(skia::NativeDrawingContext hdc,
58 const RECT* rect) const override; 58 const RECT* rect) const override;
59 bool SafePlayback(skia::NativeDrawingContext hdc) const override; 59 bool SafePlayback(skia::NativeDrawingContext hdc) const override;
60 #elif defined(OS_MACOSX)
61 bool RenderPage(unsigned int page_number,
62 skia::NativeDrawingContext context,
63 const CGRect rect,
64 const MacRenderPageParams& params) const override;
60 #endif 65 #endif
61 66
62 bool SaveTo(base::File* file) const override; 67 bool SaveTo(base::File* file) const override;
63 68
64 // Return a new metafile containing just the current page in draft mode. 69 // Return a new metafile containing just the current page in draft mode.
65 std::unique_ptr<PdfMetafileSkia> GetMetafileForCurrentPage( 70 std::unique_ptr<PdfMetafileSkia> GetMetafileForCurrentPage(
66 SkiaDocumentType type); 71 SkiaDocumentType type);
67 72
68 // This method calls StartPage and then returns an appropriate 73 // This method calls StartPage and then returns an appropriate
69 // PlatformCanvas implementation bound to the context created by 74 // PlatformCanvas implementation bound to the context created by
70 // StartPage or NULL on error. The PaintCanvas pointer that 75 // StartPage or NULL on error. The PaintCanvas pointer that
71 // is returned is owned by this PdfMetafileSkia object and does not 76 // is returned is owned by this PdfMetafileSkia object and does not
72 // need to be ref()ed or unref()ed. The canvas will remain valid 77 // need to be ref()ed or unref()ed. The canvas will remain valid
73 // until FinishPage() or FinishDocument() is called. 78 // until FinishPage() or FinishDocument() is called.
74 cc::PaintCanvas* GetVectorCanvasForNewPage(const gfx::Size& page_size, 79 cc::PaintCanvas* GetVectorCanvasForNewPage(const gfx::Size& page_size,
75 const gfx::Rect& content_area, 80 const gfx::Rect& content_area,
76 const float& scale_factor); 81 const float& scale_factor);
77 82
78 private: 83 private:
79 std::unique_ptr<PdfMetafileSkiaData> data_; 84 std::unique_ptr<PdfMetafileSkiaData> data_;
80 85
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
« no previous file with comments | « printing/pdf_metafile_cg_mac.cc ('k') | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698