| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, size_t count = 1) { | 233 template <typename T> const T* skip(SkReader32* reader, size_t count = 1) { |
| 234 SkASSERT(count >= 0); | |
| 235 size_t size = sizeof(T) * count; | 234 size_t size = sizeof(T) * count; |
| 236 SkASSERT(SkAlign4(size) == size); | 235 SkASSERT(SkAlign4(size) == size); |
| 237 return reinterpret_cast<const T*>(reader->skip(size)); | 236 return reinterpret_cast<const T*>(reader->skip(size)); |
| 238 } | 237 } |
| 239 | 238 |
| 240 template <typename T> const T* skipAlign(SkReader32* reader, size_t count = 1) { | 239 template <typename T> const T* skipAlign(SkReader32* reader, size_t count = 1) { |
| 241 SkASSERT(count >= 0); | |
| 242 size_t size = SkAlign4(sizeof(T) * count); | 240 size_t size = SkAlign4(sizeof(T) * count); |
| 243 return reinterpret_cast<const T*>(reader->skip(size)); | 241 return reinterpret_cast<const T*>(reader->skip(size)); |
| 244 } | 242 } |
| 245 | 243 |
| 246 /////////////////////////////////////////////////////////////////////////////// | 244 /////////////////////////////////////////////////////////////////////////////// |
| 247 /////////////////////////////////////////////////////////////////////////////// | 245 /////////////////////////////////////////////////////////////////////////////// |
| 248 | 246 |
| 249 static void clipPath_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, | 247 static void clipPath_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, |
| 250 SkGPipeState* state) { | 248 SkGPipeState* state) { |
| 251 SkPath path; | 249 SkPath path; |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 status = kReadAtom_Status; | 897 status = kReadAtom_Status; |
| 900 break; | 898 break; |
| 901 } | 899 } |
| 902 } | 900 } |
| 903 | 901 |
| 904 if (bytesRead) { | 902 if (bytesRead) { |
| 905 *bytesRead = reader.offset(); | 903 *bytesRead = reader.offset(); |
| 906 } | 904 } |
| 907 return status; | 905 return status; |
| 908 } | 906 } |
| OLD | NEW |