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

Side by Side Diff: src/core/SkStream.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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/core/SkSpriteBlitter_ARGB32.cpp ('k') | src/core/SkTDynamicHash.h » ('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 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 "SkStream.h" 10 #include "SkStream.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 fFILE = NULL; 248 fFILE = NULL;
249 } 249 }
250 return false; 250 return false;
251 } 251 }
252 252
253 SkStreamAsset* SkFILEStream::duplicate() const { 253 SkStreamAsset* SkFILEStream::duplicate() const {
254 if (NULL == fFILE) { 254 if (NULL == fFILE) {
255 return new SkMemoryStream(); 255 return new SkMemoryStream();
256 } 256 }
257 257
258 if (NULL != fData.get()) { 258 if (fData.get()) {
259 return new SkMemoryStream(fData); 259 return new SkMemoryStream(fData);
260 } 260 }
261 261
262 if (!fName.isEmpty()) { 262 if (!fName.isEmpty()) {
263 SkAutoTUnref<SkFILEStream> that(new SkFILEStream(fName.c_str())); 263 SkAutoTUnref<SkFILEStream> that(new SkFILEStream(fName.c_str()));
264 if (sk_fidentical(that->fFILE, this->fFILE)) { 264 if (sk_fidentical(that->fFILE, this->fFILE)) {
265 return that.detach(); 265 return that.detach();
266 } 266 }
267 } 267 }
268 268
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 SkDynamicMemoryWStream tempStream; 932 SkDynamicMemoryWStream tempStream;
933 const size_t bufferSize = 4096; 933 const size_t bufferSize = 4096;
934 char buffer[bufferSize]; 934 char buffer[bufferSize];
935 do { 935 do {
936 size_t bytesRead = stream->read(buffer, bufferSize); 936 size_t bytesRead = stream->read(buffer, bufferSize);
937 tempStream.write(buffer, bytesRead); 937 tempStream.write(buffer, bytesRead);
938 } while (!stream->isAtEnd()); 938 } while (!stream->isAtEnd());
939 return tempStream.detachAsStream(); // returns a SkBlockMemoryStream, 939 return tempStream.detachAsStream(); // returns a SkBlockMemoryStream,
940 // cheaper than copying to SkData 940 // cheaper than copying to SkData
941 } 941 }
OLDNEW
« no previous file with comments | « src/core/SkSpriteBlitter_ARGB32.cpp ('k') | src/core/SkTDynamicHash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698