blob: 0948af0a3762c447d6cc2791cd4d1cb7cd8fa981 [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#ifndef SKDRAWCOMMAND_H_
10#define SKDRAWCOMMAND_H_
11
chudy@google.com902ebe52012-06-29 14:21:22 +000012#include "SkPictureFlat.h"
13#include "SkCanvas.h"
chudy@google.com902ebe52012-06-29 14:21:22 +000014
15class SkDrawCommand {
16public:
17 /* TODO(chudy): Remove subclasses. */
18 SkDrawCommand();
19
20 virtual ~SkDrawCommand();
21
chudy@google.com97cee972012-08-07 20:41:37 +000022 virtual SkString toString();
chudy@google.com902ebe52012-06-29 14:21:22 +000023
24 virtual const char* toCString() {
25 return GetCommandString(fDrawType);
26 }
27
chudy@google.com0b5bbb02012-07-31 19:55:32 +000028 bool isVisible() const {
29 return fVisible;
30 }
31
32 void setVisible(bool toggle) {
33 fVisible = toggle;
34 }
chudy@google.com902ebe52012-06-29 14:21:22 +000035
chudy@google.com97cee972012-08-07 20:41:37 +000036 SkTDArray<SkString*>* Info() {return &fInfo; };
chudy@google.com902ebe52012-06-29 14:21:22 +000037 virtual void execute(SkCanvas* canvas)=0;
tomhudson@google.com0699e022012-11-27 16:09:42 +000038 /** Does nothing by default, but used by save() and restore()-type
39 subclassse to track unresolved save() calls. */
40 virtual void trackSaveState(int* state) { };
chudy@google.com902ebe52012-06-29 14:21:22 +000041 DrawType getType() { return fDrawType; };
42
robertphillips@google.com6dec8fc2012-11-21 17:11:02 +000043 virtual const SkBitmap* getBitmap() const { return NULL; }
44
robertphillips@google.com8a1cdae2012-11-19 20:44:29 +000045 static const char* GetCommandString(DrawType type);
46
chudy@google.com902ebe52012-06-29 14:21:22 +000047protected:
48 DrawType fDrawType;
chudy@google.com97cee972012-08-07 20:41:37 +000049 SkTDArray<SkString*> fInfo;
chudy@google.com902ebe52012-06-29 14:21:22 +000050
51private:
52 bool fVisible;
chudy@google.com902ebe52012-06-29 14:21:22 +000053};
54
55class Restore : public SkDrawCommand {
56public:
57 Restore();
58 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
tomhudson@google.com0699e022012-11-27 16:09:42 +000059 virtual void trackSaveState(int* state) SK_OVERRIDE;
chudy@google.com902ebe52012-06-29 14:21:22 +000060};
61
62class Clear : public SkDrawCommand {
63public:
64 Clear(SkColor color);
65 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
66private:
67 SkColor fColor;
68};
69
70class ClipPath : public SkDrawCommand {
71public:
robertphillips@google.com6dec8fc2012-11-21 17:11:02 +000072 ClipPath(const SkPath& path, SkRegion::Op op, bool doAA, SkBitmap& bitmap);
chudy@google.com902ebe52012-06-29 14:21:22 +000073 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.com6dec8fc2012-11-21 17:11:02 +000074 virtual const SkBitmap* getBitmap() const SK_OVERRIDE;
chudy@google.com902ebe52012-06-29 14:21:22 +000075private:
robertphillips@google.com91217d02013-03-17 18:33:46 +000076 SkPath fPath;
chudy@google.com902ebe52012-06-29 14:21:22 +000077 SkRegion::Op fOp;
78 bool fDoAA;
robertphillips@google.com6dec8fc2012-11-21 17:11:02 +000079 SkBitmap fBitmap;
robertphillips@google.com91217d02013-03-17 18:33:46 +000080
81 typedef SkDrawCommand INHERITED;
chudy@google.com902ebe52012-06-29 14:21:22 +000082};
83
84class ClipRegion : public SkDrawCommand {
85public:
86 ClipRegion(const SkRegion& region, SkRegion::Op op);
87 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
88private:
89 const SkRegion* fRegion;
90 SkRegion::Op fOp;
91};
92
93class ClipRect : public SkDrawCommand {
94public:
95 ClipRect(const SkRect& rect, SkRegion::Op op, bool doAA);
96 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.comfebc0ec2013-03-11 22:53:11 +000097
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +000098 const SkRect& rect() const { return fRect; }
robertphillips@google.comfebc0ec2013-03-11 22:53:11 +000099 SkRegion::Op op() const { return fOp; }
100 bool doAA() const { return fDoAA; }
101
chudy@google.com902ebe52012-06-29 14:21:22 +0000102private:
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000103 SkRect fRect;
chudy@google.com902ebe52012-06-29 14:21:22 +0000104 SkRegion::Op fOp;
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000105 bool fDoAA;
106
107 typedef SkDrawCommand INHERITED;
chudy@google.com902ebe52012-06-29 14:21:22 +0000108};
109
robertphillips@google.com67baba42013-01-02 20:20:31 +0000110class ClipRRect : public SkDrawCommand {
111public:
112 ClipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA);
113 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.comfebc0ec2013-03-11 22:53:11 +0000114
115 const SkRRect& rrect() const { return fRRect; }
116 SkRegion::Op op() const { return fOp; }
117 bool doAA() const { return fDoAA; }
118
robertphillips@google.com67baba42013-01-02 20:20:31 +0000119private:
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000120 SkRRect fRRect;
robertphillips@google.com67baba42013-01-02 20:20:31 +0000121 SkRegion::Op fOp;
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000122 bool fDoAA;
123
124 typedef SkDrawCommand INHERITED;
robertphillips@google.com67baba42013-01-02 20:20:31 +0000125};
126
chudy@google.com902ebe52012-06-29 14:21:22 +0000127class Concat : public SkDrawCommand {
128public:
129 Concat(const SkMatrix& matrix);
130 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
131private:
132 const SkMatrix* fMatrix;
133};
134
135class DrawBitmap : public SkDrawCommand {
136public:
137 DrawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000138 const SkPaint* paint, SkBitmap& resizedBitmap);
chudy@google.com902ebe52012-06-29 14:21:22 +0000139 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000140 virtual const SkBitmap* getBitmap() const SK_OVERRIDE;
chudy@google.com902ebe52012-06-29 14:21:22 +0000141private:
142 const SkPaint* fPaint;
143 const SkBitmap* fBitmap;
144 SkScalar fLeft;
145 SkScalar fTop;
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000146 SkBitmap fResizedBitmap;
chudy@google.com902ebe52012-06-29 14:21:22 +0000147};
148
149class DrawBitmapMatrix : public SkDrawCommand {
150public:
151 DrawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& matrix,
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000152 const SkPaint* paint, SkBitmap& resizedBitmap);
chudy@google.com902ebe52012-06-29 14:21:22 +0000153 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000154 virtual const SkBitmap* getBitmap() const SK_OVERRIDE;
chudy@google.com902ebe52012-06-29 14:21:22 +0000155private:
156 const SkPaint* fPaint;
157 const SkBitmap* fBitmap;
158 const SkMatrix* fMatrix;
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000159 SkBitmap fResizedBitmap;
chudy@google.com902ebe52012-06-29 14:21:22 +0000160};
161
162class DrawBitmapNine : public SkDrawCommand {
163public:
164 DrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000165 const SkRect& dst, const SkPaint* paint, SkBitmap& resizedBitmap);
chudy@google.com902ebe52012-06-29 14:21:22 +0000166 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000167 virtual const SkBitmap* getBitmap() const SK_OVERRIDE;
chudy@google.com902ebe52012-06-29 14:21:22 +0000168private:
169 const SkBitmap* fBitmap;
170 const SkIRect* fCenter;
171 const SkRect* fDst;
172 const SkPaint* fPaint;
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000173 SkBitmap fResizedBitmap;
chudy@google.com902ebe52012-06-29 14:21:22 +0000174};
175
176class DrawBitmapRect : public SkDrawCommand {
177public:
reed@google.com71121732012-09-18 15:14:33 +0000178 DrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
skia.committer@gmail.comc76bb232013-03-18 07:01:03 +0000179 const SkRect& dst, const SkPaint* paint,
robertphillips@google.com91217d02013-03-17 18:33:46 +0000180 SkBitmap& resizedBitmap);
chudy@google.com902ebe52012-06-29 14:21:22 +0000181 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000182 virtual const SkBitmap* getBitmap() const SK_OVERRIDE;
robertphillips@google.com3b0a9fe2013-01-31 15:56:22 +0000183
184 // The non-const 'paint' method allows modification of this object's
185 // SkPaint. For this reason the ctor and setPaint method make a local copy.
186 // The 'fPaintPtr' member acts a signal that the local SkPaint is valid
187 // (since only an SkPaint* is passed into the ctor).
188 const SkPaint* paint() const { return fPaintPtr; }
189 SkPaint* paint() { return fPaintPtr; }
190
191 void setPaint(const SkPaint& paint) { fPaint = paint; fPaintPtr = &fPaint; }
192
robertphillips@google.com91217d02013-03-17 18:33:46 +0000193 const SkRect* srcRect() const { return fSrc.isEmpty() ? NULL : &fSrc; }
194 const SkRect& dstRect() const { return fDst; }
robertphillips@google.comfebc0ec2013-03-11 22:53:11 +0000195
chudy@google.com902ebe52012-06-29 14:21:22 +0000196private:
robertphillips@google.com91217d02013-03-17 18:33:46 +0000197 SkRect fSrc;
robertphillips@google.com3b0a9fe2013-01-31 15:56:22 +0000198 SkPaint fPaint;
199 SkPaint* fPaintPtr;
robertphillips@google.com91217d02013-03-17 18:33:46 +0000200 SkBitmap fBitmap;
201 SkRect fDst;
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000202 SkBitmap fResizedBitmap;
robertphillips@google.com91217d02013-03-17 18:33:46 +0000203
204 typedef SkDrawCommand INHERITED;
chudy@google.com902ebe52012-06-29 14:21:22 +0000205};
206
207class DrawData : public SkDrawCommand {
208public:
209 DrawData(const void* data, size_t length);
210 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
211private:
212 const void* fData;
213 size_t fLength;
214};
215
robertphillips@google.com67baba42013-01-02 20:20:31 +0000216class DrawOval : public SkDrawCommand {
217public:
218 DrawOval(const SkRect& oval, const SkPaint& paint);
219 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
220private:
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000221 SkRect fOval;
222 SkPaint fPaint;
223
224 typedef SkDrawCommand INHERITED;
robertphillips@google.com67baba42013-01-02 20:20:31 +0000225};
226
chudy@google.com902ebe52012-06-29 14:21:22 +0000227class DrawPaint : public SkDrawCommand {
228public:
229 DrawPaint(const SkPaint& paint);
230 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
231private:
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000232 SkPaint fPaint;
233
234 typedef SkDrawCommand INHERITED;
chudy@google.com902ebe52012-06-29 14:21:22 +0000235};
236
237class DrawPath : public SkDrawCommand {
238public:
robertphillips@google.com6dec8fc2012-11-21 17:11:02 +0000239 DrawPath(const SkPath& path, const SkPaint& paint, SkBitmap& bitmap);
chudy@google.com902ebe52012-06-29 14:21:22 +0000240 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
rmistry@google.com44737652012-11-21 18:37:58 +0000241 virtual const SkBitmap* getBitmap() const SK_OVERRIDE;
robertphillips@google.com6dec8fc2012-11-21 17:11:02 +0000242
chudy@google.com902ebe52012-06-29 14:21:22 +0000243private:
robertphillips@google.com91217d02013-03-17 18:33:46 +0000244 SkPath fPath;
245 SkPaint fPaint;
robertphillips@google.com6dec8fc2012-11-21 17:11:02 +0000246 SkBitmap fBitmap;
robertphillips@google.com91217d02013-03-17 18:33:46 +0000247
248 typedef SkDrawCommand INHERITED;
chudy@google.com902ebe52012-06-29 14:21:22 +0000249};
250
251class DrawPicture : public SkDrawCommand {
252public:
253 DrawPicture(SkPicture& picture);
254 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
255private:
256 SkPicture* fPicture;
257};
258
259class DrawPoints : public SkDrawCommand {
260public:
261 DrawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint pts[],
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000262 const SkPaint& paint);
263 virtual ~DrawPoints() { delete [] fPts; }
chudy@google.com902ebe52012-06-29 14:21:22 +0000264 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000265
chudy@google.com902ebe52012-06-29 14:21:22 +0000266private:
chudy@google.com902ebe52012-06-29 14:21:22 +0000267 SkCanvas::PointMode fMode;
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000268 size_t fCount;
269 SkPoint* fPts;
270 SkPaint fPaint;
271
272 typedef SkDrawCommand INHERITED;
chudy@google.com902ebe52012-06-29 14:21:22 +0000273};
274
275/* TODO(chudy): DrawText is a predefined macro and was breaking something
276 * in the windows build of the debugger.
277 */
278class DrawTextC : public SkDrawCommand {
279public:
280 DrawTextC(const void* text, size_t byteLength, SkScalar x, SkScalar y,
281 const SkPaint& paint);
282 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
283private:
284 const void* fText;
285 size_t fByteLength;
286 SkScalar fX;
287 SkScalar fY;
288 const SkPaint* fPaint;
289};
290
291class DrawPosText : public SkDrawCommand {
292public:
293 DrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000294 const SkPaint& paint);
295 virtual ~DrawPosText() { delete [] fPos; delete [] fText; }
chudy@google.com902ebe52012-06-29 14:21:22 +0000296 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
297private:
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000298 SkPoint* fPos;
299 char* fText;
chudy@google.com902ebe52012-06-29 14:21:22 +0000300 size_t fByteLength;
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000301 SkPaint fPaint;
chudy@google.com902ebe52012-06-29 14:21:22 +0000302};
303
304class DrawTextOnPath : public SkDrawCommand {
305public:
306 DrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000307 const SkMatrix* matrix, const SkPaint& paint);
chudy@google.com902ebe52012-06-29 14:21:22 +0000308 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
309private:
310 const SkMatrix* fMatrix;
311 const void* fText;
312 size_t fByteLength;
313 const SkPath* fPath;
314 const SkPaint* fPaint;
315};
316
317class DrawPosTextH : public SkDrawCommand {
318public:
319 DrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
robertphillips@google.com91217d02013-03-17 18:33:46 +0000320 SkScalar constY, const SkPaint& paint);
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000321 virtual ~DrawPosTextH() { delete [] fXpos; delete [] fText; }
chudy@google.com902ebe52012-06-29 14:21:22 +0000322 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
323private:
robertphillips@google.coma3a09ab2013-03-22 12:25:30 +0000324 SkScalar* fXpos;
325 char* fText;
chudy@google.com902ebe52012-06-29 14:21:22 +0000326 size_t fByteLength;
327 SkScalar fConstY;
robertphillips@google.com91217d02013-03-17 18:33:46 +0000328 SkPaint fPaint;
329
330 typedef SkDrawCommand INHERITED;
chudy@google.com902ebe52012-06-29 14:21:22 +0000331};
332
333class DrawRectC : public SkDrawCommand {
334public:
335 DrawRectC(const SkRect& rect, const SkPaint& paint);
336 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.comfebc0ec2013-03-11 22:53:11 +0000337
robertphillips@google.com91217d02013-03-17 18:33:46 +0000338 const SkRect& rect() const { return fRect; }
339 const SkPaint& paint() const { return fPaint; }
chudy@google.com902ebe52012-06-29 14:21:22 +0000340private:
robertphillips@google.com91217d02013-03-17 18:33:46 +0000341 SkRect fRect;
342 SkPaint fPaint;
343
344 typedef SkDrawCommand INHERITED;
chudy@google.com902ebe52012-06-29 14:21:22 +0000345};
346
robertphillips@google.com67baba42013-01-02 20:20:31 +0000347class DrawRRect : public SkDrawCommand {
348public:
349 DrawRRect(const SkRRect& rrect, const SkPaint& paint);
350 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
351private:
352 SkRRect fRRect;
robertphillips@google.comfebc0ec2013-03-11 22:53:11 +0000353 SkPaint fPaint;
robertphillips@google.com67baba42013-01-02 20:20:31 +0000354};
355
chudy@google.com902ebe52012-06-29 14:21:22 +0000356class DrawSprite : public SkDrawCommand {
357public:
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000358 DrawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint,
359 SkBitmap& resizedBitmap);
chudy@google.com902ebe52012-06-29 14:21:22 +0000360 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000361 virtual const SkBitmap* getBitmap() const SK_OVERRIDE;
chudy@google.com902ebe52012-06-29 14:21:22 +0000362private:
363 const SkPaint* fPaint;
364 int fLeft;
365 int fTop;
366 const SkBitmap* fBitmap;
robertphillips@google.com53ec73d2012-11-26 13:09:17 +0000367 SkBitmap fResizedBitmap;
chudy@google.com902ebe52012-06-29 14:21:22 +0000368};
369
370class DrawVertices : public SkDrawCommand {
371public:
372 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 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
377private:
378 SkCanvas::VertexMode fVmode;
379 int fVertexCount;
380 int fIndexCount;
381 const SkPoint* fVertices;
382 const SkPoint* fTexs;
383 const SkColor* fColors;
384 const uint16_t* fIndices;
385 SkXfermode* fXfermode;
386 const SkPaint* fPaint;
387};
388
389class Rotate : public SkDrawCommand {
390public:
391 Rotate(SkScalar degrees);
392 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
393private:
394 SkScalar fDegrees;
395};
396
397class Save : public SkDrawCommand {
398public:
399 Save(SkCanvas::SaveFlags flags);
400 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
tomhudson@google.com0699e022012-11-27 16:09:42 +0000401 virtual void trackSaveState(int* state) SK_OVERRIDE;
chudy@google.com902ebe52012-06-29 14:21:22 +0000402private:
403 SkCanvas::SaveFlags fFlags;
404};
405
406class SaveLayer : public SkDrawCommand {
407public:
408 SaveLayer(const SkRect* bounds, const SkPaint* paint,
409 SkCanvas::SaveFlags flags);
410 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
tomhudson@google.com0699e022012-11-27 16:09:42 +0000411 virtual void trackSaveState(int* state) SK_OVERRIDE;
robertphillips@google.com3b0a9fe2013-01-31 15:56:22 +0000412
413 const SkPaint* paint() const { return fPaint; }
414
chudy@google.com902ebe52012-06-29 14:21:22 +0000415private:
416 const SkRect* fBounds;
417 const SkPaint* fPaint;
418 SkCanvas::SaveFlags fFlags;
419};
420
421class Scale : public SkDrawCommand {
422public:
423 Scale(SkScalar sx, SkScalar sy);
424 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.com9105ad02013-03-17 18:46:16 +0000425
426 SkScalar x() const { return fSx; }
427 SkScalar y() const { return fSy; }
428
chudy@google.com902ebe52012-06-29 14:21:22 +0000429private:
430 SkScalar fSx;
431 SkScalar fSy;
432};
433
434class SetMatrix : public SkDrawCommand {
435public:
436 SetMatrix(const SkMatrix& matrix);
437 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
438private:
robertphillips@google.comb94b1e72013-02-19 21:00:26 +0000439 SkMatrix fMatrix;
chudy@google.com902ebe52012-06-29 14:21:22 +0000440};
441
442class Skew : public SkDrawCommand {
443public:
444 Skew(SkScalar sx, SkScalar sy);
445 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
446private:
447 SkScalar fSx;
448 SkScalar fSy;
449};
450
451class Translate : public SkDrawCommand {
452public:
453 Translate(SkScalar dx, SkScalar dy);
454 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
robertphillips@google.com9105ad02013-03-17 18:46:16 +0000455
456 SkScalar x() const { return fDx; }
457 SkScalar y() const { return fDy; }
458
chudy@google.com902ebe52012-06-29 14:21:22 +0000459private:
460 SkScalar fDx;
461 SkScalar fDy;
462};
463
464#endif