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 "SkPDFCanvas.h" | 9 #include "SkPDFCanvas.h" |
10 #include "SkPDFDevice.h" | 10 #include "SkPDFDevice.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 } | 355 } |
356 | 356 |
357 SkDocument* SkDocument::CreatePDF(SkWStream* stream, | 357 SkDocument* SkDocument::CreatePDF(SkWStream* stream, |
358 SkScalar dpi, | 358 SkScalar dpi, |
359 SkPixelSerializer* jpegEncoder) { | 359 SkPixelSerializer* jpegEncoder) { |
360 return SkPDFMakeDocument(stream, nullptr, dpi, jpegEncoder).release(); | 360 return SkPDFMakeDocument(stream, nullptr, dpi, jpegEncoder).release(); |
361 } | 361 } |
362 | 362 |
363 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) { | 363 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) { |
364 auto delete_wstream = [](SkWStream* stream, bool) { delete stream; }; | 364 auto delete_wstream = [](SkWStream* stream, bool) { delete stream; }; |
365 SkAutoTDelete<SkFILEWStream> stream(new SkFILEWStream(path)); | 365 std::unique_ptr<SkFILEWStream> stream(new SkFILEWStream(path)); |
366 return stream->isValid() | 366 return stream->isValid() |
367 ? SkPDFMakeDocument(stream.release(), delete_wstream, dpi, nullptr).rele
ase() | 367 ? SkPDFMakeDocument(stream.release(), delete_wstream, dpi, nullptr).rele
ase() |
368 : nullptr; | 368 : nullptr; |
369 } | 369 } |
OLD | NEW |