| 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 | 8 |
| 9 #ifndef SkOrderedReadBuffer_DEFINED | 9 #ifndef SkOrderedReadBuffer_DEFINED |
| 10 #define SkOrderedReadBuffer_DEFINED | 10 #define SkOrderedReadBuffer_DEFINED |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 virtual int32_t readInt() SK_OVERRIDE; | 45 virtual int32_t readInt() SK_OVERRIDE; |
| 46 virtual SkScalar readScalar() SK_OVERRIDE; | 46 virtual SkScalar readScalar() SK_OVERRIDE; |
| 47 virtual uint32_t readUInt() SK_OVERRIDE; | 47 virtual uint32_t readUInt() SK_OVERRIDE; |
| 48 virtual int32_t read32() SK_OVERRIDE; | 48 virtual int32_t read32() SK_OVERRIDE; |
| 49 | 49 |
| 50 // strings -- the caller is responsible for freeing the string contents | 50 // strings -- the caller is responsible for freeing the string contents |
| 51 virtual void readString(SkString* string) SK_OVERRIDE; | 51 virtual void readString(SkString* string) SK_OVERRIDE; |
| 52 virtual void* readEncodedString(size_t* length, SkPaint::TextEncoding encodi
ng) SK_OVERRIDE; | 52 virtual void* readEncodedString(size_t* length, SkPaint::TextEncoding encodi
ng) SK_OVERRIDE; |
| 53 | 53 |
| 54 // common data structures | 54 // common data structures |
| 55 virtual SkFlattenable* readFlattenable() SK_OVERRIDE; | |
| 56 virtual void readPoint(SkPoint* point) SK_OVERRIDE; | 55 virtual void readPoint(SkPoint* point) SK_OVERRIDE; |
| 57 virtual void readMatrix(SkMatrix* matrix) SK_OVERRIDE; | 56 virtual void readMatrix(SkMatrix* matrix) SK_OVERRIDE; |
| 58 virtual void readIRect(SkIRect* rect) SK_OVERRIDE; | 57 virtual void readIRect(SkIRect* rect) SK_OVERRIDE; |
| 59 virtual void readRect(SkRect* rect) SK_OVERRIDE; | 58 virtual void readRect(SkRect* rect) SK_OVERRIDE; |
| 60 virtual void readRegion(SkRegion* region) SK_OVERRIDE; | 59 virtual void readRegion(SkRegion* region) SK_OVERRIDE; |
| 61 virtual void readPath(SkPath* path) SK_OVERRIDE; | 60 virtual void readPath(SkPath* path) SK_OVERRIDE; |
| 62 | 61 |
| 63 // binary data and arrays | 62 // binary data and arrays |
| 64 virtual uint32_t readByteArray(void* value) SK_OVERRIDE; | 63 virtual uint32_t readByteArray(void* value) SK_OVERRIDE; |
| 65 virtual uint32_t readColorArray(SkColor* colors) SK_OVERRIDE; | 64 virtual uint32_t readColorArray(SkColor* colors) SK_OVERRIDE; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 104 |
| 106 /** | 105 /** |
| 107 * Provide a function to decode an SkBitmap from encoded data. Only used if
the writer | 106 * Provide a function to decode an SkBitmap from encoded data. Only used if
the writer |
| 108 * encoded the SkBitmap. If the proper decoder cannot be used, a red bitmap
with the | 107 * encoded the SkBitmap. If the proper decoder cannot be used, a red bitmap
with the |
| 109 * appropriate size will be used. | 108 * appropriate size will be used. |
| 110 */ | 109 */ |
| 111 void setBitmapDecoder(SkPicture::InstallPixelRefProc bitmapDecoder) { | 110 void setBitmapDecoder(SkPicture::InstallPixelRefProc bitmapDecoder) { |
| 112 fBitmapDecoder = bitmapDecoder; | 111 fBitmapDecoder = bitmapDecoder; |
| 113 } | 112 } |
| 114 | 113 |
| 114 protected: |
| 115 // Use readFlattenableT to enforce a type check on the flattenable read |
| 116 virtual SkFlattenable* readFlattenable() SK_OVERRIDE; |
| 117 |
| 115 private: | 118 private: |
| 116 SkReader32 fReader; | 119 SkReader32 fReader; |
| 117 void* fMemoryPtr; | 120 void* fMemoryPtr; |
| 118 | 121 |
| 119 SkBitmapHeapReader* fBitmapStorage; | 122 SkBitmapHeapReader* fBitmapStorage; |
| 120 SkTypeface** fTFArray; | 123 SkTypeface** fTFArray; |
| 121 int fTFCount; | 124 int fTFCount; |
| 122 | 125 |
| 123 SkTDArray<SkFlattenable::Factory>* fFactoryTDArray; | 126 SkTDArray<SkFlattenable::Factory>* fFactoryTDArray; |
| 124 SkFlattenable::Factory* fFactoryArray; | 127 SkFlattenable::Factory* fFactoryArray; |
| 125 int fFactoryCount; | 128 int fFactoryCount; |
| 126 | 129 |
| 127 SkPicture::InstallPixelRefProc fBitmapDecoder; | 130 SkPicture::InstallPixelRefProc fBitmapDecoder; |
| 128 | 131 |
| 129 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT | 132 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT |
| 130 // Debugging counter to keep track of how many bitmaps we | 133 // Debugging counter to keep track of how many bitmaps we |
| 131 // have decoded. | 134 // have decoded. |
| 132 int fDecodedBitmapIndex; | 135 int fDecodedBitmapIndex; |
| 133 #endif // DEBUG_NON_DETERMINISTIC_ASSERT | 136 #endif // DEBUG_NON_DETERMINISTIC_ASSERT |
| 134 | 137 |
| 135 typedef SkFlattenableReadBuffer INHERITED; | 138 typedef SkFlattenableReadBuffer INHERITED; |
| 136 }; | 139 }; |
| 137 | 140 |
| 138 #endif // SkOrderedReadBuffer_DEFINED | 141 #endif // SkOrderedReadBuffer_DEFINED |
| OLD | NEW |