OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkValidatingReadBuffer.h" | 10 #include "SkValidatingReadBuffer.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 size_t offset = fReader.offset(); | 274 size_t offset = fReader.offset(); |
275 obj = (*factory)(*this); | 275 obj = (*factory)(*this); |
276 // check that we read the amount we expected | 276 // check that we read the amount we expected |
277 size_t sizeRead = fReader.offset() - offset; | 277 size_t sizeRead = fReader.offset() - offset; |
278 this->validate(sizeRecorded == sizeRead); | 278 this->validate(sizeRecorded == sizeRead); |
279 if (fError) { | 279 if (fError) { |
280 obj = nullptr; | 280 obj = nullptr; |
281 } | 281 } |
282 return obj.release(); | 282 return obj.release(); |
283 } | 283 } |
284 | |
285 void SkValidatingReadBuffer::skipFlattenable() { | |
286 SkString name; | |
287 this->readString(&name); | |
288 if (fError) { | |
289 return; | |
290 } | |
291 uint32_t sizeRecorded = this->readUInt(); | |
292 this->skip(sizeRecorded); | |
293 } | |
OLD | NEW |