Chromium Code Reviews| 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 SkReadBuffer_DEFINED | 9 #ifndef SkReadBuffer_DEFINED |
| 10 #define SkReadBuffer_DEFINED | 10 #define SkReadBuffer_DEFINED |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 return SkData::NewEmpty(); | 127 return SkData::NewEmpty(); |
| 128 } | 128 } |
| 129 void* buffer = sk_malloc_throw(len); | 129 void* buffer = sk_malloc_throw(len); |
| 130 this->readByteArray(buffer, len); | 130 this->readByteArray(buffer, len); |
| 131 return SkData::NewFromMalloc(buffer, len); | 131 return SkData::NewFromMalloc(buffer, len); |
| 132 } | 132 } |
| 133 | 133 |
| 134 // helpers to get info about arrays and binary data | 134 // helpers to get info about arrays and binary data |
| 135 virtual uint32_t getArrayCount(); | 135 virtual uint32_t getArrayCount(); |
| 136 | 136 |
| 137 virtual void readBitmap(SkBitmap* bitmap); | 137 /** |
| 138 * Returns false if the bitmap could not be completely read. In that case, it will be set | |
| 139 * to have width/height, but no pixels. | |
| 140 */ | |
| 141 virtual bool readBitmap(SkBitmap* bitmap); | |
|
scroggo
2014/05/20 13:27:50
If SkValidatingBuffer no longer overrides this, do
reed1
2014/05/20 17:49:58
Done.
| |
| 138 virtual SkTypeface* readTypeface(); | 142 virtual SkTypeface* readTypeface(); |
| 139 | 143 |
| 140 void setBitmapStorage(SkBitmapHeapReader* bitmapStorage) { | 144 void setBitmapStorage(SkBitmapHeapReader* bitmapStorage) { |
| 141 SkRefCnt_SafeAssign(fBitmapStorage, bitmapStorage); | 145 SkRefCnt_SafeAssign(fBitmapStorage, bitmapStorage); |
| 142 } | 146 } |
| 143 | 147 |
| 144 void setTypefaceArray(SkTypeface* array[], int count) { | 148 void setTypefaceArray(SkTypeface* array[], int count) { |
| 145 fTFArray = array; | 149 fTFArray = array; |
| 146 fTFCount = count; | 150 fTFCount = count; |
| 147 } | 151 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 SkPicture::InstallPixelRefProc fBitmapDecoder; | 207 SkPicture::InstallPixelRefProc fBitmapDecoder; |
| 204 | 208 |
| 205 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT | 209 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT |
| 206 // Debugging counter to keep track of how many bitmaps we | 210 // Debugging counter to keep track of how many bitmaps we |
| 207 // have decoded. | 211 // have decoded. |
| 208 int fDecodedBitmapIndex; | 212 int fDecodedBitmapIndex; |
| 209 #endif // DEBUG_NON_DETERMINISTIC_ASSERT | 213 #endif // DEBUG_NON_DETERMINISTIC_ASSERT |
| 210 }; | 214 }; |
| 211 | 215 |
| 212 #endif // SkReadBuffer_DEFINED | 216 #endif // SkReadBuffer_DEFINED |
| OLD | NEW |