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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 } | 313 } |
314 | 314 |
315 const SkIRect subset = SkIRect::MakeXYWH(originX, originY, width, height); | 315 const SkIRect subset = SkIRect::MakeXYWH(originX, originY, width, height); |
316 return SkImage::NewFromEncoded(encoded, &subset); | 316 return SkImage::NewFromEncoded(encoded, &subset); |
317 } | 317 } |
318 | 318 |
319 SkTypeface* SkReadBuffer::readTypeface() { | 319 SkTypeface* SkReadBuffer::readTypeface() { |
320 | 320 |
321 uint32_t index = fReader.readU32(); | 321 uint32_t index = fReader.readU32(); |
322 if (0 == index || index > (unsigned)fTFCount) { | 322 if (0 == index || index > (unsigned)fTFCount) { |
323 if (index) { | |
324 SkDebugf("====== typeface index %d\n", index); | |
325 } | |
326 return nullptr; | 323 return nullptr; |
327 } else { | 324 } else { |
328 SkASSERT(fTFArray); | 325 SkASSERT(fTFArray); |
329 return fTFArray[index - 1]; | 326 return fTFArray[index - 1]; |
330 } | 327 } |
331 } | 328 } |
332 | 329 |
333 SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) { | 330 SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) { |
334 // | 331 // |
335 // TODO: confirm that ft matches the factory we decide to use | 332 // TODO: confirm that ft matches the factory we decide to use |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 return; | 390 return; |
394 } | 391 } |
395 } else { | 392 } else { |
396 if (nullptr == this->readFunctionPtr()) { | 393 if (nullptr == this->readFunctionPtr()) { |
397 return; | 394 return; |
398 } | 395 } |
399 } | 396 } |
400 uint32_t sizeRecorded = fReader.readU32(); | 397 uint32_t sizeRecorded = fReader.readU32(); |
401 fReader.skip(sizeRecorded); | 398 fReader.skip(sizeRecorded); |
402 } | 399 } |
OLD | NEW |