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

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

Issue 1937053002: Remove (almost) unused read/writeFunctionPtr API. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 7 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/SkReadBuffer.h ('k') | src/core/SkValidatingReadBuffer.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 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkErrorInternals.h" 9 #include "SkErrorInternals.h"
10 #include "SkImage.h" 10 #include "SkImage.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 if (sizeRecorded != sizeRead) { 385 if (sizeRecorded != sizeRead) {
386 this->validate(false); 386 this->validate(false);
387 return nullptr; 387 return nullptr;
388 } 388 }
389 } else { 389 } else {
390 // we must skip the remaining data 390 // we must skip the remaining data
391 fReader.skip(sizeRecorded); 391 fReader.skip(sizeRecorded);
392 } 392 }
393 return obj.release(); 393 return obj.release();
394 } 394 }
395
396 /**
397 * Needs to follow the same pattern as readFlattenable(), but explicitly skip w hatever data
398 * has been written.
399 */
400 void SkReadBuffer::skipFlattenable() {
401 if (fFactoryCount > 0) {
402 if (0 == fReader.readU32()) {
403 return;
404 }
405 } else {
406 if (nullptr == this->readFunctionPtr()) {
407 return;
408 }
409 }
410 uint32_t sizeRecorded = fReader.readU32();
411 fReader.skip(sizeRecorded);
412 }
OLDNEW
« no previous file with comments | « src/core/SkReadBuffer.h ('k') | src/core/SkValidatingReadBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698