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 | |
72 bool PdfMetafile::StartPage(const gfx::Size& page_size, | 65 bool PdfMetafile::StartPage(const gfx::Size& page_size, |
73 const gfx::Point& content_origin, | 66 const gfx::Point& content_origin, |
74 const float& scale_factor) { | 67 const float& scale_factor) { |
75 DCHECK(context_.get()); | 68 DCHECK(context_.get()); |
76 DCHECK(!page_is_open_); | 69 DCHECK(!page_is_open_); |
77 | 70 |
78 double height = page_size.height(); | 71 double height = page_size.height(); |
79 double width = page_size.width(); | 72 double width = page_size.width(); |
80 | 73 |
81 CGRect bounds = CGRectMake(0, 0, width, height); | 74 CGRect bounds = CGRectMake(0, 0, width, height); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 238 |
246 if (!pdf_doc_.get()) { | 239 if (!pdf_doc_.get()) { |
247 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( | 240 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( |
248 CGDataProviderCreateWithCFData(pdf_data_)); | 241 CGDataProviderCreateWithCFData(pdf_data_)); |
249 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); | 242 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); |
250 } | 243 } |
251 return pdf_doc_.get(); | 244 return pdf_doc_.get(); |
252 } | 245 } |
253 | 246 |
254 } // namespace printing | 247 } // namespace printing |
OLD | NEW |