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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 int fIndex; | 145 int fIndex; |
146 int32_t fAllocSize; | 146 int32_t fAllocSize; |
147 }; | 147 }; |
148 | 148 |
149 class SkFlatBitmap : public SkFlatData { | 149 class SkFlatBitmap : public SkFlatData { |
150 public: | 150 public: |
151 static SkFlatBitmap* Flatten(SkChunkAlloc*, const SkBitmap&, int index, | 151 static SkFlatBitmap* Flatten(SkChunkAlloc*, const SkBitmap&, int index, |
152 SkRefCntSet*); | 152 SkRefCntSet*); |
153 | 153 |
154 void unflatten(SkBitmap* bitmap, SkRefCntPlayback* rcp) const { | 154 void unflatten(SkBitmap* bitmap, SkRefCntPlayback* rcp) const { |
155 SkOrderedReadBuffer buffer(fBitmapData, 1024*1024); | 155 SkOrderedReadBuffer buffer(fBitmapData, fAllocSize); |
156 if (rcp) { | 156 if (rcp) { |
157 rcp->setupBuffer(buffer); | 157 rcp->setupBuffer(buffer); |
158 } | 158 } |
159 bitmap->unflatten(buffer); | 159 bitmap->unflatten(buffer); |
160 } | 160 } |
161 | 161 |
162 #ifdef SK_DEBUG_VALIDATE | 162 #ifdef SK_DEBUG_VALIDATE |
163 void validate() const { | 163 void validate() const { |
164 // to be written | 164 // to be written |
165 } | 165 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 // to be written | 229 // to be written |
230 } | 230 } |
231 #endif | 231 #endif |
232 | 232 |
233 private: | 233 private: |
234 char fRegionData[1]; | 234 char fRegionData[1]; |
235 typedef SkFlatData INHERITED; | 235 typedef SkFlatData INHERITED; |
236 }; | 236 }; |
237 | 237 |
238 #endif | 238 #endif |
OLD | NEW |