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

Side by Side Diff: printing/pdf_metafile_skia.h

Issue 2400873002: keep only one typedef for the native drawing context (Closed)
Patch Set: native_drawing_context.h Created 4 years, 2 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.h ('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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 const float& scale_factor) override; 45 const float& scale_factor) override;
46 bool FinishPage() override; 46 bool FinishPage() override;
47 bool FinishDocument() override; 47 bool FinishDocument() override;
48 48
49 uint32_t GetDataSize() const override; 49 uint32_t GetDataSize() const override;
50 bool GetData(void* dst_buffer, uint32_t dst_buffer_size) const override; 50 bool GetData(void* dst_buffer, uint32_t dst_buffer_size) const override;
51 51
52 gfx::Rect GetPageBounds(unsigned int page_number) const override; 52 gfx::Rect GetPageBounds(unsigned int page_number) const override;
53 unsigned int GetPageCount() const override; 53 unsigned int GetPageCount() const override;
54 54
55 gfx::NativeDrawingContext context() const override; 55 skia::NativeDrawingContext context() const override;
56 56
57 #if defined(OS_WIN) 57 #if defined(OS_WIN)
58 bool Playback(gfx::NativeDrawingContext hdc, 58 bool Playback(skia::NativeDrawingContext hdc,
59 const RECT* rect) const override; 59 const RECT* rect) const override;
60 bool SafePlayback(gfx::NativeDrawingContext hdc) const override; 60 bool SafePlayback(skia::NativeDrawingContext hdc) const override;
61 #elif defined(OS_MACOSX) 61 #elif defined(OS_MACOSX)
62 bool RenderPage(unsigned int page_number, 62 bool RenderPage(unsigned int page_number,
63 gfx::NativeDrawingContext context, 63 skia::NativeDrawingContext context,
64 const CGRect rect, 64 const CGRect rect,
65 const MacRenderPageParams& params) const override; 65 const MacRenderPageParams& params) const override;
66 #endif 66 #endif
67 67
68 bool SaveTo(base::File* file) const override; 68 bool SaveTo(base::File* file) const override;
69 69
70 // Return a new metafile containing just the current page in draft mode. 70 // Return a new metafile containing just the current page in draft mode.
71 std::unique_ptr<PdfMetafileSkia> GetMetafileForCurrentPage( 71 std::unique_ptr<PdfMetafileSkia> GetMetafileForCurrentPage(
72 SkiaDocumentType type); 72 SkiaDocumentType type);
73 73
74 // This method calls StartPage and then returns an appropriate 74 // This method calls StartPage and then returns an appropriate
75 // PlatformCanvas implementation bound to the context created by 75 // PlatformCanvas implementation bound to the context created by
76 // StartPage or NULL on error. The SkCanvas pointer that 76 // StartPage or NULL on error. The SkCanvas pointer that
77 // is returned is owned by this PdfMetafileSkia object and does not 77 // is returned is owned by this PdfMetafileSkia object and does not
78 // need to be ref()ed or unref()ed. The canvas will remain valid 78 // need to be ref()ed or unref()ed. The canvas will remain valid
79 // until FinishPage() or FinishDocument() is called. 79 // until FinishPage() or FinishDocument() is called.
80 SkCanvas* GetVectorCanvasForNewPage(const gfx::Size& page_size, 80 SkCanvas* GetVectorCanvasForNewPage(const gfx::Size& page_size,
81 const gfx::Rect& content_area, 81 const gfx::Rect& content_area,
82 const float& scale_factor); 82 const float& scale_factor);
83 83
84 private: 84 private:
85 std::unique_ptr<PdfMetafileSkiaData> data_; 85 std::unique_ptr<PdfMetafileSkiaData> data_;
86 86
87 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia); 87 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia);
88 }; 88 };
89 89
90 } // namespace printing 90 } // namespace printing
91 91
92 #endif // PRINTING_PDF_METAFILE_SKIA_H_ 92 #endif // PRINTING_PDF_METAFILE_SKIA_H_
OLDNEW
« no previous file with comments | « printing/pdf_metafile_cg_mac.h ('k') | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698