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 #include "SkBigPicture.h" | 8 #include "SkBigPicture.h" |
9 #include "SkCanvasPriv.h" | 9 #include "SkCanvasPriv.h" |
10 #include "SkPatchUtils.h" | 10 #include "SkPatchUtils.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 fDrawableList.reset(nullptr); | 63 fDrawableList.reset(nullptr); |
64 fApproxBytesUsedBySubPictures = 0; | 64 fApproxBytesUsedBySubPictures = 0; |
65 fRecord = nullptr; | 65 fRecord = nullptr; |
66 } | 66 } |
67 | 67 |
68 // To make appending to fRecord a little less verbose. | 68 // To make appending to fRecord a little less verbose. |
69 #define APPEND(T, ...) \ | 69 #define APPEND(T, ...) \ |
70 if (fMiniRecorder) { \ | 70 if (fMiniRecorder) { \ |
71 this->flushMiniRecorder(); \ | 71 this->flushMiniRecorder(); \ |
72 } \ | 72 } \ |
73 new (fRecord->append<SkRecords::T>()) SkRecords::T(__VA_ARGS__) | 73 new (fRecord->append<SkRecords::T>()) SkRecords::T{__VA_ARGS__} |
74 | 74 |
75 #define TRY_MINIRECORDER(method, ...) \ | 75 #define TRY_MINIRECORDER(method, ...) \ |
76 if (fMiniRecorder && fMiniRecorder->method(__VA_ARGS__)) { return; } | 76 if (fMiniRecorder && fMiniRecorder->method(__VA_ARGS__)) { return; } |
77 | 77 |
78 // For methods which must call back into SkCanvas. | 78 // For methods which must call back into SkCanvas. |
79 #define INHERITED(method, ...) this->SkCanvas::method(__VA_ARGS__) | 79 #define INHERITED(method, ...) this->SkCanvas::method(__VA_ARGS__) |
80 | 80 |
81 // Use copy() only for optional arguments, to be copied if present or skipped if
not. | 81 // Use copy() only for optional arguments, to be copied if present or skipped if
not. |
82 // (For most types we just pass by value and let copy constructors do their thin
g.) | 82 // (For most types we just pass by value and let copy constructors do their thin
g.) |
83 template <typename T> | 83 template <typename T> |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 INHERITED(onClipPath, path, op, edgeStyle); | 375 INHERITED(onClipPath, path, op, edgeStyle); |
376 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle); | 376 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle); |
377 APPEND(ClipPath, this->devBounds(), path, opAA); | 377 APPEND(ClipPath, this->devBounds(), path, opAA); |
378 } | 378 } |
379 | 379 |
380 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 380 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
381 INHERITED(onClipRegion, deviceRgn, op); | 381 INHERITED(onClipRegion, deviceRgn, op); |
382 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); | 382 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); |
383 } | 383 } |
384 | 384 |
OLD | NEW |