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 static const unsigned kImpossiblePopOffset = 0; |
200 APPEND(PushCull, rect, kImpossiblePopOffset); | |
f(malita)
2014/04/08 23:08:31
If using a constant here, maybe we should promote
mtklein
2014/04/08 23:11:56
Done.
| |
200 } | 201 } |
201 | 202 |
202 void SkRecorder::onPopCull() { | 203 void SkRecorder::onPopCull() { |
203 APPEND(PopCull); | 204 APPEND(PopCull); |
204 } | 205 } |
205 | 206 |
206 void SkRecorder::didConcat(const SkMatrix& matrix) { | 207 void SkRecorder::didConcat(const SkMatrix& matrix) { |
207 APPEND(Concat, matrix); | 208 APPEND(Concat, matrix); |
208 } | 209 } |
209 | 210 |
(...skipping 13 matching lines...) Expand all Loading... | |
223 APPEND(ClipRRect, rrect, op, edgeStyle == kSoft_ClipEdgeStyle); | 224 APPEND(ClipRRect, rrect, op, edgeStyle == kSoft_ClipEdgeStyle); |
224 } | 225 } |
225 | 226 |
226 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) { | 227 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) { |
227 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); | 228 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); |
228 } | 229 } |
229 | 230 |
230 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 231 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
231 APPEND(ClipRegion, delay_copy(deviceRgn), op); | 232 APPEND(ClipRegion, delay_copy(deviceRgn), op); |
232 } | 233 } |
OLD | NEW |