OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
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 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkErrorInternals.h" | 10 #include "SkErrorInternals.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 uint32_t index = fReader.readU32(); | 327 uint32_t index = fReader.readU32(); |
328 if (0 == index || index > (unsigned)fTFCount) { | 328 if (0 == index || index > (unsigned)fTFCount) { |
329 return nullptr; | 329 return nullptr; |
330 } else { | 330 } else { |
331 SkASSERT(fTFArray); | 331 SkASSERT(fTFArray); |
332 return fTFArray[index - 1]; | 332 return fTFArray[index - 1]; |
333 } | 333 } |
334 } | 334 } |
335 | 335 |
336 SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) { | 336 SkFlattenable* SkReadBuffer::readFlattenable() { |
337 // | |
338 // TODO: confirm that ft matches the factory we decide to use | |
339 // | |
340 | |
341 SkFlattenable::Factory factory = nullptr; | 337 SkFlattenable::Factory factory = nullptr; |
342 | 338 |
343 if (fFactoryCount > 0) { | 339 if (fFactoryCount > 0) { |
344 int32_t index = fReader.readU32(); | 340 int32_t index = fReader.readU32(); |
345 if (0 == index) { | 341 if (0 == index) { |
346 return nullptr; // writer failed to give us the flattenable | 342 return nullptr; // writer failed to give us the flattenable |
347 } | 343 } |
348 index -= 1; // we stored the index-base-1 | 344 index -= 1; // we stored the index-base-1 |
349 if ((unsigned)index >= (unsigned)fFactoryCount) { | 345 if ((unsigned)index >= (unsigned)fFactoryCount) { |
350 this->validate(false); | 346 this->validate(false); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 return; | 399 return; |
404 } | 400 } |
405 } else { | 401 } else { |
406 if (nullptr == this->readFunctionPtr()) { | 402 if (nullptr == this->readFunctionPtr()) { |
407 return; | 403 return; |
408 } | 404 } |
409 } | 405 } |
410 uint32_t sizeRecorded = fReader.readU32(); | 406 uint32_t sizeRecorded = fReader.readU32(); |
411 fReader.skip(sizeRecorded); | 407 fReader.skip(sizeRecorded); |
412 } | 408 } |
OLD | NEW |