Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Side by Side Diff: src/pdf/SkPDFDocument.cpp

Issue 1837553002: SkPDF s/SkAutoTDelete/std::unique_ptr/ (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-03-28 (Monday) 10:22:50 EDT Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pdf/SkPDFDevice.h ('k') | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.h ('k') | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698