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

Side by Side Diff: src/pdf/SkPDFTypes.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/SkPDFTypes.h ('k') | no next file » | 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 "SkDeflate.h" 8 #include "SkDeflate.h"
9 #include "SkPDFTypes.h" 9 #include "SkPDFTypes.h"
10 #include "SkPDFUtils.h" 10 #include "SkPDFUtils.h"
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 } 466 }
467 467
468 void SkPDFSharedStream::emitObject( 468 void SkPDFSharedStream::emitObject(
469 SkWStream* stream, 469 SkWStream* stream,
470 const SkPDFObjNumMap& objNumMap, 470 const SkPDFObjNumMap& objNumMap,
471 const SkPDFSubstituteMap& substitutes) const { 471 const SkPDFSubstituteMap& substitutes) const {
472 SkASSERT(!fDumped); 472 SkASSERT(!fDumped);
473 SkDynamicMemoryWStream buffer; 473 SkDynamicMemoryWStream buffer;
474 SkDeflateWStream deflateWStream(&buffer); 474 SkDeflateWStream deflateWStream(&buffer);
475 // Since emitObject is const, this function doesn't change the dictionary. 475 // Since emitObject is const, this function doesn't change the dictionary.
476 SkAutoTDelete<SkStreamAsset> dup(fAsset->duplicate()); // Cheap copy 476 std::unique_ptr<SkStreamAsset> dup(fAsset->duplicate()); // Cheap copy
477 SkASSERT(dup); 477 SkASSERT(dup);
478 SkStreamCopy(&deflateWStream, dup.get()); 478 SkStreamCopy(&deflateWStream, dup.get());
479 deflateWStream.finalize(); 479 deflateWStream.finalize();
480 size_t length = buffer.bytesWritten(); 480 size_t length = buffer.bytesWritten();
481 stream->writeText("<<"); 481 stream->writeText("<<");
482 fDict->emitAll(stream, objNumMap, substitutes); 482 fDict->emitAll(stream, objNumMap, substitutes);
483 stream->writeText("\n"); 483 stream->writeText("\n");
484 SkPDFUnion::Name("Length").emitObject(stream, objNumMap, substitutes); 484 SkPDFUnion::Name("Length").emitObject(stream, objNumMap, substitutes);
485 stream->writeText(" "); 485 stream->writeText(" ");
486 SkPDFUnion::Int(length).emitObject(stream, objNumMap, substitutes); 486 SkPDFUnion::Int(length).emitObject(stream, objNumMap, substitutes);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 550
551 void SkPDFImageDumpStats() { 551 void SkPDFImageDumpStats() {
552 SkDebugf("\ntotal PDF drawImage/drawBitmap calls: %d\n" 552 SkDebugf("\ntotal PDF drawImage/drawBitmap calls: %d\n"
553 "total PDF jpeg images: %d\n" 553 "total PDF jpeg images: %d\n"
554 "total PDF regular images: %d\n", 554 "total PDF regular images: %d\n",
555 gDrawImageCalls.load(), 555 gDrawImageCalls.load(),
556 gJpegImageObjects.load(), 556 gJpegImageObjects.load(),
557 gRegularImageObjects.load()); 557 gRegularImageObjects.load());
558 } 558 }
559 #endif // SK_PDF_IMAGE_STATS 559 #endif // SK_PDF_IMAGE_STATS
OLDNEW
« no previous file with comments | « src/pdf/SkPDFTypes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698