OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkPictureRecord_DEFINED | 8 #ifndef SkPictureRecord_DEFINED |
9 #define SkPictureRecord_DEFINED | 9 #define SkPictureRecord_DEFINED |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 // a 3 byte value into/out of a uint32_t | 26 // a 3 byte value into/out of a uint32_t |
27 #define MASK_24 0x00FFFFFF | 27 #define MASK_24 0x00FFFFFF |
28 #define UNPACK_8_24(combined, small, large) \ | 28 #define UNPACK_8_24(combined, small, large) \ |
29 small = (combined >> 24) & 0xFF; \ | 29 small = (combined >> 24) & 0xFF; \ |
30 large = combined & MASK_24; | 30 large = combined & MASK_24; |
31 #define PACK_8_24(small, large) ((small << 24) | large) | 31 #define PACK_8_24(small, large) ((small << 24) | large) |
32 | 32 |
33 | 33 |
34 class SkPictureRecord : public SkCanvas { | 34 class SkPictureRecord : public SkCanvas { |
35 public: | 35 public: |
36 SkPictureRecord(const SkISize& dimensions, uint32_t recordFlags); | 36 SkPictureRecord(SkPicture* picture, const SkISize& dimensions, uint32_t reco
rdFlags); |
37 virtual ~SkPictureRecord(); | 37 virtual ~SkPictureRecord(); |
38 | 38 |
39 virtual void clear(SkColor) SK_OVERRIDE; | 39 virtual void clear(SkColor) SK_OVERRIDE; |
40 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; | 40 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; |
41 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[], | 41 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[], |
42 const SkPaint&) SK_OVERRIDE; | 42 const SkPaint&) SK_OVERRIDE; |
43 virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; | 43 virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; |
44 virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; | 44 virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; |
45 virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; | 45 virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; |
46 virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; | 46 virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 // These are set to NULL in our constructor, but may be changed by | 273 // These are set to NULL in our constructor, but may be changed by |
274 // subclasses, in which case they will be SkSafeUnref'd in our destructor. | 274 // subclasses, in which case they will be SkSafeUnref'd in our destructor. |
275 SkBBoxHierarchy* fBoundingHierarchy; | 275 SkBBoxHierarchy* fBoundingHierarchy; |
276 SkPictureStateTree* fStateTree; | 276 SkPictureStateTree* fStateTree; |
277 | 277 |
278 // Allocated in the constructor and managed by this class. | 278 // Allocated in the constructor and managed by this class. |
279 SkBitmapHeap* fBitmapHeap; | 279 SkBitmapHeap* fBitmapHeap; |
280 | 280 |
281 private: | 281 private: |
| 282 // The owning SkPicture |
| 283 SkPicture* fPicture; |
| 284 |
282 friend class MatrixClipState; // for access to *Impl methods | 285 friend class MatrixClipState; // for access to *Impl methods |
283 friend class SkMatrixClipStateMgr; // for access to *Impl methods | 286 friend class SkMatrixClipStateMgr; // for access to *Impl methods |
284 | 287 |
285 SkChunkFlatController fFlattenableHeap; | 288 SkChunkFlatController fFlattenableHeap; |
286 | 289 |
287 SkPaintDictionary fPaints; | 290 SkPaintDictionary fPaints; |
288 | 291 |
289 SkPathHeap* fPathHeap; // reference counted | |
290 SkWriter32 fWriter; | 292 SkWriter32 fWriter; |
291 | 293 |
292 // we ref each item in these arrays | 294 // we ref each item in these arrays |
293 SkTDArray<SkPicture*> fPictureRefs; | 295 SkTDArray<SkPicture*> fPictureRefs; |
294 | 296 |
295 uint32_t fRecordFlags; | 297 uint32_t fRecordFlags; |
296 bool fOptsEnabled; | 298 bool fOptsEnabled; |
297 int fInitialSaveCount; | 299 int fInitialSaveCount; |
298 | 300 |
299 friend class SkPicturePlayback; | 301 friend class SkPicturePlayback; |
300 friend class SkPictureTester; // for unit testing | 302 friend class SkPictureTester; // for unit testing |
301 | 303 |
302 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE | 304 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE |
303 SkMatrixClipStateMgr fMCMgr; | 305 SkMatrixClipStateMgr fMCMgr; |
304 #endif | 306 #endif |
305 | 307 |
306 typedef SkCanvas INHERITED; | 308 typedef SkCanvas INHERITED; |
307 }; | 309 }; |
308 | 310 |
309 #endif | 311 #endif |
OLD | NEW |