commit-bot@chromium.org | c4b21e6 | 2014-04-11 18:33:31 +0000 | [diff] [blame] | 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 | |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 8 | #include "SkRecorder.h" |
dandov | b3c9d1c | 2014-08-12 08:34:29 -0700 | [diff] [blame] | 9 | #include "SkPatchUtils.h" |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 10 | #include "SkPicture.h" |
| 11 | |
| 12 | // SkCanvas will fail in mysterious ways if it doesn't know the real width and height. |
commit-bot@chromium.org | a095041 | 2014-05-29 16:52:40 +0000 | [diff] [blame] | 13 | SkRecorder::SkRecorder(SkRecord* record, int width, int height) |
| 14 | : SkCanvas(width, height), fRecord(record) {} |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 15 | |
commit-bot@chromium.org | 732bd66 | 2014-04-24 15:22:55 +0000 | [diff] [blame] | 16 | void SkRecorder::forgetRecord() { |
| 17 | fRecord = NULL; |
| 18 | } |
| 19 | |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 20 | // To make appending to fRecord a little less verbose. |
| 21 | #define APPEND(T, ...) \ |
| 22 | SkNEW_PLACEMENT_ARGS(fRecord->append<SkRecords::T>(), SkRecords::T, (__VA_ARGS__)) |
| 23 | |
commit-bot@chromium.org | a095041 | 2014-05-29 16:52:40 +0000 | [diff] [blame] | 24 | // For methods which must call back into SkCanvas. |
| 25 | #define INHERITED(method, ...) this->SkCanvas::method(__VA_ARGS__) |
commit-bot@chromium.org | d9ce2be | 2014-04-09 23:30:28 +0000 | [diff] [blame] | 26 | |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 27 | // The structs we're creating all copy their constructor arguments. Given the way the SkRecords |
| 28 | // framework works, sometimes they happen to technically be copied twice, which is fine and elided |
| 29 | // into a single copy unless the class has a non-trivial copy constructor. For classes with |
| 30 | // non-trivial copy constructors, we skip the first copy (and its destruction) by wrapping the value |
| 31 | // with delay_copy(), forcing the argument to be passed by const&. |
| 32 | // |
| 33 | // This is used below for SkBitmap, SkPaint, SkPath, and SkRegion, which all have non-trivial copy |
| 34 | // constructors and destructors. You'll know you've got a good candidate T if you see ~T() show up |
| 35 | // unexpectedly on a profile of record time. Otherwise don't bother. |
| 36 | template <typename T> |
| 37 | class Reference { |
| 38 | public: |
| 39 | Reference(const T& x) : fX(x) {} |
| 40 | operator const T&() const { return fX; } |
| 41 | private: |
| 42 | const T& fX; |
| 43 | }; |
| 44 | |
| 45 | template <typename T> |
| 46 | static Reference<T> delay_copy(const T& x) { return Reference<T>(x); } |
| 47 | |
| 48 | // Use copy() only for optional arguments, to be copied if present or skipped if not. |
| 49 | // (For most types we just pass by value and let copy constructors do their thing.) |
| 50 | template <typename T> |
| 51 | T* SkRecorder::copy(const T* src) { |
| 52 | if (NULL == src) { |
| 53 | return NULL; |
| 54 | } |
| 55 | return SkNEW_PLACEMENT_ARGS(fRecord->alloc<T>(), T, (*src)); |
| 56 | } |
| 57 | |
| 58 | // This copy() is for arrays. |
| 59 | // It will work with POD or non-POD, though currently we only use it for POD. |
| 60 | template <typename T> |
reed | 2347b62 | 2014-08-07 12:19:50 -0700 | [diff] [blame] | 61 | T* SkRecorder::copy(const T src[], size_t count) { |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 62 | if (NULL == src) { |
| 63 | return NULL; |
| 64 | } |
| 65 | T* dst = fRecord->alloc<T>(count); |
reed | 2347b62 | 2014-08-07 12:19:50 -0700 | [diff] [blame] | 66 | for (size_t i = 0; i < count; i++) { |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 67 | SkNEW_PLACEMENT_ARGS(dst + i, T, (src[i])); |
| 68 | } |
| 69 | return dst; |
| 70 | } |
| 71 | |
| 72 | // Specialization for copying strings, using memcpy. |
| 73 | // This measured around 2x faster for copying code points, |
| 74 | // but I found no corresponding speedup for other arrays. |
| 75 | template <> |
reed | 2347b62 | 2014-08-07 12:19:50 -0700 | [diff] [blame] | 76 | char* SkRecorder::copy(const char src[], size_t count) { |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 77 | if (NULL == src) { |
| 78 | return NULL; |
| 79 | } |
| 80 | char* dst = fRecord->alloc<char>(count); |
| 81 | memcpy(dst, src, count); |
| 82 | return dst; |
| 83 | } |
| 84 | |
mtklein | 5f0e822 | 2014-08-22 11:44:26 -0700 | [diff] [blame^] | 85 | // As above, assuming and copying a terminating \0. |
| 86 | template <> |
| 87 | char* SkRecorder::copy(const char* src) { |
| 88 | return this->copy(src, strlen(src)+1); |
| 89 | } |
| 90 | |
| 91 | |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 92 | void SkRecorder::clear(SkColor color) { |
| 93 | APPEND(Clear, color); |
| 94 | } |
| 95 | |
| 96 | void SkRecorder::drawPaint(const SkPaint& paint) { |
| 97 | APPEND(DrawPaint, delay_copy(paint)); |
| 98 | } |
| 99 | |
| 100 | void SkRecorder::drawPoints(PointMode mode, |
| 101 | size_t count, |
| 102 | const SkPoint pts[], |
| 103 | const SkPaint& paint) { |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 104 | APPEND(DrawPoints, delay_copy(paint), mode, count, this->copy(pts, count)); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | void SkRecorder::drawRect(const SkRect& rect, const SkPaint& paint) { |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 108 | APPEND(DrawRect, delay_copy(paint), rect); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | void SkRecorder::drawOval(const SkRect& oval, const SkPaint& paint) { |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 112 | APPEND(DrawOval, delay_copy(paint), oval); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | void SkRecorder::drawRRect(const SkRRect& rrect, const SkPaint& paint) { |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 116 | APPEND(DrawRRect, delay_copy(paint), rrect); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 117 | } |
| 118 | |
commit-bot@chromium.org | d9ce2be | 2014-04-09 23:30:28 +0000 | [diff] [blame] | 119 | void SkRecorder::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) { |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 120 | APPEND(DrawDRRect, delay_copy(paint), outer, inner); |
commit-bot@chromium.org | d9ce2be | 2014-04-09 23:30:28 +0000 | [diff] [blame] | 121 | } |
| 122 | |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 123 | void SkRecorder::drawPath(const SkPath& path, const SkPaint& paint) { |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 124 | APPEND(DrawPath, delay_copy(paint), delay_copy(path)); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | void SkRecorder::drawBitmap(const SkBitmap& bitmap, |
| 128 | SkScalar left, |
| 129 | SkScalar top, |
| 130 | const SkPaint* paint) { |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 131 | APPEND(DrawBitmap, this->copy(paint), delay_copy(bitmap), left, top); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | void SkRecorder::drawBitmapRectToRect(const SkBitmap& bitmap, |
| 135 | const SkRect* src, |
| 136 | const SkRect& dst, |
| 137 | const SkPaint* paint, |
| 138 | DrawBitmapRectFlags flags) { |
| 139 | APPEND(DrawBitmapRectToRect, |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 140 | this->copy(paint), delay_copy(bitmap), this->copy(src), dst, flags); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | void SkRecorder::drawBitmapMatrix(const SkBitmap& bitmap, |
| 144 | const SkMatrix& matrix, |
| 145 | const SkPaint* paint) { |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 146 | APPEND(DrawBitmapMatrix, this->copy(paint), delay_copy(bitmap), matrix); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | void SkRecorder::drawBitmapNine(const SkBitmap& bitmap, |
| 150 | const SkIRect& center, |
| 151 | const SkRect& dst, |
| 152 | const SkPaint* paint) { |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 153 | APPEND(DrawBitmapNine, this->copy(paint), delay_copy(bitmap), center, dst); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | void SkRecorder::drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint) { |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 157 | APPEND(DrawSprite, this->copy(paint), delay_copy(bitmap), left, top); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 158 | } |
| 159 | |
reed@google.com | e0d9ce8 | 2014-04-23 04:00:17 +0000 | [diff] [blame] | 160 | void SkRecorder::onDrawText(const void* text, size_t byteLength, |
| 161 | SkScalar x, SkScalar y, const SkPaint& paint) { |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 162 | APPEND(DrawText, |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 163 | delay_copy(paint), this->copy((const char*)text, byteLength), byteLength, x, y); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 164 | } |
| 165 | |
reed@google.com | e0d9ce8 | 2014-04-23 04:00:17 +0000 | [diff] [blame] | 166 | void SkRecorder::onDrawPosText(const void* text, size_t byteLength, |
| 167 | const SkPoint pos[], const SkPaint& paint) { |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 168 | const unsigned points = paint.countText(text, byteLength); |
| 169 | APPEND(DrawPosText, |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 170 | delay_copy(paint), |
| 171 | this->copy((const char*)text, byteLength), |
| 172 | byteLength, |
| 173 | this->copy(pos, points)); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 174 | } |
| 175 | |
reed@google.com | e0d9ce8 | 2014-04-23 04:00:17 +0000 | [diff] [blame] | 176 | void SkRecorder::onDrawPosTextH(const void* text, size_t byteLength, |
| 177 | const SkScalar xpos[], SkScalar constY, const SkPaint& paint) { |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 178 | const unsigned points = paint.countText(text, byteLength); |
| 179 | APPEND(DrawPosTextH, |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 180 | delay_copy(paint), |
| 181 | this->copy((const char*)text, byteLength), |
| 182 | byteLength, |
| 183 | this->copy(xpos, points), |
| 184 | constY); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 185 | } |
| 186 | |
reed@google.com | e0d9ce8 | 2014-04-23 04:00:17 +0000 | [diff] [blame] | 187 | void SkRecorder::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path, |
| 188 | const SkMatrix* matrix, const SkPaint& paint) { |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 189 | APPEND(DrawTextOnPath, |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 190 | delay_copy(paint), |
| 191 | this->copy((const char*)text, byteLength), |
| 192 | byteLength, |
| 193 | delay_copy(path), |
| 194 | this->copy(matrix)); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 195 | } |
| 196 | |
fmalita | 00d5c2c | 2014-08-21 08:53:26 -0700 | [diff] [blame] | 197 | void SkRecorder::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
| 198 | const SkPaint& paint) { |
| 199 | APPEND(DrawTextBlob, delay_copy(paint), blob, x, y); |
| 200 | } |
| 201 | |
reed | d5fa1a4 | 2014-08-09 11:08:05 -0700 | [diff] [blame] | 202 | void SkRecorder::onDrawPicture(const SkPicture* pic, const SkMatrix* matrix, const SkPaint* paint) { |
| 203 | APPEND(DrawPicture, this->copy(paint), pic, this->copy(matrix)); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | void SkRecorder::drawVertices(VertexMode vmode, |
| 207 | int vertexCount, const SkPoint vertices[], |
| 208 | const SkPoint texs[], const SkColor colors[], |
| 209 | SkXfermode* xmode, |
| 210 | const uint16_t indices[], int indexCount, const SkPaint& paint) { |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 211 | APPEND(DrawVertices, delay_copy(paint), |
| 212 | vmode, |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 213 | vertexCount, |
| 214 | this->copy(vertices, vertexCount), |
| 215 | texs ? this->copy(texs, vertexCount) : NULL, |
| 216 | colors ? this->copy(colors, vertexCount) : NULL, |
| 217 | xmode, |
| 218 | this->copy(indices, indexCount), |
commit-bot@chromium.org | 37f6e62 | 2014-05-07 22:59:38 +0000 | [diff] [blame] | 219 | indexCount); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 220 | } |
| 221 | |
dandov | b3c9d1c | 2014-08-12 08:34:29 -0700 | [diff] [blame] | 222 | void SkRecorder::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
| 223 | const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) { |
| 224 | APPEND(DrawPatch, delay_copy(paint), |
| 225 | cubics ? this->copy(cubics, SkPatchUtils::kNumCtrlPts) : NULL, |
| 226 | colors ? this->copy(colors, SkPatchUtils::kNumCorners) : NULL, |
| 227 | texCoords ? this->copy(texCoords, SkPatchUtils::kNumCorners) : NULL, |
| 228 | xmode); |
dandov | 963137b | 2014-08-07 07:49:53 -0700 | [diff] [blame] | 229 | } |
| 230 | |
Florin Malita | 5f6102d | 2014-06-30 10:13:28 -0400 | [diff] [blame] | 231 | void SkRecorder::willSave() { |
| 232 | APPEND(Save); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds, |
| 236 | const SkPaint* paint, |
| 237 | SkCanvas::SaveFlags flags) { |
| 238 | APPEND(SaveLayer, this->copy(bounds), this->copy(paint), flags); |
| 239 | return SkCanvas::kNoLayer_SaveLayerStrategy; |
| 240 | } |
| 241 | |
mtklein | 6cfa73a | 2014-08-13 13:33:49 -0700 | [diff] [blame] | 242 | void SkRecorder::didRestore() { |
mtklein | a723b57 | 2014-08-15 11:49:49 -0700 | [diff] [blame] | 243 | APPEND(Restore, this->devBounds(), this->getTotalMatrix()); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 244 | } |
| 245 | |
commit-bot@chromium.org | 03a99b8 | 2014-04-08 15:17:17 +0000 | [diff] [blame] | 246 | void SkRecorder::onPushCull(const SkRect& rect) { |
commit-bot@chromium.org | 88c3e27 | 2014-04-22 16:57:20 +0000 | [diff] [blame] | 247 | APPEND(PushCull, rect); |
commit-bot@chromium.org | 03a99b8 | 2014-04-08 15:17:17 +0000 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | void SkRecorder::onPopCull() { |
| 251 | APPEND(PopCull); |
| 252 | } |
| 253 | |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 254 | void SkRecorder::didConcat(const SkMatrix& matrix) { |
mtklein | 6332f1d | 2014-08-19 07:09:40 -0700 | [diff] [blame] | 255 | this->didSetMatrix(this->getTotalMatrix()); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 256 | } |
| 257 | |
| 258 | void SkRecorder::didSetMatrix(const SkMatrix& matrix) { |
mtklein | 46bc621 | 2014-08-20 09:44:28 -0700 | [diff] [blame] | 259 | SkDEVCODE(if (matrix != this->getTotalMatrix()) { |
mtklein | ec924b9 | 2014-08-20 09:22:28 -0700 | [diff] [blame] | 260 | matrix.dump(); |
| 261 | this->getTotalMatrix().dump(); |
| 262 | SkASSERT(matrix == this->getTotalMatrix()); |
| 263 | }) |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 264 | APPEND(SetMatrix, matrix); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | void SkRecorder::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle) { |
commit-bot@chromium.org | d9ce2be | 2014-04-09 23:30:28 +0000 | [diff] [blame] | 268 | INHERITED(onClipRect, rect, op, edgeStyle); |
mtklein | a723b57 | 2014-08-15 11:49:49 -0700 | [diff] [blame] | 269 | APPEND(ClipRect, this->devBounds(), rect, op, edgeStyle == kSoft_ClipEdgeStyle); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 270 | } |
| 271 | |
| 272 | void SkRecorder::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle) { |
commit-bot@chromium.org | d9ce2be | 2014-04-09 23:30:28 +0000 | [diff] [blame] | 273 | INHERITED(updateClipConservativelyUsingBounds, rrect.getBounds(), op, false); |
mtklein | a723b57 | 2014-08-15 11:49:49 -0700 | [diff] [blame] | 274 | APPEND(ClipRRect, this->devBounds(), rrect, op, edgeStyle == kSoft_ClipEdgeStyle); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) { |
commit-bot@chromium.org | d9ce2be | 2014-04-09 23:30:28 +0000 | [diff] [blame] | 278 | INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.isInverseFillType()); |
mtklein | a723b57 | 2014-08-15 11:49:49 -0700 | [diff] [blame] | 279 | APPEND(ClipPath, this->devBounds(), delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 280 | } |
| 281 | |
| 282 | void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
commit-bot@chromium.org | d9ce2be | 2014-04-09 23:30:28 +0000 | [diff] [blame] | 283 | INHERITED(onClipRegion, deviceRgn, op); |
mtklein | a723b57 | 2014-08-15 11:49:49 -0700 | [diff] [blame] | 284 | APPEND(ClipRegion, this->devBounds(), delay_copy(deviceRgn), op); |
commit-bot@chromium.org | e3ff558 | 2014-04-01 16:24:06 +0000 | [diff] [blame] | 285 | } |
mtklein | 5f0e822 | 2014-08-22 11:44:26 -0700 | [diff] [blame^] | 286 | |
| 287 | void SkRecorder::beginCommentGroup(const char* description) { |
| 288 | APPEND(BeginCommentGroup, this->copy(description)); |
| 289 | } |
| 290 | |
| 291 | void SkRecorder::addComment(const char* key, const char* value) { |
| 292 | APPEND(AddComment, this->copy(key), this->copy(value)); |
| 293 | } |
| 294 | |
| 295 | void SkRecorder::endCommentGroup() { |
| 296 | APPEND(EndCommentGroup); |
| 297 | } |