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

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

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 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/SkPDFShader.cpp ('k') | src/ports/SkFontHost_mac.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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 27 matching lines...) Expand all
38 SkDeflateWStream deflateWStream(&compressedData); 38 SkDeflateWStream deflateWStream(&compressedData);
39 SkStreamCopy(&deflateWStream, stream); 39 SkStreamCopy(&deflateWStream, stream);
40 deflateWStream.finalize(); 40 deflateWStream.finalize();
41 size_t length = compressedData.bytesWritten(); 41 size_t length = compressedData.bytesWritten();
42 42
43 if (stream->hasLength()) { 43 if (stream->hasLength()) {
44 SkAutoTDelete<SkStreamRewindable> dup(stream->duplicate()); 44 SkAutoTDelete<SkStreamRewindable> dup(stream->duplicate());
45 if (dup && dup->hasLength() && 45 if (dup && dup->hasLength() &&
46 dup->getLength() <= length + strlen("/Filter_/FlateDecode_")) { 46 dup->getLength() <= length + strlen("/Filter_/FlateDecode_")) {
47 this->insertInt("Length", dup->getLength()); 47 this->insertInt("Length", dup->getLength());
48 fCompressedData.reset(dup.detach()); 48 fCompressedData.reset(dup.release());
49 return; 49 return;
50 } 50 }
51 } 51 }
52 fCompressedData.reset(compressedData.detachAsStream()); 52 fCompressedData.reset(compressedData.detachAsStream());
53 this->insertName("Filter", "FlateDecode"); 53 this->insertName("Filter", "FlateDecode");
54 this->insertInt("Length", length); 54 this->insertInt("Length", length);
55 } 55 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFShader.cpp ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698