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

Side by Side Diff: printing/pdf_ps_metafile_cairo.h

Issue 6665046: Unfork VectorPlatformCanvas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
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_PS_METAFILE_CAIRO_H_ 5 #ifndef PRINTING_PDF_PS_METAFILE_CAIRO_H_
6 #define PRINTING_PDF_PS_METAFILE_CAIRO_H_ 6 #define PRINTING_PDF_PS_METAFILE_CAIRO_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "printing/native_metafile.h" 12 #include "printing/native_metafile.h"
13 13
14 typedef struct _cairo_surface cairo_surface_t; 14 typedef struct _cairo_surface cairo_surface_t;
15 15
16 namespace printing { 16 namespace printing {
17 17
18 // This class uses Cairo graphics library to generate PDF stream and stores 18 // This class uses Cairo graphics library to generate PDF stream and stores
19 // rendering results in a string buffer. 19 // rendering results in a string buffer.
20 class PdfPsMetafile : public NativeMetafile { 20 class PdfPsMetafile : public NativeMetafile {
21 public: 21 public:
22 virtual ~PdfPsMetafile(); 22 virtual ~PdfPsMetafile();
23 23
24 // NativeMetafile methods. 24 // NativeMetafile methods.
25 virtual bool Init(); 25 virtual bool Init();
26 virtual bool Init(const void* src_buffer, uint32 src_buffer_size); 26 virtual bool Init(const void* src_buffer, uint32 src_buffer_size);
27 27
28 virtual skia::PlatformDevice* StartPageForVectorCanvas(
29 const gfx::Size& page_size, const gfx::Point& content_origin,
30 const float& scale_factor);
28 virtual cairo_t* StartPage(const gfx::Size& page_size, 31 virtual cairo_t* StartPage(const gfx::Size& page_size,
29 double margin_top_in_points, 32 double margin_top_in_points,
30 double margin_left_in_points); 33 double margin_left_in_points);
31 virtual bool FinishPage(); 34 virtual bool FinishPage();
32 virtual bool Close(); 35 virtual bool Close();
33 36
34 virtual uint32 GetDataSize() const; 37 virtual uint32 GetDataSize() const;
35 virtual bool GetData(void* dst_buffer, uint32 dst_buffer_size) const; 38 virtual bool GetData(void* dst_buffer, uint32 dst_buffer_size) const;
36 39
37 virtual bool SaveTo(const FilePath& file_path) const; 40 virtual bool SaveTo(const FilePath& file_path) const;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 std::string data_; 72 std::string data_;
70 // Buffer stores raw PDF contents set by SetRawPageData. 73 // Buffer stores raw PDF contents set by SetRawPageData.
71 std::string raw_override_data_; 74 std::string raw_override_data_;
72 75
73 DISALLOW_COPY_AND_ASSIGN(PdfPsMetafile); 76 DISALLOW_COPY_AND_ASSIGN(PdfPsMetafile);
74 }; 77 };
75 78
76 } // namespace printing 79 } // namespace printing
77 80
78 #endif // PRINTING_PDF_PS_METAFILE_CAIRO_H_ 81 #endif // PRINTING_PDF_PS_METAFILE_CAIRO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698