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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 if (index) { | 261 if (index) { |
262 SkDebugf("====== typeface index %d\n", index); | 262 SkDebugf("====== typeface index %d\n", index); |
263 } | 263 } |
264 return NULL; | 264 return NULL; |
265 } else { | 265 } else { |
266 SkASSERT(fTFArray); | 266 SkASSERT(fTFArray); |
267 return fTFArray[index - 1]; | 267 return fTFArray[index - 1]; |
268 } | 268 } |
269 } | 269 } |
270 | 270 |
271 SkFlattenable* SkOrderedReadBuffer::readFlattenable() { | 271 SkFlattenable* SkOrderedReadBuffer::readFlattenable(SkEffectType et) { |
| 272 // |
| 273 // TODO: confirm that et matches the factory we decide to use |
| 274 // |
| 275 |
272 SkFlattenable::Factory factory = NULL; | 276 SkFlattenable::Factory factory = NULL; |
273 | 277 |
274 if (fFactoryCount > 0) { | 278 if (fFactoryCount > 0) { |
275 int32_t index = fReader.readU32(); | 279 int32_t index = fReader.readU32(); |
276 if (0 == index) { | 280 if (0 == index) { |
277 return NULL; // writer failed to give us the flattenable | 281 return NULL; // writer failed to give us the flattenable |
278 } | 282 } |
279 index -= 1; // we stored the index-base-1 | 283 index -= 1; // we stored the index-base-1 |
280 SkASSERT(index < fFactoryCount); | 284 SkASSERT(index < fFactoryCount); |
281 factory = fFactoryArray[index]; | 285 factory = fFactoryArray[index]; |
(...skipping 23 matching lines...) Expand all Loading... |
305 if (sizeRecorded != sizeRead) { | 309 if (sizeRecorded != sizeRead) { |
306 // we could try to fix up the offset... | 310 // we could try to fix up the offset... |
307 sk_throw(); | 311 sk_throw(); |
308 } | 312 } |
309 } else { | 313 } else { |
310 // we must skip the remaining data | 314 // we must skip the remaining data |
311 fReader.skip(sizeRecorded); | 315 fReader.skip(sizeRecorded); |
312 } | 316 } |
313 return obj; | 317 return obj; |
314 } | 318 } |
OLD | NEW |