OLD | NEW |
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 #include "printing/pdf_metafile_cg_mac.h" | 5 #include "printing/pdf_metafile_cg_mac.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return false; | 103 return false; |
104 } | 104 } |
105 | 105 |
106 pdf_data_.reset(CFDataCreateMutable(kCFAllocatorDefault, src_buffer_size)); | 106 pdf_data_.reset(CFDataCreateMutable(kCFAllocatorDefault, src_buffer_size)); |
107 CFDataAppendBytes(pdf_data_, static_cast<const UInt8*>(src_buffer), | 107 CFDataAppendBytes(pdf_data_, static_cast<const UInt8*>(src_buffer), |
108 src_buffer_size); | 108 src_buffer_size); |
109 | 109 |
110 return true; | 110 return true; |
111 } | 111 } |
112 | 112 |
113 SkDevice* PdfMetafileCg::StartPageForVectorCanvas( | 113 SkBaseDevice* PdfMetafileCg::StartPageForVectorCanvas( |
114 const gfx::Size& page_size, const gfx::Rect& content_area, | 114 const gfx::Size& page_size, const gfx::Rect& content_area, |
115 const float& scale_factor) { | 115 const float& scale_factor) { |
116 NOTIMPLEMENTED(); | 116 NOTIMPLEMENTED(); |
117 return NULL; | 117 return NULL; |
118 } | 118 } |
119 | 119 |
120 bool PdfMetafileCg::StartPage(const gfx::Size& page_size, | 120 bool PdfMetafileCg::StartPage(const gfx::Size& page_size, |
121 const gfx::Rect& content_area, | 121 const gfx::Rect& content_area, |
122 const float& scale_factor) { | 122 const float& scale_factor) { |
123 DCHECK(context_.get()); | 123 DCHECK(context_.get()); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 310 |
311 if (!pdf_doc_.get()) { | 311 if (!pdf_doc_.get()) { |
312 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( | 312 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( |
313 CGDataProviderCreateWithCFData(pdf_data_)); | 313 CGDataProviderCreateWithCFData(pdf_data_)); |
314 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); | 314 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); |
315 } | 315 } |
316 return pdf_doc_.get(); | 316 return pdf_doc_.get(); |
317 } | 317 } |
318 | 318 |
319 } // namespace printing | 319 } // namespace printing |
OLD | NEW |