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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) { | 198 void SkRecorder::onPushCull(const SkRect& rect) { |
199 APPEND(PushCull, rect); | 199 APPEND(PushCull, rect, SkRecords::kUnsetPopOffset); |
200 } | 200 } |
201 | 201 |
202 void SkRecorder::onPopCull() { | 202 void SkRecorder::onPopCull() { |
203 APPEND(PopCull); | 203 APPEND(PopCull); |
204 } | 204 } |
205 | 205 |
206 void SkRecorder::didConcat(const SkMatrix& matrix) { | 206 void SkRecorder::didConcat(const SkMatrix& matrix) { |
207 APPEND(Concat, matrix); | 207 APPEND(Concat, matrix); |
208 } | 208 } |
209 | 209 |
(...skipping 13 matching lines...) Expand all Loading... |
223 APPEND(ClipRRect, rrect, op, edgeStyle == kSoft_ClipEdgeStyle); | 223 APPEND(ClipRRect, rrect, op, edgeStyle == kSoft_ClipEdgeStyle); |
224 } | 224 } |
225 | 225 |
226 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) { |
227 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); | 227 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); |
228 } | 228 } |
229 | 229 |
230 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 230 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
231 APPEND(ClipRegion, delay_copy(deviceRgn), op); | 231 APPEND(ClipRegion, delay_copy(deviceRgn), op); |
232 } | 232 } |
OLD | NEW |