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 #include "SkDrawable.h" |
16 | 17 |
17 class SkDrawable; | 18 class SkDrawable; |
18 class SkLayerInfo; | 19 class SkLayerInfo; |
| 20 struct DrawData; |
19 | 21 |
20 // Calculate conservative identity space bounds for each op in the record. | 22 // Calculate conservative identity space bounds for each op in the record. |
21 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord&, SkRect bounds[]
); | 23 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord&, SkRect bounds[]
); |
22 | 24 |
23 // SkRecordFillBounds(), and gathers information about saveLayers and stores it
for later | 25 // SkRecordFillBounds(), and gathers information about saveLayers and stores it
for later |
24 // use (e.g., layer hoisting). The gathered information is sufficient to determi
ne | 26 // use (e.g., layer hoisting). The gathered information is sufficient to determi
ne |
25 // where each saveLayer will land and which ops in the picture it represents. | 27 // where each saveLayer will land and which ops in the picture it represents. |
26 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord&, SkRect bound
s[], | 28 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord&, SkRect bound
s[], |
27 const SkBigPicture::SnapshotArray*, SkLayerInfo* data
); | 29 const SkBigPicture::SnapshotArray*, SkLayerInfo* data
); |
28 | 30 |
29 // Draw an SkRecord into an SkCanvas. A convenience wrapper around SkRecords::D
raw. | 31 // Draw an SkRecord into an SkCanvas. A convenience wrapper around SkRecords::D
raw. |
| 32 void SkRecordDrawPras(DrawData& data); |
| 33 void SkRecordDrawPrasInit(DrawData& data); |
| 34 bool SkRecordDrawPrasDo(DrawData& data); |
| 35 void SkRecordDrawPrasDeInit(DrawData& data); |
| 36 |
30 void SkRecordDraw(const SkRecord&, SkCanvas*, SkPicture const* const drawablePic
ts[], | 37 void SkRecordDraw(const SkRecord&, SkCanvas*, SkPicture const* const drawablePic
ts[], |
31 SkDrawable* const drawables[], int drawableCount, | 38 SkDrawable* const drawables[], int drawableCount, |
32 const SkBBoxHierarchy*, SkPicture::AbortCallback*); | 39 const SkBBoxHierarchy*, SkPicture::AbortCallback*); |
33 | 40 |
34 // Draw a portion of an SkRecord into an SkCanvas. | 41 // Draw a portion of an SkRecord into an SkCanvas. |
35 // When drawing a portion of an SkRecord the CTM on the passed in canvas must be | 42 // When drawing a portion of an SkRecord the CTM on the passed in canvas must be |
36 // the composition of the replay matrix with the record-time CTM (for the portio
n | 43 // the composition of the replay matrix with the record-time CTM (for the portio
n |
37 // of the record that is being replayed). For setMatrix calls to behave correctl
y | 44 // of the record that is being replayed). For setMatrix calls to behave correctl
y |
38 // the initialCTM parameter must set to just the replay matrix. | 45 // the initialCTM parameter must set to just the replay matrix. |
39 void SkRecordPartialDraw(const SkRecord&, SkCanvas*, | 46 void SkRecordPartialDraw(const SkRecord&, SkCanvas*, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 79 |
73 const SkMatrix fInitialCTM; | 80 const SkMatrix fInitialCTM; |
74 SkCanvas* fCanvas; | 81 SkCanvas* fCanvas; |
75 SkPicture const* const* fDrawablePicts; | 82 SkPicture const* const* fDrawablePicts; |
76 SkDrawable* const* fDrawables; | 83 SkDrawable* const* fDrawables; |
77 int fDrawableCount; | 84 int fDrawableCount; |
78 }; | 85 }; |
79 | 86 |
80 } // namespace SkRecords | 87 } // namespace SkRecords |
81 | 88 |
| 89 struct DrawData { |
| 90 DrawData(const SkRecord& r, |
| 91 SkCanvas* c, |
| 92 SkPicture const* const dp[], |
| 93 SkDrawable* const dw[], |
| 94 int dc, |
| 95 const SkBBoxHierarchy* b, |
| 96 SkPicture::AbortCallback* cb); |
| 97 |
| 98 // input |
| 99 const SkRecord& record; |
| 100 SkCanvas* canvas; |
| 101 SkPicture const* const* drawablePicts; |
| 102 SkDrawable* const* drawables; |
| 103 int drawableCount; |
| 104 const SkBBoxHierarchy* bbh; |
| 105 SkPicture::AbortCallback* callback; |
| 106 |
| 107 // stack |
| 108 SkTDArray<int> ops; |
| 109 SkRecords::Draw draw; |
| 110 |
| 111 int ops_count; |
| 112 int record_count; |
| 113 }; |
| 114 |
82 #endif//SkRecordDraw_DEFINED | 115 #endif//SkRecordDraw_DEFINED |
OLD | NEW |