blob: 74c92588d09458d42e132931717bbe87397188b6 [file] [log] [blame]
chudy@google.com902ebe52012-06-29 14:21:22 +00001
2/*
3 * Copyright 2012 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
chudy@google.com902ebe52012-06-29 14:21:22 +000010#include "SkDrawCommand.h"
11#include "SkObjectParser.h"
12
13// TODO(chudy): Refactor into non subclass model.
14
15SkDrawCommand::SkDrawCommand() {
16 fVisible = true;
17}
18
19SkDrawCommand::~SkDrawCommand() {
chudy@google.com97cee972012-08-07 20:41:37 +000020 fInfo.deleteAll();
chudy@google.com902ebe52012-06-29 14:21:22 +000021}
22
23const char* SkDrawCommand::GetCommandString(DrawType type) {
24 switch (type) {
25 case UNUSED: SkDEBUGFAIL("DrawType UNUSED\n"); break;
26 case DRAW_CLEAR: return "Clear";
27 case CLIP_PATH: return "Clip Path";
28 case CLIP_REGION: return "Clip Region";
29 case CLIP_RECT: return "Clip Rect";
30 case CONCAT: return "Concat";
31 case DRAW_BITMAP: return "Draw Bitmap";
32 case DRAW_BITMAP_MATRIX: return "Draw Bitmap Matrix";
33 case DRAW_BITMAP_NINE: return "Draw Bitmap Nine";
robertphillips@google.com84d320e2012-09-20 19:09:17 +000034 case DRAW_BITMAP_RECT_TO_RECT: return "Draw Bitmap Rect";
chudy@google.com902ebe52012-06-29 14:21:22 +000035 case DRAW_DATA: return "Draw Data";
36 case DRAW_PAINT: return "Draw Paint";
37 case DRAW_PATH: return "Draw Path";
38 case DRAW_PICTURE: return "Draw Picture";
39 case DRAW_POINTS: return "Draw Points";
40 case DRAW_POS_TEXT: return "Draw Pos Text";
41 case DRAW_POS_TEXT_H: return "Draw Pos Text H";
42 case DRAW_RECT: return "Draw Rect";
43 case DRAW_SPRITE: return "Draw Sprite";
44 case DRAW_TEXT: return "Draw Text";
45 case DRAW_TEXT_ON_PATH: return "Draw Text On Path";
46 case DRAW_VERTICES: return "Draw Vertices";
47 case RESTORE: return "Restore";
48 case ROTATE: return "Rotate";
49 case SAVE: return "Save";
50 case SAVE_LAYER: return "Save Layer";
51 case SCALE: return "Scale";
52 case SET_MATRIX: return "Set Matrix";
53 case SKEW: return "Skew";
54 case TRANSLATE: return "Translate";
55 default:
56 SkDebugf("DrawType error 0x%08x\n", type);
57 SkASSERT(0);
58 break;
59 }
60 SkDEBUGFAIL("DrawType UNUSED\n");
61 return NULL;
62}
63
chudy@google.com97cee972012-08-07 20:41:37 +000064SkString SkDrawCommand::toString() {
65 return SkString(GetCommandString(fDrawType));
chudy@google.com902ebe52012-06-29 14:21:22 +000066}
67
68Clear::Clear(SkColor color) {
69 this->fColor = color;
70 this->fDrawType = DRAW_CLEAR;
chudy@google.com97cee972012-08-07 20:41:37 +000071 this->fInfo.push(SkObjectParser::CustomTextToString("No Parameters"));
chudy@google.com902ebe52012-06-29 14:21:22 +000072}
73
74void Clear::execute(SkCanvas* canvas) {
75 canvas->clear(this->fColor);
76}
77
78ClipPath::ClipPath(const SkPath& path, SkRegion::Op op, bool doAA) {
79 this->fPath = &path;
80 this->fOp = op;
81 this->fDoAA = doAA;
82 this->fDrawType = CLIP_PATH;
83
chudy@google.com97cee972012-08-07 20:41:37 +000084 this->fInfo.push(SkObjectParser::PathToString(path));
85 this->fInfo.push(SkObjectParser::RegionOpToString(op));
86 this->fInfo.push(SkObjectParser::BoolToString(doAA));
chudy@google.com902ebe52012-06-29 14:21:22 +000087}
88
89void ClipPath::execute(SkCanvas* canvas) {
90 canvas->clipPath(*this->fPath, this->fOp, this->fDoAA);
91}
92
93ClipRegion::ClipRegion(const SkRegion& region, SkRegion::Op op) {
94 this->fRegion = &region;
95 this->fOp = op;
96 this->fDrawType = CLIP_REGION;
97
chudy@google.com97cee972012-08-07 20:41:37 +000098 this->fInfo.push(SkObjectParser::RegionToString(region));
99 this->fInfo.push(SkObjectParser::RegionOpToString(op));
chudy@google.com902ebe52012-06-29 14:21:22 +0000100}
101
102void ClipRegion::execute(SkCanvas* canvas) {
103 canvas->clipRegion(*this->fRegion, this->fOp);
104}
105
106ClipRect::ClipRect(const SkRect& rect, SkRegion::Op op, bool doAA) {
107 this->fRect = ▭
108 this->fOp = op;
109 this->fDoAA = doAA;
110 this->fDrawType = CLIP_RECT;
111
chudy@google.com97cee972012-08-07 20:41:37 +0000112 this->fInfo.push(SkObjectParser::RectToString(rect));
113 this->fInfo.push(SkObjectParser::RegionOpToString(op));
114 this->fInfo.push(SkObjectParser::BoolToString(doAA));
chudy@google.com902ebe52012-06-29 14:21:22 +0000115}
116
117void ClipRect::execute(SkCanvas* canvas) {
118 canvas->clipRect(*this->fRect, this->fOp, this->fDoAA);
119}
120
121Concat::Concat(const SkMatrix& matrix) {
122 this->fMatrix = &matrix;
123 this->fDrawType = CONCAT;
124
chudy@google.com97cee972012-08-07 20:41:37 +0000125 this->fInfo.push(SkObjectParser::MatrixToString(matrix));
chudy@google.com902ebe52012-06-29 14:21:22 +0000126}
127
128void Concat::execute(SkCanvas* canvas) {
129 canvas->concat(*this->fMatrix);
130}
131
132DrawBitmap::DrawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
133 const SkPaint* paint) {
134 this->fBitmap = &bitmap;
135 this->fLeft = left;
136 this->fTop = top;
137 this->fPaint = paint;
138 this->fDrawType = DRAW_BITMAP;
139
chudy@google.com97cee972012-08-07 20:41:37 +0000140 this->fInfo.push(SkObjectParser::BitmapToString(bitmap));
141 this->fInfo.push(SkObjectParser::ScalarToString(left, "SkScalar left: "));
142 this->fInfo.push(SkObjectParser::ScalarToString(top, "SkScalar top: "));
chudy@google.com902ebe52012-06-29 14:21:22 +0000143}
144
145void DrawBitmap::execute(SkCanvas* canvas) {
146 canvas->drawBitmap(*this->fBitmap, this->fLeft, this->fTop, this->fPaint);
147}
148
149DrawBitmapMatrix::DrawBitmapMatrix(const SkBitmap& bitmap,
150 const SkMatrix& matrix, const SkPaint* paint) {
151 this->fBitmap = &bitmap;
152 this->fMatrix = &matrix;
153 this->fPaint = paint;
154 this->fDrawType = DRAW_BITMAP_MATRIX;
155
chudy@google.com97cee972012-08-07 20:41:37 +0000156 this->fInfo.push(SkObjectParser::BitmapToString(bitmap));
157 this->fInfo.push(SkObjectParser::MatrixToString(matrix));
158 if (paint) this->fInfo.push(SkObjectParser::PaintToString(*paint));
chudy@google.com902ebe52012-06-29 14:21:22 +0000159}
160
161void DrawBitmapMatrix::execute(SkCanvas* canvas) {
162 canvas->drawBitmapMatrix(*this->fBitmap, *this->fMatrix, this->fPaint);
163}
164
165DrawBitmapNine::DrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
166 const SkRect& dst, const SkPaint* paint) {
167 this->fBitmap = &bitmap;
168 this->fCenter = &center;
169 this->fDst = &dst;
170 this->fPaint = paint;
171 this->fDrawType = DRAW_BITMAP_NINE;
172
chudy@google.com97cee972012-08-07 20:41:37 +0000173 this->fInfo.push(SkObjectParser::BitmapToString(bitmap));
174 this->fInfo.push(SkObjectParser::IRectToString(center));
robertphillips@google.com30d35f22012-11-06 16:45:36 +0000175 this->fInfo.push(SkObjectParser::RectToString(dst, "Dst: "));
chudy@google.com97cee972012-08-07 20:41:37 +0000176 if (paint) this->fInfo.push(SkObjectParser::PaintToString(*paint));
chudy@google.com902ebe52012-06-29 14:21:22 +0000177}
178
179void DrawBitmapNine::execute(SkCanvas* canvas) {
180 canvas->drawBitmapNine(*this->fBitmap, *this->fCenter, *this->fDst, this->fPaint);
181}
182
reed@google.com71121732012-09-18 15:14:33 +0000183DrawBitmapRect::DrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
chudy@google.com902ebe52012-06-29 14:21:22 +0000184 const SkRect& dst, const SkPaint* paint) {
185 this->fBitmap = &bitmap;
186 this->fSrc = src;
187 this->fDst = &dst;
188 this->fPaint = paint;
robertphillips@google.com84d320e2012-09-20 19:09:17 +0000189 this->fDrawType = DRAW_BITMAP_RECT_TO_RECT;
chudy@google.com902ebe52012-06-29 14:21:22 +0000190
chudy@google.com97cee972012-08-07 20:41:37 +0000191 this->fInfo.push(SkObjectParser::BitmapToString(bitmap));
robertphillips@google.com30d35f22012-11-06 16:45:36 +0000192 if (src) this->fInfo.push(SkObjectParser::RectToString(*src, "Src: "));
193 this->fInfo.push(SkObjectParser::RectToString(dst, "Dst: "));
chudy@google.com97cee972012-08-07 20:41:37 +0000194 if (paint) this->fInfo.push(SkObjectParser::PaintToString(*paint));
chudy@google.com902ebe52012-06-29 14:21:22 +0000195}
196
197void DrawBitmapRect::execute(SkCanvas* canvas) {
robertphillips@google.com84d320e2012-09-20 19:09:17 +0000198 canvas->drawBitmapRectToRect(*this->fBitmap, this->fSrc, *this->fDst, this->fPaint);
chudy@google.com902ebe52012-06-29 14:21:22 +0000199}
200
201DrawData::DrawData(const void* data, size_t length) {
202 this->fData = data;
203 this->fLength = length;
204 this->fDrawType = DRAW_DATA;
205 // TODO(chudy): See if we can't display data and length.
206}
207
208void DrawData::execute(SkCanvas* canvas) {
209 canvas->drawData(this->fData, this->fLength);
210}
211
212DrawPaint::DrawPaint(const SkPaint& paint) {
213 this->fPaint = &paint;
214 this->fDrawType = DRAW_PAINT;
215
chudy@google.com97cee972012-08-07 20:41:37 +0000216 this->fInfo.push(SkObjectParser::PaintToString(paint));
chudy@google.com902ebe52012-06-29 14:21:22 +0000217}
218
219void DrawPaint::execute(SkCanvas* canvas) {
220 canvas->drawPaint(*this->fPaint);
221}
222
223DrawPath::DrawPath(const SkPath& path, const SkPaint& paint) {
224 this->fPath = &path;
225 this->fPaint = &paint;
226 this->fDrawType = DRAW_PATH;
227
chudy@google.com97cee972012-08-07 20:41:37 +0000228 this->fInfo.push(SkObjectParser::PathToString(path));
229 this->fInfo.push(SkObjectParser::PaintToString(paint));
chudy@google.com902ebe52012-06-29 14:21:22 +0000230}
231
232void DrawPath::execute(SkCanvas* canvas) {
233 canvas->drawPath(*this->fPath, *this->fPaint);
234}
235
236DrawPicture::DrawPicture(SkPicture& picture) {
237 this->fPicture = &picture;
238 this->fDrawType = DRAW_PICTURE;
chudy@google.com97cee972012-08-07 20:41:37 +0000239 this->fInfo.push(SkObjectParser::CustomTextToString("To be implemented."));
chudy@google.com902ebe52012-06-29 14:21:22 +0000240}
241
242void DrawPicture::execute(SkCanvas* canvas) {
243 canvas->drawPicture(*this->fPicture);
244}
245
246DrawPoints::DrawPoints(SkCanvas::PointMode mode, size_t count,
247 const SkPoint pts[], const SkPaint& paint) {
248 this->fMode = mode;
249 this->fCount = count;
250 this->fPts = pts;
251 this->fPaint = &paint;
252 this->fDrawType = DRAW_POINTS;
253
chudy@google.com97cee972012-08-07 20:41:37 +0000254 this->fInfo.push(SkObjectParser::PointsToString(pts, count));
skia.committer@gmail.com04ba4482012-09-07 02:01:30 +0000255 this->fInfo.push(SkObjectParser::ScalarToString(SkIntToScalar(count),
robertphillips@google.com94acc702012-09-06 18:43:21 +0000256 "Points: "));
chudy@google.com97cee972012-08-07 20:41:37 +0000257 this->fInfo.push(SkObjectParser::PointModeToString(mode));
chudy@google.com902ebe52012-06-29 14:21:22 +0000258}
259
260void DrawPoints::execute(SkCanvas* canvas) {
261 canvas->drawPoints(this->fMode, this->fCount, this->fPts, *this->fPaint);
262}
263
264DrawPosText::DrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
265 const SkPaint& paint) {
266 this->fText = text;
267 this->fByteLength = byteLength;
268 this->fPos = pos;
269 this->fPaint = &paint;
270 this->fDrawType = DRAW_POS_TEXT;
271
chudy@google.com97cee972012-08-07 20:41:37 +0000272 this->fInfo.push(SkObjectParser::TextToString(text, byteLength));
chudy@google.com902ebe52012-06-29 14:21:22 +0000273 // TODO(chudy): Test that this works.
chudy@google.com97cee972012-08-07 20:41:37 +0000274 this->fInfo.push(SkObjectParser::PointsToString(pos, 1));
275 this->fInfo.push(SkObjectParser::PaintToString(paint));
chudy@google.com902ebe52012-06-29 14:21:22 +0000276}
277
278void DrawPosText::execute(SkCanvas* canvas) {
279 canvas->drawPosText(this->fText, this->fByteLength, this->fPos, *this->fPaint);
280}
281
282
283DrawPosTextH::DrawPosTextH(const void* text, size_t byteLength,
284 const SkScalar xpos[], SkScalar constY, const SkPaint& paint) {
285 this->fText = text;
286 this->fByteLength = byteLength;
287 this->fXpos = xpos;
288 this->fConstY = constY;
289 this->fPaint = &paint;
290 this->fDrawType = DRAW_POS_TEXT_H;
291
chudy@google.com97cee972012-08-07 20:41:37 +0000292 this->fInfo.push(SkObjectParser::TextToString(text, byteLength));
293 this->fInfo.push(SkObjectParser::ScalarToString(xpos[0], "XPOS: "));
294 this->fInfo.push(SkObjectParser::ScalarToString(constY, "SkScalar constY: "));
295 this->fInfo.push(SkObjectParser::PaintToString(paint));
chudy@google.com902ebe52012-06-29 14:21:22 +0000296}
297
298void DrawPosTextH::execute(SkCanvas* canvas) {
299 canvas->drawPosTextH(this->fText, this->fByteLength, this->fXpos, this->fConstY,
300 *this->fPaint);
301}
302
303DrawRectC::DrawRectC(const SkRect& rect, const SkPaint& paint) {
304 this->fRect = ▭
305 this->fPaint = &paint;
306 this->fDrawType = DRAW_RECT;
307
chudy@google.com97cee972012-08-07 20:41:37 +0000308 this->fInfo.push(SkObjectParser::RectToString(rect));
309 this->fInfo.push(SkObjectParser::PaintToString(paint));
chudy@google.com902ebe52012-06-29 14:21:22 +0000310}
311
312void DrawRectC::execute(SkCanvas* canvas) {
313 canvas->drawRect(*this->fRect, *this->fPaint);
314}
315
316DrawSprite::DrawSprite(const SkBitmap& bitmap, int left, int top,
317 const SkPaint* paint) {
318 this->fBitmap = &bitmap;
319 this->fLeft = left;
320 this->fTop = top;
321 this->fPaint = paint;
322 this->fDrawType = DRAW_SPRITE;
323
chudy@google.com97cee972012-08-07 20:41:37 +0000324 this->fInfo.push(SkObjectParser::BitmapToString(bitmap));
325 this->fInfo.push(SkObjectParser::IntToString(left, "Left: "));
326 this->fInfo.push(SkObjectParser::IntToString(top, "Top: "));
chudy@google.com902ebe52012-06-29 14:21:22 +0000327}
328
329void DrawSprite::execute(SkCanvas* canvas) {
330 canvas->drawSprite(*this->fBitmap, this->fLeft, this->fTop, this->fPaint);
331}
332
333DrawTextC::DrawTextC(const void* text, size_t byteLength, SkScalar x, SkScalar y,
334 const SkPaint& paint) {
335 this->fText = text;
336 this->fByteLength = byteLength;
337 this->fX = x;
338 this->fY = y;
339 this->fPaint = &paint;
340 this->fDrawType = DRAW_TEXT;
341
chudy@google.com97cee972012-08-07 20:41:37 +0000342 this->fInfo.push(SkObjectParser::TextToString(text, byteLength));
343 this->fInfo.push(SkObjectParser::ScalarToString(x, "SkScalar x: "));
344 this->fInfo.push(SkObjectParser::ScalarToString(y, "SkScalar y: "));
345 this->fInfo.push(SkObjectParser::PaintToString(paint));
chudy@google.com902ebe52012-06-29 14:21:22 +0000346}
347
348void DrawTextC::execute(SkCanvas* canvas) {
349 canvas->drawText(this->fText, this->fByteLength, this->fX, this->fY, *this->fPaint);
350}
351
352DrawTextOnPath::DrawTextOnPath(const void* text, size_t byteLength,
353 const SkPath& path, const SkMatrix* matrix, const SkPaint& paint) {
354 this->fText = text;
355 this->fByteLength = byteLength;
356 this->fPath = &path;
357 this->fMatrix = matrix;
358 this->fPaint = &paint;
359 this->fDrawType = DRAW_TEXT_ON_PATH;
360
chudy@google.com97cee972012-08-07 20:41:37 +0000361 this->fInfo.push(SkObjectParser::TextToString(text, byteLength));
362 this->fInfo.push(SkObjectParser::PathToString(path));
363 if (matrix) this->fInfo.push(SkObjectParser::MatrixToString(*matrix));
364 this->fInfo.push(SkObjectParser::PaintToString(paint));
chudy@google.com902ebe52012-06-29 14:21:22 +0000365}
366
367void DrawTextOnPath::execute(SkCanvas* canvas) {
368 canvas->drawTextOnPath(this->fText, this->fByteLength, *this->fPath,
369 this->fMatrix, *this->fPaint);
370}
371
372DrawVertices::DrawVertices(SkCanvas::VertexMode vmode, int vertexCount,
373 const SkPoint vertices[], const SkPoint texs[], const SkColor colors[],
374 SkXfermode* xfermode, const uint16_t indices[], int indexCount,
375 const SkPaint& paint) {
376 this->fVmode = vmode;
377 this->fVertexCount = vertexCount;
378 this->fTexs = texs;
379 this->fColors = colors;
380 this->fXfermode = xfermode;
381 this->fIndices = indices;
382 this->fIndexCount = indexCount;
383 this->fPaint = &paint;
384 this->fDrawType = DRAW_VERTICES;
385 // TODO(chudy)
chudy@google.com97cee972012-08-07 20:41:37 +0000386 this->fInfo.push(SkObjectParser::CustomTextToString("To be implemented."));
chudy@google.com902ebe52012-06-29 14:21:22 +0000387}
388
389void DrawVertices::execute(SkCanvas* canvas) {
390 canvas->drawVertices(this->fVmode, this->fVertexCount, this->fVertices,
391 this->fTexs, this->fColors, this->fXfermode, this->fIndices,
392 this->fIndexCount, *this->fPaint);
393}
394
395Restore::Restore() {
396 this->fDrawType = RESTORE;
chudy@google.com97cee972012-08-07 20:41:37 +0000397 this->fInfo.push(SkObjectParser::CustomTextToString("No Parameters"));
chudy@google.com902ebe52012-06-29 14:21:22 +0000398}
399
400void Restore::execute(SkCanvas* canvas) {
401 canvas->restore();
402}
403
404Rotate::Rotate(SkScalar degrees) {
405 this->fDegrees = degrees;
406 this->fDrawType = ROTATE;
407
chudy@google.com97cee972012-08-07 20:41:37 +0000408 this->fInfo.push(SkObjectParser::ScalarToString(degrees, "SkScalar degrees: "));
chudy@google.com902ebe52012-06-29 14:21:22 +0000409}
410
411void Rotate::execute(SkCanvas* canvas) {
412 canvas->rotate(this->fDegrees);
413}
414
415Save::Save(SkCanvas::SaveFlags flags) {
416 this->fFlags = flags;
417 this->fDrawType = SAVE;
chudy@google.com97cee972012-08-07 20:41:37 +0000418 this->fInfo.push(SkObjectParser::SaveFlagsToString(flags));
chudy@google.com902ebe52012-06-29 14:21:22 +0000419}
420
421void Save::execute(SkCanvas* canvas) {
422 canvas->save(this->fFlags);
423}
424
425SaveLayer::SaveLayer(const SkRect* bounds, const SkPaint* paint,
426 SkCanvas::SaveFlags flags) {
427 this->fBounds = bounds;
428 this->fPaint = paint;
429 this->fFlags = flags;
430 this->fDrawType = SAVE_LAYER;
431
robertphillips@google.com30d35f22012-11-06 16:45:36 +0000432 if (bounds) this->fInfo.push(SkObjectParser::RectToString(*bounds, "Bounds: "));
chudy@google.com97cee972012-08-07 20:41:37 +0000433 if (paint) this->fInfo.push(SkObjectParser::PaintToString(*paint));
434 this->fInfo.push(SkObjectParser::SaveFlagsToString(flags));
chudy@google.com902ebe52012-06-29 14:21:22 +0000435}
436
437void SaveLayer::execute(SkCanvas* canvas) {
438 canvas->saveLayer(this->fBounds, this->fPaint, this->fFlags);
439}
440
441Scale::Scale(SkScalar sx, SkScalar sy) {
442 this->fSx = sx;
443 this->fSy = sy;
444 this->fDrawType = SCALE;
445
chudy@google.com97cee972012-08-07 20:41:37 +0000446 this->fInfo.push(SkObjectParser::ScalarToString(sx, "SkScalar sx: "));
447 this->fInfo.push(SkObjectParser::ScalarToString(sy, "SkScalar sy: "));
chudy@google.com902ebe52012-06-29 14:21:22 +0000448}
449
450void Scale::execute(SkCanvas* canvas) {
451 canvas->scale(this->fSx, this->fSy);
452}
453
454SetMatrix::SetMatrix(const SkMatrix& matrix) {
455 this->fMatrix = &matrix;
456 this->fDrawType = SET_MATRIX;
457
chudy@google.com97cee972012-08-07 20:41:37 +0000458 this->fInfo.push(SkObjectParser::MatrixToString(matrix));
chudy@google.com902ebe52012-06-29 14:21:22 +0000459}
460
461void SetMatrix::execute(SkCanvas* canvas) {
462 canvas->setMatrix(*this->fMatrix);
463}
464
465Skew::Skew(SkScalar sx, SkScalar sy) {
466 this->fSx = sx;
467 this->fSy = sy;
468 this->fDrawType = SKEW;
469
chudy@google.com97cee972012-08-07 20:41:37 +0000470 this->fInfo.push(SkObjectParser::ScalarToString(sx, "SkScalar sx: "));
471 this->fInfo.push(SkObjectParser::ScalarToString(sy, "SkScalar sy: "));
chudy@google.com902ebe52012-06-29 14:21:22 +0000472}
473
474void Skew::execute(SkCanvas* canvas) {
475 canvas->skew(this->fSx, this->fSy);
476}
477
478Translate::Translate(SkScalar dx, SkScalar dy) {
479 this->fDx = dx;
480 this->fDy = dy;
481 this->fDrawType = TRANSLATE;
482
chudy@google.com97cee972012-08-07 20:41:37 +0000483 this->fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: "));
484 this->fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: "));
chudy@google.com902ebe52012-06-29 14:21:22 +0000485}
486
487void Translate::execute(SkCanvas* canvas) {
488 canvas->translate(this->fDx, this->fDy);
489}