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_skia.h" | 5 #include "printing/pdf_metafile_skia.h" |
6 | 6 |
7 #include "base/eintr_wrapper.h" | 7 #include "base/eintr_wrapper.h" |
8 #include "base/file_descriptor_posix.h" | 8 #include "base/file_descriptor_posix.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 new skia::VectorPlatformDeviceSkia(pdf_page_size, pdf_content_size, | 66 new skia::VectorPlatformDeviceSkia(pdf_page_size, pdf_content_size, |
67 transform); | 67 transform); |
68 data_->current_page_ = pdf_device; | 68 data_->current_page_ = pdf_device; |
69 return pdf_device.get(); | 69 return pdf_device.get(); |
70 } | 70 } |
71 | 71 |
72 bool PdfMetafileSkia::StartPage(const gfx::Size& page_size, | 72 bool PdfMetafileSkia::StartPage(const gfx::Size& page_size, |
73 const gfx::Rect& content_area, | 73 const gfx::Rect& content_area, |
74 const float& scale_factor) { | 74 const float& scale_factor) { |
75 NOTREACHED(); | 75 NOTREACHED(); |
76 return NULL; | 76 return false; |
77 } | 77 } |
78 | 78 |
79 bool PdfMetafileSkia::FinishPage() { | 79 bool PdfMetafileSkia::FinishPage() { |
80 DCHECK(data_->current_page_.get()); | 80 DCHECK(data_->current_page_.get()); |
81 | 81 |
82 data_->pdf_doc_.appendPage(data_->current_page_.get()); | 82 data_->pdf_doc_.appendPage(data_->current_page_.get()); |
83 page_outstanding_ = false; | 83 page_outstanding_ = false; |
84 return true; | 84 return true; |
85 } | 85 } |
86 | 86 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 SkAutoDataUnref data(pdf_stream.copyToData()); | 241 SkAutoDataUnref data(pdf_stream.copyToData()); |
242 if (data.size() == 0) | 242 if (data.size() == 0) |
243 return NULL; | 243 return NULL; |
244 | 244 |
245 PdfMetafileSkia* metafile = new PdfMetafileSkia; | 245 PdfMetafileSkia* metafile = new PdfMetafileSkia; |
246 metafile->InitFromData(data.bytes(), data.size()); | 246 metafile->InitFromData(data.bytes(), data.size()); |
247 return metafile; | 247 return metafile; |
248 } | 248 } |
249 | 249 |
250 } // namespace printing | 250 } // namespace printing |
OLD | NEW |