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/utils/SkFrontBufferedStream.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 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/utils/SkEventTracer.cpp ('k') | src/utils/SkImageGeneratorUtils.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 2013 Google Inc. 2 * Copyright 2013 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 "SkFrontBufferedStream.h" 8 #include "SkFrontBufferedStream.h"
9 #include "SkStream.h" 9 #include "SkStream.h"
10 #include "SkTemplates.h" 10 #include "SkTemplates.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // data, and size is greater than 0. 62 // data, and size is greater than 0.
63 size_t readDirectlyFromStream(char* dst, size_t size); 63 size_t readDirectlyFromStream(char* dst, size_t size);
64 64
65 typedef SkStream INHERITED; 65 typedef SkStream INHERITED;
66 }; 66 };
67 67
68 SkStreamRewindable* SkFrontBufferedStream::Create(SkStream* stream, size_t buffe rSize) { 68 SkStreamRewindable* SkFrontBufferedStream::Create(SkStream* stream, size_t buffe rSize) {
69 if (NULL == stream) { 69 if (NULL == stream) {
70 return NULL; 70 return NULL;
71 } 71 }
72 return SkNEW_ARGS(FrontBufferedStream, (stream, bufferSize)); 72 return new FrontBufferedStream(stream, bufferSize);
73 } 73 }
74 74
75 FrontBufferedStream::FrontBufferedStream(SkStream* stream, size_t bufferSize) 75 FrontBufferedStream::FrontBufferedStream(SkStream* stream, size_t bufferSize)
76 : fStream(stream) 76 : fStream(stream)
77 , fHasLength(stream->hasPosition() && stream->hasLength()) 77 , fHasLength(stream->hasPosition() && stream->hasLength())
78 , fLength(stream->getLength() - stream->getPosition()) 78 , fLength(stream->getLength() - stream->getPosition())
79 , fOffset(0) 79 , fOffset(0)
80 , fBufferedSoFar(0) 80 , fBufferedSoFar(0)
81 , fBufferSize(bufferSize) 81 , fBufferSize(bufferSize)
82 , fBuffer(bufferSize) {} 82 , fBuffer(bufferSize) {}
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 205 }
206 206
207 if (size > 0 && !fStream->isAtEnd()) { 207 if (size > 0 && !fStream->isAtEnd()) {
208 SkDEBUGCODE(const size_t bytesReadDirectly =) this->readDirectlyFromStre am(dst, size); 208 SkDEBUGCODE(const size_t bytesReadDirectly =) this->readDirectlyFromStre am(dst, size);
209 SkDEBUGCODE(size -= bytesReadDirectly;) 209 SkDEBUGCODE(size -= bytesReadDirectly;)
210 SkASSERT(size + (fOffset - start) == totalSize); 210 SkASSERT(size + (fOffset - start) == totalSize);
211 } 211 }
212 212
213 return fOffset - start; 213 return fOffset - start;
214 } 214 }
OLDNEW
« no previous file with comments | « src/utils/SkEventTracer.cpp ('k') | src/utils/SkImageGeneratorUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698