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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 | 720 |
721 template <class T> | 721 template <class T> |
722 static void SkUnflattenObjectProc(SkOrderedReadBuffer& buffer, void* obj) { | 722 static void SkUnflattenObjectProc(SkOrderedReadBuffer& buffer, void* obj) { |
723 ((T*)obj)->unflatten(buffer); | 723 ((T*)obj)->unflatten(buffer); |
724 } | 724 } |
725 | 725 |
726 class SkChunkFlatController : public SkFlatController { | 726 class SkChunkFlatController : public SkFlatController { |
727 public: | 727 public: |
728 SkChunkFlatController(size_t minSize) | 728 SkChunkFlatController(size_t minSize) |
729 : fHeap(minSize) | 729 : fHeap(minSize) |
730 , fTypefaceSet(SkNEW(SkRefCntSet)) { | 730 , fTypefaceSet(SkNEW(SkRefCntSet)) |
| 731 , fLastAllocated(NULL) { |
731 this->setTypefaceSet(fTypefaceSet); | 732 this->setTypefaceSet(fTypefaceSet); |
732 this->setTypefacePlayback(&fTypefacePlayback); | 733 this->setTypefacePlayback(&fTypefacePlayback); |
733 } | 734 } |
734 | 735 |
735 virtual void* allocThrow(size_t bytes) SK_OVERRIDE { | 736 virtual void* allocThrow(size_t bytes) SK_OVERRIDE { |
736 fLastAllocated = fHeap.allocThrow(bytes); | 737 fLastAllocated = fHeap.allocThrow(bytes); |
737 return fLastAllocated; | 738 return fLastAllocated; |
738 } | 739 } |
739 | 740 |
740 virtual void unalloc(void* ptr) SK_OVERRIDE { | 741 virtual void unalloc(void* ptr) SK_OVERRIDE { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 static void flattenRegion(SkOrderedWriteBuffer& buffer, const void* obj) { | 798 static void flattenRegion(SkOrderedWriteBuffer& buffer, const void* obj) { |
798 buffer.getWriter32()->writeRegion(*(SkRegion*)obj); | 799 buffer.getWriter32()->writeRegion(*(SkRegion*)obj); |
799 } | 800 } |
800 | 801 |
801 static void unflattenRegion(SkOrderedReadBuffer& buffer, void* obj) { | 802 static void unflattenRegion(SkOrderedReadBuffer& buffer, void* obj) { |
802 buffer.getReader32()->readRegion((SkRegion*)obj); | 803 buffer.getReader32()->readRegion((SkRegion*)obj); |
803 } | 804 } |
804 }; | 805 }; |
805 | 806 |
806 #endif | 807 #endif |
OLD | NEW |