OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #ifndef SkPictureFlat_DEFINED | 8 #ifndef SkPictureFlat_DEFINED |
9 #define SkPictureFlat_DEFINED | 9 #define SkPictureFlat_DEFINED |
10 | 10 |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 return flat; | 523 return flat; |
524 } | 524 } |
525 | 525 |
526 protected: | 526 protected: |
527 void (*fFlattenProc)(SkOrderedWriteBuffer&, const void*); | 527 void (*fFlattenProc)(SkOrderedWriteBuffer&, const void*); |
528 void (*fUnflattenProc)(SkOrderedReadBuffer&, void*); | 528 void (*fUnflattenProc)(SkOrderedReadBuffer&, void*); |
529 | 529 |
530 private: | 530 private: |
531 void unflattenIntoArray(T* array) const { | 531 void unflattenIntoArray(T* array) const { |
532 const int count = fData.count(); | 532 const int count = fData.count(); |
533 const SkFlatData** iter = fData.begin(); | 533 const SkFlatData* const* iter = fData.begin(); |
534 for (int i = 0; i < count; ++i) { | 534 for (int i = 0; i < count; ++i) { |
535 const SkFlatData* element = iter[i]; | 535 const SkFlatData* element = iter[i]; |
536 int index = element->index() - 1; | 536 int index = element->index() - 1; |
537 SkASSERT((unsigned)index < (unsigned)count); | 537 SkASSERT((unsigned)index < (unsigned)count); |
538 element->unflatten(&array[index], fUnflattenProc, | 538 element->unflatten(&array[index], fUnflattenProc, |
539 fController->getBitmapHeap(), | 539 fController->getBitmapHeap(), |
540 fController->getTypefacePlayback()); | 540 fController->getTypefacePlayback()); |
541 } | 541 } |
542 } | 542 } |
543 | 543 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 static void flattenRegion(SkOrderedWriteBuffer& buffer, const void* obj) { | 666 static void flattenRegion(SkOrderedWriteBuffer& buffer, const void* obj) { |
667 buffer.getWriter32()->writeRegion(*(SkRegion*)obj); | 667 buffer.getWriter32()->writeRegion(*(SkRegion*)obj); |
668 } | 668 } |
669 | 669 |
670 static void unflattenRegion(SkOrderedReadBuffer& buffer, void* obj) { | 670 static void unflattenRegion(SkOrderedReadBuffer& buffer, void* obj) { |
671 buffer.getReader32()->readRegion((SkRegion*)obj); | 671 buffer.getReader32()->readRegion((SkRegion*)obj); |
672 } | 672 } |
673 }; | 673 }; |
674 | 674 |
675 #endif | 675 #endif |
OLD | NEW |