OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkRecordDraw_DEFINED | 8 #ifndef SkRecordDraw_DEFINED |
9 #define SkRecordDraw_DEFINED | 9 #define SkRecordDraw_DEFINED |
10 | 10 |
11 #include "SkBBoxHierarchy.h" | 11 #include "SkBBoxHierarchy.h" |
12 #include "SkBigPicture.h" | 12 #include "SkBigPicture.h" |
13 #include "SkCanvas.h" | 13 #include "SkCanvas.h" |
14 #include "SkMatrix.h" | 14 #include "SkMatrix.h" |
15 #include "SkRecord.h" | 15 #include "SkRecord.h" |
16 | 16 |
17 class SkDrawable; | 17 class SkDrawable; |
18 class SkLayerInfo; | 18 class SkLayerInfo; |
19 | 19 |
20 // Fill a BBH to be used by SkRecordDraw to accelerate playback. | 20 // Calculate conservative identity space bounds for each op in the record. |
21 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord&, SkBBoxHierarchy
*); | 21 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord&, SkRect bounds[]
); |
22 | 22 |
23 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, | 23 // SkRecordFillBounds(), and gathers information about saveLayers and stores it
for later |
24 const SkBigPicture::SnapshotArray*, | 24 // use (e.g., layer hoisting). The gathered information is sufficient to determi
ne |
25 SkBBoxHierarchy* bbh, SkLayerInfo* data); | 25 // where each saveLayer will land and which ops in the picture it represents. |
| 26 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord&, SkRect bound
s[], |
| 27 const SkBigPicture::SnapshotArray*, SkLayerInfo* data
); |
26 | 28 |
27 // Draw an SkRecord into an SkCanvas. A convenience wrapper around SkRecords::D
raw. | 29 // Draw an SkRecord into an SkCanvas. A convenience wrapper around SkRecords::D
raw. |
28 void SkRecordDraw(const SkRecord&, SkCanvas*, SkPicture const* const drawablePic
ts[], | 30 void SkRecordDraw(const SkRecord&, SkCanvas*, SkPicture const* const drawablePic
ts[], |
29 SkDrawable* const drawables[], int drawableCount, | 31 SkDrawable* const drawables[], int drawableCount, |
30 const SkBBoxHierarchy*, SkPicture::AbortCallback*); | 32 const SkBBoxHierarchy*, SkPicture::AbortCallback*); |
31 | 33 |
32 // Draw a portion of an SkRecord into an SkCanvas. | 34 // Draw a portion of an SkRecord into an SkCanvas. |
33 // When drawing a portion of an SkRecord the CTM on the passed in canvas must be | 35 // When drawing a portion of an SkRecord the CTM on the passed in canvas must be |
34 // the composition of the replay matrix with the record-time CTM (for the portio
n | 36 // the composition of the replay matrix with the record-time CTM (for the portio
n |
35 // of the record that is being replayed). For setMatrix calls to behave correctl
y | 37 // of the record that is being replayed). For setMatrix calls to behave correctl
y |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 const SkMatrix fInitialCTM; | 73 const SkMatrix fInitialCTM; |
72 SkCanvas* fCanvas; | 74 SkCanvas* fCanvas; |
73 SkPicture const* const* fDrawablePicts; | 75 SkPicture const* const* fDrawablePicts; |
74 SkDrawable* const* fDrawables; | 76 SkDrawable* const* fDrawables; |
75 int fDrawableCount; | 77 int fDrawableCount; |
76 }; | 78 }; |
77 | 79 |
78 } // namespace SkRecords | 80 } // namespace SkRecords |
79 | 81 |
80 #endif//SkRecordDraw_DEFINED | 82 #endif//SkRecordDraw_DEFINED |
OLD | NEW |