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/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 | 101 |
102 pdf_data_.reset(CFDataCreateMutable(kCFAllocatorDefault, src_buffer_size)); | 102 pdf_data_.reset(CFDataCreateMutable(kCFAllocatorDefault, src_buffer_size)); |
103 CFDataAppendBytes(pdf_data_, static_cast<const UInt8*>(src_buffer), | 103 CFDataAppendBytes(pdf_data_, static_cast<const UInt8*>(src_buffer), |
104 src_buffer_size); | 104 src_buffer_size); |
105 | 105 |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
109 SkDevice* PdfMetafileCg::StartPageForVectorCanvas( | 109 SkDevice* PdfMetafileCg::StartPageForVectorCanvas( |
110 int page_number, const gfx::Size& page_size, const gfx::Rect& content_area, | 110 const gfx::Size& page_size, const gfx::Rect& content_area, |
111 const float& scale_factor) { | 111 const float& scale_factor) { |
112 NOTIMPLEMENTED(); | 112 NOTIMPLEMENTED(); |
113 return NULL; | 113 return NULL; |
114 } | 114 } |
115 | 115 |
116 bool PdfMetafileCg::StartPage(const gfx::Size& page_size, | 116 bool PdfMetafileCg::StartPage(const gfx::Size& page_size, |
117 const gfx::Rect& content_area, | 117 const gfx::Rect& content_area, |
118 const float& scale_factor) { | 118 const float& scale_factor) { |
119 DCHECK(context_.get()); | 119 DCHECK(context_.get()); |
120 DCHECK(!page_is_open_); | 120 DCHECK(!page_is_open_); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 291 |
292 if (!pdf_doc_.get()) { | 292 if (!pdf_doc_.get()) { |
293 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( | 293 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( |
294 CGDataProviderCreateWithCFData(pdf_data_)); | 294 CGDataProviderCreateWithCFData(pdf_data_)); |
295 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); | 295 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); |
296 } | 296 } |
297 return pdf_doc_.get(); | 297 return pdf_doc_.get(); |
298 } | 298 } |
299 | 299 |
300 } // namespace printing | 300 } // namespace printing |
OLD | NEW |