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 | 9 |
10 #include "SkBitmapHeap.h" | 10 #include "SkBitmapHeap.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 SkTDArray<SkFlattenable::Factory> fFactoryArray; | 223 SkTDArray<SkFlattenable::Factory> fFactoryArray; |
224 SkTDArray<SkBitmap*> fBitmaps; | 224 SkTDArray<SkBitmap*> fBitmaps; |
225 bool fSilent; | 225 bool fSilent; |
226 // Only used when sharing bitmaps with the writer. | 226 // Only used when sharing bitmaps with the writer. |
227 SkBitmapHeap* fSharedHeap; | 227 SkBitmapHeap* fSharedHeap; |
228 unsigned fFlags; | 228 unsigned fFlags; |
229 }; | 229 }; |
230 | 230 |
231 /////////////////////////////////////////////////////////////////////////////// | 231 /////////////////////////////////////////////////////////////////////////////// |
232 | 232 |
233 template <typename T> const T* skip(SkReader32* reader, int count = 1) { | 233 template <typename T> const T* skip(SkReader32* reader, size_t count = 1) { |
234 SkASSERT(count >= 0); | 234 SkASSERT(count >= 0); |
235 size_t size = sizeof(T) * count; | 235 size_t size = sizeof(T) * count; |
236 SkASSERT(SkAlign4(size) == size); | 236 SkASSERT(SkAlign4(size) == size); |
237 return reinterpret_cast<const T*>(reader->skip(size)); | 237 return reinterpret_cast<const T*>(reader->skip(size)); |
238 } | 238 } |
239 | 239 |
240 template <typename T> const T* skipAlign(SkReader32* reader, int count = 1) { | 240 template <typename T> const T* skipAlign(SkReader32* reader, size_t count = 1) { |
241 SkASSERT(count >= 0); | 241 SkASSERT(count >= 0); |
242 size_t size = SkAlign4(sizeof(T) * count); | 242 size_t size = SkAlign4(sizeof(T) * count); |
243 return reinterpret_cast<const T*>(reader->skip(size)); | 243 return reinterpret_cast<const T*>(reader->skip(size)); |
244 } | 244 } |
245 | 245 |
246 /////////////////////////////////////////////////////////////////////////////// | 246 /////////////////////////////////////////////////////////////////////////////// |
247 /////////////////////////////////////////////////////////////////////////////// | 247 /////////////////////////////////////////////////////////////////////////////// |
248 | 248 |
249 static void clipPath_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, | 249 static void clipPath_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, |
250 SkGPipeState* state) { | 250 SkGPipeState* state) { |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 status = kReadAtom_Status; | 899 status = kReadAtom_Status; |
900 break; | 900 break; |
901 } | 901 } |
902 } | 902 } |
903 | 903 |
904 if (bytesRead) { | 904 if (bytesRead) { |
905 *bytesRead = reader.offset(); | 905 *bytesRead = reader.offset(); |
906 } | 906 } |
907 return status; | 907 return status; |
908 } | 908 } |
OLD | NEW |