blob: 45283f81185f911f89ebd3320642066b13930e95 [file] [log] [blame]
commit-bot@chromium.orgc4b21e62014-04-11 18:33:31 +00001/*
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
mtklein9db912c2015-05-19 11:11:26 -07008#include "SkBigPicture.h"
dandovb3c9d1c2014-08-12 08:34:29 -07009#include "SkPatchUtils.h"
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +000010#include "SkPicture.h"
mtklein98b84852015-04-21 15:23:59 -070011#include "SkPictureUtils.h"
12#include "SkRecorder.h"
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +000013
reed3cb38402015-02-06 08:36:15 -080014SkDrawableList::~SkDrawableList() {
reed1bdfd3f2014-11-24 14:41:51 -080015 fArray.unrefAll();
16}
17
mtklein9db912c2015-05-19 11:11:26 -070018SkBigPicture::SnapshotArray* SkDrawableList::newDrawableSnapshot() {
reed1bdfd3f2014-11-24 14:41:51 -080019 const int count = fArray.count();
20 if (0 == count) {
21 return NULL;
22 }
23 SkAutoTMalloc<const SkPicture*> pics(count);
24 for (int i = 0; i < count; ++i) {
25 pics[i] = fArray[i]->newPictureSnapshot();
26 }
mtklein9db912c2015-05-19 11:11:26 -070027 return SkNEW_ARGS(SkBigPicture::SnapshotArray, (pics.detach(), count));
reed1bdfd3f2014-11-24 14:41:51 -080028}
29
reed3cb38402015-02-06 08:36:15 -080030void SkDrawableList::append(SkDrawable* drawable) {
reed1bdfd3f2014-11-24 14:41:51 -080031 *fArray.append() = SkRef(drawable);
32}
33
34///////////////////////////////////////////////////////////////////////////////////////////////
35
mtklein9db912c2015-05-19 11:11:26 -070036SkRecorder::SkRecorder(SkRecord* record, int width, int height, SkMiniRecorder* mr)
reed78e27682014-11-19 08:04:34 -080037 : SkCanvas(SkIRect::MakeWH(width, height), SkCanvas::kConservativeRasterClip_InitFlag)
mtklein98b84852015-04-21 15:23:59 -070038 , fApproxBytesUsedBySubPictures(0)
mtklein9db912c2015-05-19 11:11:26 -070039 , fRecord(record)
40 , fMiniRecorder(mr) {}
reed78e27682014-11-19 08:04:34 -080041
mtklein9db912c2015-05-19 11:11:26 -070042SkRecorder::SkRecorder(SkRecord* record, const SkRect& bounds, SkMiniRecorder* mr)
reed78e27682014-11-19 08:04:34 -080043 : SkCanvas(bounds.roundOut(), SkCanvas::kConservativeRasterClip_InitFlag)
mtklein98b84852015-04-21 15:23:59 -070044 , fApproxBytesUsedBySubPictures(0)
mtklein9db912c2015-05-19 11:11:26 -070045 , fRecord(record)
46 , fMiniRecorder(mr) {}
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +000047
mtklein9db912c2015-05-19 11:11:26 -070048void SkRecorder::reset(SkRecord* record, const SkRect& bounds, SkMiniRecorder* mr) {
mtkleinfeaadee2015-04-08 11:25:48 -070049 this->forgetRecord();
50 fRecord = record;
51 this->resetForNextPicture(bounds.roundOut());
mtklein9db912c2015-05-19 11:11:26 -070052 fMiniRecorder = mr;
mtkleinfeaadee2015-04-08 11:25:48 -070053}
54
commit-bot@chromium.org732bd662014-04-24 15:22:55 +000055void SkRecorder::forgetRecord() {
reed1bdfd3f2014-11-24 14:41:51 -080056 fDrawableList.reset(NULL);
mtklein98b84852015-04-21 15:23:59 -070057 fApproxBytesUsedBySubPictures = 0;
commit-bot@chromium.org732bd662014-04-24 15:22:55 +000058 fRecord = NULL;
59}
60
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +000061// To make appending to fRecord a little less verbose.
mtklein9db912c2015-05-19 11:11:26 -070062#define APPEND(T, ...) \
63 if (fMiniRecorder) { this->flushMiniRecorder(); } \
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +000064 SkNEW_PLACEMENT_ARGS(fRecord->append<SkRecords::T>(), SkRecords::T, (__VA_ARGS__))
65
mtklein9db912c2015-05-19 11:11:26 -070066#define TRY_MINIRECORDER(method, ...) \
67 if (fMiniRecorder && fMiniRecorder->method(__VA_ARGS__)) { return; }
68
commit-bot@chromium.orga0950412014-05-29 16:52:40 +000069// For methods which must call back into SkCanvas.
70#define INHERITED(method, ...) this->SkCanvas::method(__VA_ARGS__)
commit-bot@chromium.orgd9ce2be2014-04-09 23:30:28 +000071
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +000072// The structs we're creating all copy their constructor arguments. Given the way the SkRecords
73// framework works, sometimes they happen to technically be copied twice, which is fine and elided
74// into a single copy unless the class has a non-trivial copy constructor. For classes with
75// non-trivial copy constructors, we skip the first copy (and its destruction) by wrapping the value
76// with delay_copy(), forcing the argument to be passed by const&.
77//
78// This is used below for SkBitmap, SkPaint, SkPath, and SkRegion, which all have non-trivial copy
79// constructors and destructors. You'll know you've got a good candidate T if you see ~T() show up
80// unexpectedly on a profile of record time. Otherwise don't bother.
81template <typename T>
82class Reference {
83public:
84 Reference(const T& x) : fX(x) {}
85 operator const T&() const { return fX; }
86private:
87 const T& fX;
88};
89
90template <typename T>
91static Reference<T> delay_copy(const T& x) { return Reference<T>(x); }
92
93// Use copy() only for optional arguments, to be copied if present or skipped if not.
94// (For most types we just pass by value and let copy constructors do their thing.)
95template <typename T>
96T* SkRecorder::copy(const T* src) {
97 if (NULL == src) {
98 return NULL;
99 }
100 return SkNEW_PLACEMENT_ARGS(fRecord->alloc<T>(), T, (*src));
101}
102
103// This copy() is for arrays.
104// It will work with POD or non-POD, though currently we only use it for POD.
105template <typename T>
reed2347b622014-08-07 12:19:50 -0700106T* SkRecorder::copy(const T src[], size_t count) {
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000107 if (NULL == src) {
108 return NULL;
109 }
110 T* dst = fRecord->alloc<T>(count);
reed2347b622014-08-07 12:19:50 -0700111 for (size_t i = 0; i < count; i++) {
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000112 SkNEW_PLACEMENT_ARGS(dst + i, T, (src[i]));
113 }
114 return dst;
115}
116
117// Specialization for copying strings, using memcpy.
118// This measured around 2x faster for copying code points,
119// but I found no corresponding speedup for other arrays.
120template <>
reed2347b622014-08-07 12:19:50 -0700121char* SkRecorder::copy(const char src[], size_t count) {
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000122 if (NULL == src) {
123 return NULL;
124 }
125 char* dst = fRecord->alloc<char>(count);
126 memcpy(dst, src, count);
127 return dst;
128}
129
mtklein5f0e8222014-08-22 11:44:26 -0700130// As above, assuming and copying a terminating \0.
131template <>
132char* SkRecorder::copy(const char* src) {
133 return this->copy(src, strlen(src)+1);
134}
135
mtklein9db912c2015-05-19 11:11:26 -0700136void SkRecorder::flushMiniRecorder() {
137 if (fMiniRecorder) {
138 SkMiniRecorder* mr = fMiniRecorder;
139 fMiniRecorder = nullptr; // Needs to happen before p->playback(this) or we loop forever.
140 // TODO: this can probably be done more efficiently by SkMiniRecorder if it matters.
141 SkAutoTUnref<SkPicture> p(mr->detachAsPicture(SkRect::MakeEmpty()));
142 p->playback(this);
143 }
144}
mtklein5f0e8222014-08-22 11:44:26 -0700145
reed41af9662015-01-05 07:49:08 -0800146void SkRecorder::onDrawPaint(const SkPaint& paint) {
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000147 APPEND(DrawPaint, delay_copy(paint));
148}
149
reed41af9662015-01-05 07:49:08 -0800150void SkRecorder::onDrawPoints(PointMode mode,
151 size_t count,
152 const SkPoint pts[],
153 const SkPaint& paint) {
mtklein42ddcd42014-11-21 08:48:35 -0800154 APPEND(DrawPoints, delay_copy(paint), mode, SkToUInt(count), this->copy(pts, count));
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000155}
156
reed41af9662015-01-05 07:49:08 -0800157void SkRecorder::onDrawRect(const SkRect& rect, const SkPaint& paint) {
mtklein9db912c2015-05-19 11:11:26 -0700158 TRY_MINIRECORDER(drawRect, rect, paint);
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000159 APPEND(DrawRect, delay_copy(paint), rect);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000160}
161
reed41af9662015-01-05 07:49:08 -0800162void SkRecorder::onDrawOval(const SkRect& oval, const SkPaint& paint) {
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000163 APPEND(DrawOval, delay_copy(paint), oval);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000164}
165
reed41af9662015-01-05 07:49:08 -0800166void SkRecorder::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000167 APPEND(DrawRRect, delay_copy(paint), rrect);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000168}
169
commit-bot@chromium.orgd9ce2be2014-04-09 23:30:28 +0000170void SkRecorder::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) {
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000171 APPEND(DrawDRRect, delay_copy(paint), outer, inner);
commit-bot@chromium.orgd9ce2be2014-04-09 23:30:28 +0000172}
173
reed3cb38402015-02-06 08:36:15 -0800174void SkRecorder::onDrawDrawable(SkDrawable* drawable) {
reed1bdfd3f2014-11-24 14:41:51 -0800175 if (!fDrawableList) {
reed3cb38402015-02-06 08:36:15 -0800176 fDrawableList.reset(SkNEW(SkDrawableList));
reed1bdfd3f2014-11-24 14:41:51 -0800177 }
178 fDrawableList->append(drawable);
179 APPEND(DrawDrawable, drawable->getBounds(), fDrawableList->count() - 1);
reed6be2aa92014-11-18 11:08:05 -0800180}
181
reed41af9662015-01-05 07:49:08 -0800182void SkRecorder::onDrawPath(const SkPath& path, const SkPaint& paint) {
mtklein9db912c2015-05-19 11:11:26 -0700183 TRY_MINIRECORDER(drawPath, path, paint);
mtkleinaf579032014-12-01 11:03:37 -0800184 APPEND(DrawPath, delay_copy(paint), delay_copy(path));
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000185}
186
reed41af9662015-01-05 07:49:08 -0800187void SkRecorder::onDrawBitmap(const SkBitmap& bitmap,
188 SkScalar left,
189 SkScalar top,
190 const SkPaint* paint) {
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000191 APPEND(DrawBitmap, this->copy(paint), delay_copy(bitmap), left, top);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000192}
193
reed41af9662015-01-05 07:49:08 -0800194void SkRecorder::onDrawBitmapRect(const SkBitmap& bitmap,
195 const SkRect* src,
196 const SkRect& dst,
197 const SkPaint* paint,
198 DrawBitmapRectFlags flags) {
mtklein42ddcd42014-11-21 08:48:35 -0800199 if (kBleed_DrawBitmapRectFlag == flags) {
200 APPEND(DrawBitmapRectToRectBleed,
201 this->copy(paint), delay_copy(bitmap), this->copy(src), dst);
202 return;
203 }
204 SkASSERT(kNone_DrawBitmapRectFlag == flags);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000205 APPEND(DrawBitmapRectToRect,
mtklein42ddcd42014-11-21 08:48:35 -0800206 this->copy(paint), delay_copy(bitmap), this->copy(src), dst);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000207}
208
reed41af9662015-01-05 07:49:08 -0800209void SkRecorder::onDrawBitmapNine(const SkBitmap& bitmap,
210 const SkIRect& center,
211 const SkRect& dst,
212 const SkPaint* paint) {
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000213 APPEND(DrawBitmapNine, this->copy(paint), delay_copy(bitmap), center, dst);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000214}
215
reed41af9662015-01-05 07:49:08 -0800216void SkRecorder::onDrawImage(const SkImage* image, SkScalar left, SkScalar top,
217 const SkPaint* paint) {
piotaixr65151752014-10-16 11:58:39 -0700218 APPEND(DrawImage, this->copy(paint), image, left, top);
219}
220
reed41af9662015-01-05 07:49:08 -0800221void SkRecorder::onDrawImageRect(const SkImage* image, const SkRect* src,
222 const SkRect& dst,
223 const SkPaint* paint) {
piotaixr65151752014-10-16 11:58:39 -0700224 APPEND(DrawImageRect, this->copy(paint), image, this->copy(src), dst);
225}
226
reed41af9662015-01-05 07:49:08 -0800227void SkRecorder::onDrawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint) {
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000228 APPEND(DrawSprite, this->copy(paint), delay_copy(bitmap), left, top);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000229}
230
reed@google.come0d9ce82014-04-23 04:00:17 +0000231void SkRecorder::onDrawText(const void* text, size_t byteLength,
232 SkScalar x, SkScalar y, const SkPaint& paint) {
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000233 APPEND(DrawText,
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000234 delay_copy(paint), this->copy((const char*)text, byteLength), byteLength, x, y);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000235}
236
reed@google.come0d9ce82014-04-23 04:00:17 +0000237void SkRecorder::onDrawPosText(const void* text, size_t byteLength,
238 const SkPoint pos[], const SkPaint& paint) {
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000239 const unsigned points = paint.countText(text, byteLength);
240 APPEND(DrawPosText,
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000241 delay_copy(paint),
242 this->copy((const char*)text, byteLength),
243 byteLength,
244 this->copy(pos, points));
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000245}
246
reed@google.come0d9ce82014-04-23 04:00:17 +0000247void SkRecorder::onDrawPosTextH(const void* text, size_t byteLength,
248 const SkScalar xpos[], SkScalar constY, const SkPaint& paint) {
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000249 const unsigned points = paint.countText(text, byteLength);
250 APPEND(DrawPosTextH,
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000251 delay_copy(paint),
252 this->copy((const char*)text, byteLength),
mtklein42ddcd42014-11-21 08:48:35 -0800253 SkToUInt(byteLength),
254 constY,
255 this->copy(xpos, points));
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000256}
257
reed@google.come0d9ce82014-04-23 04:00:17 +0000258void SkRecorder::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
259 const SkMatrix* matrix, const SkPaint& paint) {
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000260 APPEND(DrawTextOnPath,
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000261 delay_copy(paint),
262 this->copy((const char*)text, byteLength),
263 byteLength,
mtkleinaf579032014-12-01 11:03:37 -0800264 delay_copy(path),
265 matrix ? *matrix : SkMatrix::I());
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000266}
267
fmalita00d5c2c2014-08-21 08:53:26 -0700268void SkRecorder::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
269 const SkPaint& paint) {
mtklein9db912c2015-05-19 11:11:26 -0700270 TRY_MINIRECORDER(drawTextBlob, blob, x, y, paint);
fmalita00d5c2c2014-08-21 08:53:26 -0700271 APPEND(DrawTextBlob, delay_copy(paint), blob, x, y);
272}
273
reedd5fa1a42014-08-09 11:08:05 -0700274void SkRecorder::onDrawPicture(const SkPicture* pic, const SkMatrix* matrix, const SkPaint* paint) {
mtklein98b84852015-04-21 15:23:59 -0700275 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pic);
mtkleinaf579032014-12-01 11:03:37 -0800276 APPEND(DrawPicture, this->copy(paint), pic, matrix ? *matrix : SkMatrix::I());
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000277}
278
reed41af9662015-01-05 07:49:08 -0800279void SkRecorder::onDrawVertices(VertexMode vmode,
280 int vertexCount, const SkPoint vertices[],
281 const SkPoint texs[], const SkColor colors[],
282 SkXfermode* xmode,
283 const uint16_t indices[], int indexCount, const SkPaint& paint) {
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000284 APPEND(DrawVertices, delay_copy(paint),
285 vmode,
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000286 vertexCount,
287 this->copy(vertices, vertexCount),
288 texs ? this->copy(texs, vertexCount) : NULL,
289 colors ? this->copy(colors, vertexCount) : NULL,
290 xmode,
291 this->copy(indices, indexCount),
commit-bot@chromium.org37f6e622014-05-07 22:59:38 +0000292 indexCount);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000293}
294
dandovb3c9d1c2014-08-12 08:34:29 -0700295void SkRecorder::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
296 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) {
297 APPEND(DrawPatch, delay_copy(paint),
298 cubics ? this->copy(cubics, SkPatchUtils::kNumCtrlPts) : NULL,
299 colors ? this->copy(colors, SkPatchUtils::kNumCorners) : NULL,
300 texCoords ? this->copy(texCoords, SkPatchUtils::kNumCorners) : NULL,
301 xmode);
dandov963137b2014-08-07 07:49:53 -0700302}
303
Florin Malita5f6102d2014-06-30 10:13:28 -0400304void SkRecorder::willSave() {
305 APPEND(Save);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000306}
307
308SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds,
309 const SkPaint* paint,
310 SkCanvas::SaveFlags flags) {
311 APPEND(SaveLayer, this->copy(bounds), this->copy(paint), flags);
312 return SkCanvas::kNoLayer_SaveLayerStrategy;
313}
314
mtklein6cfa73a2014-08-13 13:33:49 -0700315void SkRecorder::didRestore() {
mtkleina723b572014-08-15 11:49:49 -0700316 APPEND(Restore, this->devBounds(), this->getTotalMatrix());
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000317}
318
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000319void SkRecorder::didConcat(const SkMatrix& matrix) {
mtklein6332f1d2014-08-19 07:09:40 -0700320 this->didSetMatrix(this->getTotalMatrix());
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000321}
322
323void SkRecorder::didSetMatrix(const SkMatrix& matrix) {
mtklein46bc6212014-08-20 09:44:28 -0700324 SkDEVCODE(if (matrix != this->getTotalMatrix()) {
mtkleinec924b92014-08-20 09:22:28 -0700325 matrix.dump();
326 this->getTotalMatrix().dump();
327 SkASSERT(matrix == this->getTotalMatrix());
328 })
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000329 APPEND(SetMatrix, matrix);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000330}
331
332void SkRecorder::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
commit-bot@chromium.orgd9ce2be2014-04-09 23:30:28 +0000333 INHERITED(onClipRect, rect, op, edgeStyle);
mtkleincdeeb092014-11-20 09:14:28 -0800334 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle);
335 APPEND(ClipRect, this->devBounds(), rect, opAA);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000336}
337
338void SkRecorder::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
reedd9544982014-09-09 18:46:22 -0700339 INHERITED(onClipRRect, rrect, op, edgeStyle);
mtkleincdeeb092014-11-20 09:14:28 -0800340 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle);
341 APPEND(ClipRRect, this->devBounds(), rrect, opAA);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000342}
343
344void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
reedd9544982014-09-09 18:46:22 -0700345 INHERITED(onClipPath, path, op, edgeStyle);
mtkleincdeeb092014-11-20 09:14:28 -0800346 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle);
mtkleinaf579032014-12-01 11:03:37 -0800347 APPEND(ClipPath, this->devBounds(), delay_copy(path), opAA);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000348}
349
350void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
commit-bot@chromium.orgd9ce2be2014-04-09 23:30:28 +0000351 INHERITED(onClipRegion, deviceRgn, op);
mtkleina723b572014-08-15 11:49:49 -0700352 APPEND(ClipRegion, this->devBounds(), delay_copy(deviceRgn), op);
commit-bot@chromium.orge3ff5582014-04-01 16:24:06 +0000353}
mtklein5f0e8222014-08-22 11:44:26 -0700354
355void SkRecorder::beginCommentGroup(const char* description) {
356 APPEND(BeginCommentGroup, this->copy(description));
357}
358
359void SkRecorder::addComment(const char* key, const char* value) {
360 APPEND(AddComment, this->copy(key), this->copy(value));
361}
362
363void SkRecorder::endCommentGroup() {
364 APPEND(EndCommentGroup);
365}
mtklein29dfaa82014-09-04 14:12:44 -0700366