OLD | NEW |
| 1 /* |
| 2 * Copyright 2014 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
1 #include "SkRecorder.h" | 8 #include "SkRecorder.h" |
2 #include "SkPicture.h" | 9 #include "SkPicture.h" |
3 | 10 |
4 // SkCanvas will fail in mysterious ways if it doesn't know the real width and h
eight. | 11 // SkCanvas will fail in mysterious ways if it doesn't know the real width and h
eight. |
5 SkRecorder::SkRecorder(SkRecorder::Mode mode, SkRecord* record, int width, int h
eight) | 12 SkRecorder::SkRecorder(SkRecorder::Mode mode, SkRecord* record, int width, int h
eight) |
6 : SkCanvas(width, height), fMode(mode), fRecord(record) {} | 13 : SkCanvas(width, height), fMode(mode), fRecord(record) {} |
7 | 14 |
8 // To make appending to fRecord a little less verbose. | 15 // To make appending to fRecord a little less verbose. |
9 #define APPEND(T, ...) \ | 16 #define APPEND(T, ...) \ |
10 SkNEW_PLACEMENT_ARGS(fRecord->append<SkRecords::T>(), SkRecords::T, (__V
A_ARGS__)) | 17 SkNEW_PLACEMENT_ARGS(fRecord->append<SkRecords::T>(), SkRecords::T, (__V
A_ARGS__)) |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 242 |
236 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { | 243 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { |
237 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); | 244 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); |
238 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is
InverseFillType()); | 245 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is
InverseFillType()); |
239 } | 246 } |
240 | 247 |
241 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 248 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
242 APPEND(ClipRegion, delay_copy(deviceRgn), op); | 249 APPEND(ClipRegion, delay_copy(deviceRgn), op); |
243 INHERITED(onClipRegion, deviceRgn, op); | 250 INHERITED(onClipRegion, deviceRgn, op); |
244 } | 251 } |
OLD | NEW |