| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkPDFCanon.h" | 8 #include "SkPDFCanon.h" |
| 9 #include "SkPDFDevice.h" | 9 #include "SkPDFDevice.h" |
| 10 #include "SkPDFDocument.h" | 10 #include "SkPDFDocument.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 SkDocument* SkDocument::CreatePDF(SkWStream* stream, | 392 SkDocument* SkDocument::CreatePDF(SkWStream* stream, |
| 393 SkScalar dpi, | 393 SkScalar dpi, |
| 394 SkPixelSerializer* jpegEncoder) { | 394 SkPixelSerializer* jpegEncoder) { |
| 395 return SkPDFMakeDocument(stream, nullptr, dpi, jpegEncoder).release(); | 395 return SkPDFMakeDocument(stream, nullptr, dpi, jpegEncoder).release(); |
| 396 } | 396 } |
| 397 | 397 |
| 398 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) { | 398 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) { |
| 399 auto delete_wstream = [](SkWStream* stream, bool) { delete stream; }; | 399 auto delete_wstream = [](SkWStream* stream, bool) { delete stream; }; |
| 400 SkAutoTDelete<SkFILEWStream> stream(new SkFILEWStream(path)); | 400 SkAutoTDelete<SkFILEWStream> stream(new SkFILEWStream(path)); |
| 401 return stream->isValid() | 401 return stream->isValid() |
| 402 ? SkPDFMakeDocument(stream.detach(), delete_wstream, dpi, nullptr).relea
se() | 402 ? SkPDFMakeDocument(stream.release(), delete_wstream, dpi, nullptr).rele
ase() |
| 403 : nullptr; | 403 : nullptr; |
| 404 } | 404 } |
| OLD | NEW |