OLD | NEW |
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 #include "printing/pdf_metafile_mac.h" | 5 #include "printing/pdf_metafile_mac.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/mac/scoped_cftyperef.h" | 9 #include "base/mac/scoped_cftyperef.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return false; | 55 return false; |
56 } | 56 } |
57 | 57 |
58 pdf_data_.reset(CFDataCreateMutable(kCFAllocatorDefault, src_buffer_size)); | 58 pdf_data_.reset(CFDataCreateMutable(kCFAllocatorDefault, src_buffer_size)); |
59 CFDataAppendBytes(pdf_data_, static_cast<const UInt8*>(src_buffer), | 59 CFDataAppendBytes(pdf_data_, static_cast<const UInt8*>(src_buffer), |
60 src_buffer_size); | 60 src_buffer_size); |
61 | 61 |
62 return true; | 62 return true; |
63 } | 63 } |
64 | 64 |
| 65 skia::PlatformDevice* PdfMetafile::StartPageForVectorCanvas( |
| 66 const gfx::Size& page_size, const gfx::Point& content_origin, |
| 67 const float& scale_factor) { |
| 68 NOTIMPLEMENTED(); |
| 69 return NULL; |
| 70 } |
| 71 |
65 bool PdfMetafile::StartPage(const gfx::Size& page_size, | 72 bool PdfMetafile::StartPage(const gfx::Size& page_size, |
66 const gfx::Point& content_origin, | 73 const gfx::Point& content_origin, |
67 const float& scale_factor) { | 74 const float& scale_factor) { |
68 DCHECK(context_.get()); | 75 DCHECK(context_.get()); |
69 DCHECK(!page_is_open_); | 76 DCHECK(!page_is_open_); |
70 | 77 |
71 double height = page_size.height(); | 78 double height = page_size.height(); |
72 double width = page_size.width(); | 79 double width = page_size.width(); |
73 | 80 |
74 CGRect bounds = CGRectMake(0, 0, width, height); | 81 CGRect bounds = CGRectMake(0, 0, width, height); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 245 |
239 if (!pdf_doc_.get()) { | 246 if (!pdf_doc_.get()) { |
240 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( | 247 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( |
241 CGDataProviderCreateWithCFData(pdf_data_)); | 248 CGDataProviderCreateWithCFData(pdf_data_)); |
242 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); | 249 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); |
243 } | 250 } |
244 return pdf_doc_.get(); | 251 return pdf_doc_.get(); |
245 } | 252 } |
246 | 253 |
247 } // namespace printing | 254 } // namespace printing |
OLD | NEW |