| OLD | NEW |
| 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 Loading... |
| 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 } | |
| OLD | NEW |