OLD | NEW |
1 // Copyright (c) 2010 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 #include "printing/pdf_ps_metafile_cairo.h" | 5 #include "printing/pdf_ps_metafile_cairo.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <cairo.h> | 9 #include <cairo.h> |
10 #include <cairo-pdf.h> | 10 #include <cairo-pdf.h> |
11 #include <cairo-ps.h> | 11 #include <cairo-ps.h> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void DestroyContextData(void* data) { | 65 void DestroyContextData(void* data) { |
66 // Nothing to be done here. | 66 // Nothing to be done here. |
67 } | 67 } |
68 | 68 |
69 } // namespace | 69 } // namespace |
70 | 70 |
71 namespace printing { | 71 namespace printing { |
72 | 72 |
73 PdfPsMetafile::PdfPsMetafile() | 73 PdfPsMetafile::PdfPsMetafile() |
74 : format_(PDF), | 74 : format_(PDF), |
75 surface_(NULL), context_(NULL) { | 75 surface_(NULL), |
76 } | 76 context_(NULL) { |
77 | |
78 PdfPsMetafile::PdfPsMetafile(const FileFormat& format) | |
79 : format_(format), | |
80 surface_(NULL), context_(NULL) { | |
81 } | 77 } |
82 | 78 |
83 PdfPsMetafile::~PdfPsMetafile() { | 79 PdfPsMetafile::~PdfPsMetafile() { |
84 // Releases all resources if we forgot to do so. | 80 // Releases all resources if we forgot to do so. |
85 CleanUpAll(); | 81 CleanUpAll(); |
86 } | 82 } |
87 | 83 |
88 bool PdfPsMetafile::Init() { | 84 bool PdfPsMetafile::Init() { |
89 // We need to check at least these two members to ensure Init() has not been | 85 // We need to check at least these two members to ensure Init() has not been |
90 // called before. | 86 // called before. |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 data_.clear(); | 285 data_.clear(); |
290 skia::VectorPlatformDevice::ClearFontCache(); | 286 skia::VectorPlatformDevice::ClearFontCache(); |
291 } | 287 } |
292 | 288 |
293 const double PdfPsMetafile::kTopMarginInInch = 0.25; | 289 const double PdfPsMetafile::kTopMarginInInch = 0.25; |
294 const double PdfPsMetafile::kBottomMarginInInch = 0.56; | 290 const double PdfPsMetafile::kBottomMarginInInch = 0.56; |
295 const double PdfPsMetafile::kLeftMarginInInch = 0.25; | 291 const double PdfPsMetafile::kLeftMarginInInch = 0.25; |
296 const double PdfPsMetafile::kRightMarginInInch = 0.25; | 292 const double PdfPsMetafile::kRightMarginInInch = 0.25; |
297 | 293 |
298 } // namespace printing | 294 } // namespace printing |
OLD | NEW |