| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 if (sizeRecorded != sizeRead) { | 328 if (sizeRecorded != sizeRead) { |
| 329 // we could try to fix up the offset... | 329 // we could try to fix up the offset... |
| 330 sk_throw(); | 330 sk_throw(); |
| 331 } | 331 } |
| 332 } else { | 332 } else { |
| 333 // we must skip the remaining data | 333 // we must skip the remaining data |
| 334 fReader.skip(sizeRecorded); | 334 fReader.skip(sizeRecorded); |
| 335 } | 335 } |
| 336 return obj; | 336 return obj; |
| 337 } | 337 } |
| 338 | |
| 339 /** | |
| 340 * Needs to follow the same pattern as readFlattenable(), but explicitly skip w
hatever data | |
| 341 * has been written. | |
| 342 */ | |
| 343 void SkReadBuffer::skipFlattenable() { | |
| 344 if (fFactoryCount > 0) { | |
| 345 if (0 == fReader.readU32()) { | |
| 346 return; | |
| 347 } | |
| 348 } else if (fFactoryTDArray) { | |
| 349 if (0 == fReader.readU32()) { | |
| 350 return; | |
| 351 } | |
| 352 } else { | |
| 353 if (NULL == this->readFunctionPtr()) { | |
| 354 return; | |
| 355 } | |
| 356 } | |
| 357 uint32_t sizeRecorded = fReader.readU32(); | |
| 358 fReader.skip(sizeRecorded); | |
| 359 } | |
| OLD | NEW |