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/files/file.h" | 7 #include "base/files/file.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "printing/print_settings.h" | 9 #include "printing/print_settings.h" |
10 #include "third_party/skia/include/core/SkDocument.h" | 10 #include "third_party/skia/include/core/SkDocument.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 return gfx::Rect(gfx::ToRoundedInt(size.width()), | 221 return gfx::Rect(gfx::ToRoundedInt(size.width()), |
222 gfx::ToRoundedInt(size.height())); | 222 gfx::ToRoundedInt(size.height())); |
223 } | 223 } |
224 return gfx::Rect(); | 224 return gfx::Rect(); |
225 } | 225 } |
226 | 226 |
227 unsigned int PdfMetafileSkia::GetPageCount() const { | 227 unsigned int PdfMetafileSkia::GetPageCount() const { |
228 return base::checked_cast<unsigned int>(data_->pages_.size()); | 228 return base::checked_cast<unsigned int>(data_->pages_.size()); |
229 } | 229 } |
230 | 230 |
231 gfx::NativeDrawingContext PdfMetafileSkia::context() const { | 231 skia::NativeDrawingContext PdfMetafileSkia::context() const { |
232 NOTREACHED(); | 232 NOTREACHED(); |
233 return nullptr; | 233 return nullptr; |
234 } | 234 } |
235 | 235 |
236 | 236 |
237 #if defined(OS_WIN) | 237 #if defined(OS_WIN) |
238 bool PdfMetafileSkia::Playback(gfx::NativeDrawingContext hdc, | 238 bool PdfMetafileSkia::Playback(skia::NativeDrawingContext hdc, |
239 const RECT* rect) const { | 239 const RECT* rect) const { |
240 NOTREACHED(); | 240 NOTREACHED(); |
241 return false; | 241 return false; |
242 } | 242 } |
243 | 243 |
244 bool PdfMetafileSkia::SafePlayback(gfx::NativeDrawingContext hdc) const { | 244 bool PdfMetafileSkia::SafePlayback(skia::NativeDrawingContext hdc) const { |
245 NOTREACHED(); | 245 NOTREACHED(); |
246 return false; | 246 return false; |
247 } | 247 } |
248 | 248 |
249 #elif defined(OS_MACOSX) | 249 #elif defined(OS_MACOSX) |
250 /* TODO(caryclark): The set up of PluginInstance::PrintPDFOutput may result in | 250 /* TODO(caryclark): The set up of PluginInstance::PrintPDFOutput may result in |
251 rasterized output. Even if that flow uses PdfMetafileCg::RenderPage, | 251 rasterized output. Even if that flow uses PdfMetafileCg::RenderPage, |
252 the drawing of the PDF into the canvas may result in a rasterized output. | 252 the drawing of the PDF into the canvas may result in a rasterized output. |
253 PDFMetafileSkia::RenderPage should be not implemented as shown and instead | 253 PDFMetafileSkia::RenderPage should be not implemented as shown and instead |
254 should do something like the following CL in PluginInstance::PrintPDFOutput: | 254 should do something like the following CL in PluginInstance::PrintPDFOutput: |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 314 |
315 metafile->data_->pages_.push_back(data_->pages_.back()); | 315 metafile->data_->pages_.push_back(data_->pages_.back()); |
316 | 316 |
317 if (!metafile->FinishDocument()) // Generate PDF. | 317 if (!metafile->FinishDocument()) // Generate PDF. |
318 metafile.reset(); | 318 metafile.reset(); |
319 | 319 |
320 return metafile; | 320 return metafile; |
321 } | 321 } |
322 | 322 |
323 } // namespace printing | 323 } // namespace printing |
OLD | NEW |