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_cg_mac.h" | 5 #include "printing/pdf_metafile_cg_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_info.h" | 10 #include "base/sys_info.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 return false; | 111 return false; |
112 } | 112 } |
113 | 113 |
114 pdf_data_.reset(CFDataCreateMutable(kCFAllocatorDefault, src_buffer_size)); | 114 pdf_data_.reset(CFDataCreateMutable(kCFAllocatorDefault, src_buffer_size)); |
115 CFDataAppendBytes(pdf_data_, static_cast<const UInt8*>(src_buffer), | 115 CFDataAppendBytes(pdf_data_, static_cast<const UInt8*>(src_buffer), |
116 src_buffer_size); | 116 src_buffer_size); |
117 | 117 |
118 return true; | 118 return true; |
119 } | 119 } |
120 | 120 |
121 skia::PlatformDevice* PdfMetafileCg::StartPageForVectorCanvas( | 121 SkDevice* PdfMetafileCg::StartPageForVectorCanvas( |
122 const gfx::Size& page_size, const gfx::Rect& content_area, | 122 const gfx::Size& page_size, const gfx::Rect& content_area, |
123 const float& scale_factor) { | 123 const float& scale_factor) { |
124 NOTIMPLEMENTED(); | 124 NOTIMPLEMENTED(); |
125 return NULL; | 125 return NULL; |
126 } | 126 } |
127 | 127 |
128 bool PdfMetafileCg::StartPage(const gfx::Size& page_size, | 128 bool PdfMetafileCg::StartPage(const gfx::Size& page_size, |
129 const gfx::Rect& content_area, | 129 const gfx::Rect& content_area, |
130 const float& scale_factor) { | 130 const float& scale_factor) { |
131 DCHECK(context_.get()); | 131 DCHECK(context_.get()); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 if (!pdf_doc_.get()) { | 304 if (!pdf_doc_.get()) { |
305 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( | 305 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( |
306 CGDataProviderCreateWithCFData(pdf_data_)); | 306 CGDataProviderCreateWithCFData(pdf_data_)); |
307 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); | 307 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); |
308 } | 308 } |
309 return pdf_doc_.get(); | 309 return pdf_doc_.get(); |
310 } | 310 } |
311 | 311 |
312 } // namespace printing | 312 } // namespace printing |
OLD | NEW |