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

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

Issue 1834303003: Delete SkFlattenable::Type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase 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 | « src/core/SkReadBuffer.h ('k') | src/core/SkScalerContext.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 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 322
323 uint32_t index = fReader.readU32(); 323 uint32_t index = fReader.readU32();
324 if (0 == index || index > (unsigned)fTFCount) { 324 if (0 == index || index > (unsigned)fTFCount) {
325 return nullptr; 325 return nullptr;
326 } else { 326 } else {
327 SkASSERT(fTFArray); 327 SkASSERT(fTFArray);
328 return fTFArray[index - 1]; 328 return fTFArray[index - 1];
329 } 329 }
330 } 330 }
331 331
332 SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) { 332 SkFlattenable* SkReadBuffer::readFlattenable() {
333 //
334 // TODO: confirm that ft matches the factory we decide to use
335 //
336
337 SkFlattenable::Factory factory = nullptr; 333 SkFlattenable::Factory factory = nullptr;
338 334
339 if (fFactoryCount > 0) { 335 if (fFactoryCount > 0) {
340 int32_t index = fReader.readU32(); 336 int32_t index = fReader.readU32();
341 if (0 == index) { 337 if (0 == index) {
342 return nullptr; // writer failed to give us the flattenable 338 return nullptr; // writer failed to give us the flattenable
343 } 339 }
344 index -= 1; // we stored the index-base-1 340 index -= 1; // we stored the index-base-1
345 if ((unsigned)index >= (unsigned)fFactoryCount) { 341 if ((unsigned)index >= (unsigned)fFactoryCount) {
346 this->validate(false); 342 this->validate(false);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 return; 380 return;
385 } 381 }
386 } else { 382 } else {
387 if (nullptr == this->readFunctionPtr()) { 383 if (nullptr == this->readFunctionPtr()) {
388 return; 384 return;
389 } 385 }
390 } 386 }
391 uint32_t sizeRecorded = fReader.readU32(); 387 uint32_t sizeRecorded = fReader.readU32();
392 fReader.skip(sizeRecorded); 388 fReader.skip(sizeRecorded);
393 } 389 }
OLDNEW
« no previous file with comments | « src/core/SkReadBuffer.h ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698