OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkReadBuffer_DEFINED | 8 #ifndef SkReadBuffer_DEFINED |
9 #define SkReadBuffer_DEFINED | 9 #define SkReadBuffer_DEFINED |
10 | 10 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 virtual bool validate(bool isValid) { return true; } | 217 virtual bool validate(bool isValid) { return true; } |
218 virtual bool isValid() const { return true; } | 218 virtual bool isValid() const { return true; } |
219 virtual bool validateAvailable(size_t size) { return true; } | 219 virtual bool validateAvailable(size_t size) { return true; } |
220 | 220 |
221 protected: | 221 protected: |
222 SkReader32 fReader; | 222 SkReader32 fReader; |
223 | 223 |
224 private: | 224 private: |
225 bool readArray(void* value, size_t size, size_t elementSize); | 225 bool readArray(void* value, size_t size, size_t elementSize); |
226 | 226 |
| 227 /** |
| 228 * Try to use fBitmapDecoder to decode the data. Returns true on success a
nd false |
| 229 * on failure. |
| 230 */ |
| 231 bool decodeBitmap(const void* data, size_t length, SkBitmap* bitmap, |
| 232 const SkIRect& subset); |
| 233 |
227 uint32_t fFlags; | 234 uint32_t fFlags; |
228 int fVersion; | 235 int fVersion; |
229 | 236 |
230 void* fMemoryPtr; | 237 void* fMemoryPtr; |
231 | 238 |
232 SkBitmapHeapReader* fBitmapStorage; | 239 SkBitmapHeapReader* fBitmapStorage; |
233 SkTypeface** fTFArray; | 240 SkTypeface** fTFArray; |
234 int fTFCount; | 241 int fTFCount; |
235 | 242 |
236 SkTDArray<SkFlattenable::Factory>* fFactoryTDArray; | 243 SkTDArray<SkFlattenable::Factory>* fFactoryTDArray; |
237 SkFlattenable::Factory* fFactoryArray; | 244 SkFlattenable::Factory* fFactoryArray; |
238 int fFactoryCount; | 245 int fFactoryCount; |
239 | 246 |
240 SkPicture::InstallPixelRefProc fBitmapDecoder; | 247 SkPicture::InstallPixelRefProc fBitmapDecoder; |
241 | 248 |
242 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT | 249 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT |
243 // Debugging counter to keep track of how many bitmaps we | 250 // Debugging counter to keep track of how many bitmaps we |
244 // have decoded. | 251 // have decoded. |
245 int fDecodedBitmapIndex; | 252 int fDecodedBitmapIndex; |
246 #endif // DEBUG_NON_DETERMINISTIC_ASSERT | 253 #endif // DEBUG_NON_DETERMINISTIC_ASSERT |
247 }; | 254 }; |
248 | 255 |
249 #endif // SkReadBuffer_DEFINED | 256 #endif // SkReadBuffer_DEFINED |
OLD | NEW |