OLD | NEW |
1 #include "SkRecorder.h" | 1 #include "SkRecorder.h" |
2 #include "SkPicture.h" | 2 #include "SkPicture.h" |
3 | 3 |
4 // SkCanvas will fail in mysterious ways if it doesn't know the real width and h
eight. | 4 // SkCanvas will fail in mysterious ways if it doesn't know the real width and h
eight. |
5 SkRecorder::SkRecorder(SkRecord* record, int width, int height) | 5 SkRecorder::SkRecorder(SkRecord* record, int width, int height) |
6 : SkCanvas(width, height), fRecord(record) {} | 6 : SkCanvas(width, height), fRecord(record) {} |
7 | 7 |
8 // To make appending to fRecord a little less verbose. | 8 // To make appending to fRecord a little less verbose. |
9 #define APPEND(T, ...) \ | 9 #define APPEND(T, ...) \ |
10 SkNEW_PLACEMENT_ARGS(fRecord->append<SkRecords::T>(), SkRecords::T, (__V
A_ARGS__)) | 10 SkNEW_PLACEMENT_ARGS(fRecord->append<SkRecords::T>(), SkRecords::T, (__V
A_ARGS__)) |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 const SkPaint* paint, | 188 const SkPaint* paint, |
189 SkCanvas::SaveFlags flags)
{ | 189 SkCanvas::SaveFlags flags)
{ |
190 APPEND(SaveLayer, this->copy(bounds), this->copy(paint), flags); | 190 APPEND(SaveLayer, this->copy(bounds), this->copy(paint), flags); |
191 return SkCanvas::kNoLayer_SaveLayerStrategy; | 191 return SkCanvas::kNoLayer_SaveLayerStrategy; |
192 } | 192 } |
193 | 193 |
194 void SkRecorder::willRestore() { | 194 void SkRecorder::willRestore() { |
195 APPEND(Restore); | 195 APPEND(Restore); |
196 } | 196 } |
197 | 197 |
| 198 void SkRecorder::onPushCull(const SkRect& rect) { |
| 199 APPEND(PushCull, rect); |
| 200 } |
| 201 |
| 202 void SkRecorder::onPopCull() { |
| 203 APPEND(PopCull); |
| 204 } |
| 205 |
198 void SkRecorder::didConcat(const SkMatrix& matrix) { | 206 void SkRecorder::didConcat(const SkMatrix& matrix) { |
199 APPEND(Concat, matrix); | 207 APPEND(Concat, matrix); |
200 } | 208 } |
201 | 209 |
202 void SkRecorder::didSetMatrix(const SkMatrix& matrix) { | 210 void SkRecorder::didSetMatrix(const SkMatrix& matrix) { |
203 APPEND(SetMatrix, matrix); | 211 APPEND(SetMatrix, matrix); |
204 } | 212 } |
205 | 213 |
206 void SkRecorder::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const
SkPaint& paint) { | 214 void SkRecorder::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const
SkPaint& paint) { |
207 APPEND(DrawDRRect, outer, inner, delay_copy(paint)); | 215 APPEND(DrawDRRect, outer, inner, delay_copy(paint)); |
208 } | 216 } |
209 | 217 |
210 void SkRecorder::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { | 218 void SkRecorder::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { |
211 APPEND(ClipRect, rect, op, edgeStyle == kSoft_ClipEdgeStyle); | 219 APPEND(ClipRect, rect, op, edgeStyle == kSoft_ClipEdgeStyle); |
212 } | 220 } |
213 | 221 |
214 void SkRecorder::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl
e edgeStyle) { | 222 void SkRecorder::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl
e edgeStyle) { |
215 APPEND(ClipRRect, rrect, op, edgeStyle == kSoft_ClipEdgeStyle); | 223 APPEND(ClipRRect, rrect, op, edgeStyle == kSoft_ClipEdgeStyle); |
216 } | 224 } |
217 | 225 |
218 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { | 226 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { |
219 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); | 227 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); |
220 } | 228 } |
221 | 229 |
222 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 230 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
223 APPEND(ClipRegion, delay_copy(deviceRgn), op); | 231 APPEND(ClipRegion, delay_copy(deviceRgn), op); |
224 } | 232 } |
OLD | NEW |