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 SkPicturePlayback_DEFINED | 9 #ifndef SkPicturePlayback_DEFINED |
10 #define SkPicturePlayback_DEFINED | 10 #define SkPicturePlayback_DEFINED |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 143 } |
144 | 144 |
145 void getMatrix(SkReader32& reader, SkMatrix* matrix) { | 145 void getMatrix(SkReader32& reader, SkMatrix* matrix) { |
146 reader.readMatrix(matrix); | 146 reader.readMatrix(matrix); |
147 } | 147 } |
148 | 148 |
149 const SkPath& getPath(SkReader32& reader) { | 149 const SkPath& getPath(SkReader32& reader) { |
150 return fPicture->getPath(reader.readInt() - 1); | 150 return fPicture->getPath(reader.readInt() - 1); |
151 } | 151 } |
152 | 152 |
153 SkPicture& getPicture(SkReader32& reader) { | 153 const SkPicture* getPicture(SkReader32& reader) { |
154 int index = reader.readInt(); | 154 int index = reader.readInt(); |
155 SkASSERT(index > 0 && index <= fPictureCount); | 155 SkASSERT(index > 0 && index <= fPictureCount); |
156 return *fPictureRefs[index - 1]; | 156 return fPictureRefs[index - 1]; |
157 } | 157 } |
158 | 158 |
159 const SkPaint* getPaint(SkReader32& reader) { | 159 const SkPaint* getPaint(SkReader32& reader) { |
160 int index = reader.readInt(); | 160 int index = reader.readInt(); |
161 if (index == 0) { | 161 if (index == 0) { |
162 return NULL; | 162 return NULL; |
163 } | 163 } |
164 return &(*fPaints)[index - 1]; | 164 return &(*fPaints)[index - 1]; |
165 } | 165 } |
166 | 166 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // bitmap allows playback to draw nothing and move on. | 239 // bitmap allows playback to draw nothing and move on. |
240 SkBitmap fBadBitmap; | 240 SkBitmap fBadBitmap; |
241 | 241 |
242 SkAutoTUnref<SkBitmapHeap> fBitmapHeap; | 242 SkAutoTUnref<SkBitmapHeap> fBitmapHeap; |
243 | 243 |
244 SkTRefArray<SkBitmap>* fBitmaps; | 244 SkTRefArray<SkBitmap>* fBitmaps; |
245 SkTRefArray<SkPaint>* fPaints; | 245 SkTRefArray<SkPaint>* fPaints; |
246 | 246 |
247 SkData* fOpData; // opcodes and parameters | 247 SkData* fOpData; // opcodes and parameters |
248 | 248 |
249 SkPicture** fPictureRefs; | 249 const SkPicture** fPictureRefs; |
250 int fPictureCount; | 250 int fPictureCount; |
251 | 251 |
252 SkBBoxHierarchy* fBoundingHierarchy; | 252 SkBBoxHierarchy* fBoundingHierarchy; |
253 SkPictureStateTree* fStateTree; | 253 SkPictureStateTree* fStateTree; |
254 | 254 |
255 // Limit the opcode playback to be between the offsets 'start' and 'stop'. | 255 // Limit the opcode playback to be between the offsets 'start' and 'stop'. |
256 // The opcode at 'start' should be a saveLayer while the opcode at | 256 // The opcode at 'start' should be a saveLayer while the opcode at |
257 // 'stop' should be a restore. Neither of those commands will be issued. | 257 // 'stop' should be a restore. Neither of those commands will be issued. |
258 // Set both start & stop to 0 to disable draw limiting | 258 // Set both start & stop to 0 to disable draw limiting |
259 // Draw limiting cannot be enabled at the same time as draw replacing | 259 // Draw limiting cannot be enabled at the same time as draw replacing |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 static void WriteFactories(SkWStream* stream, const SkFactorySet& rec); | 347 static void WriteFactories(SkWStream* stream, const SkFactorySet& rec); |
348 static void WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec); | 348 static void WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec); |
349 | 349 |
350 #ifdef SK_BUILD_FOR_ANDROID | 350 #ifdef SK_BUILD_FOR_ANDROID |
351 SkMutex fDrawMutex; | 351 SkMutex fDrawMutex; |
352 bool fAbortCurrentPlayback; | 352 bool fAbortCurrentPlayback; |
353 #endif | 353 #endif |
354 }; | 354 }; |
355 | 355 |
356 #endif | 356 #endif |
OLD | NEW |