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

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

Issue 1906893002: Building up "Fixes for SkRWBuffer" (Closed) Base URL: https://skia.googlesource.com/skia.git@msan
Patch Set: Try modifying the test 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 | « no previous file | tests/DataRefTest.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 2015 Google Inc. 2 * Copyright 2015 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 "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkRWBuffer.h" 9 #include "SkRWBuffer.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 fHead->validate(fAvailable); 135 fHead->validate(fAvailable);
136 fHead->unref(); 136 fHead->unref();
137 } 137 }
138 } 138 }
139 139
140 SkROBuffer::Iter::Iter(const SkROBuffer* buffer) { 140 SkROBuffer::Iter::Iter(const SkROBuffer* buffer) {
141 this->reset(buffer); 141 this->reset(buffer);
142 } 142 }
143 143
144 void SkROBuffer::Iter::reset(const SkROBuffer* buffer) { 144 void SkROBuffer::Iter::reset(const SkROBuffer* buffer) {
145 if (buffer) { 145 if (buffer && buffer->fHead) {
146 fBlock = &buffer->fHead->fBlock; 146 fBlock = &buffer->fHead->fBlock;
147 fRemaining = buffer->fAvailable; 147 fRemaining = buffer->fAvailable;
148 } else { 148 } else {
149 fBlock = nullptr; 149 fBlock = nullptr;
150 fRemaining = 0; 150 fRemaining = 0;
151 } 151 }
152 } 152 }
153 153
154 const void* SkROBuffer::Iter::data() const { 154 const void* SkROBuffer::Iter::data() const {
155 return fRemaining ? fBlock->startData() : nullptr; 155 return fRemaining ? fBlock->startData() : nullptr;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 const SkROBuffer* fBuffer; 335 const SkROBuffer* fBuffer;
336 SkROBuffer::Iter fIter; 336 SkROBuffer::Iter fIter;
337 size_t fLocalOffset; 337 size_t fLocalOffset;
338 size_t fGlobalOffset; 338 size_t fGlobalOffset;
339 }; 339 };
340 340
341 SkStreamAsset* SkRWBuffer::newStreamSnapshot() const { 341 SkStreamAsset* SkRWBuffer::newStreamSnapshot() const {
342 SkAutoTUnref<SkROBuffer> buffer(this->newRBufferSnapshot()); 342 SkAutoTUnref<SkROBuffer> buffer(this->newRBufferSnapshot());
343 return new SkROBufferStreamAsset(buffer); 343 return new SkROBufferStreamAsset(buffer);
344 } 344 }
OLDNEW
« no previous file with comments | « no previous file | tests/DataRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698