chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 1 | |
| 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.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 12 | #include "SkPictureFlat.h" |
| 13 | #include "SkCanvas.h" |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 14 | |
| 15 | class SkDrawCommand { |
| 16 | public: |
| 17 | /* TODO(chudy): Remove subclasses. */ |
| 18 | SkDrawCommand(); |
| 19 | |
| 20 | virtual ~SkDrawCommand(); |
| 21 | |
chudy@google.com | 97cee97 | 2012-08-07 20:41:37 +0000 | [diff] [blame] | 22 | virtual SkString toString(); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 23 | |
| 24 | virtual const char* toCString() { |
| 25 | return GetCommandString(fDrawType); |
| 26 | } |
| 27 | |
chudy@google.com | 0b5bbb0 | 2012-07-31 19:55:32 +0000 | [diff] [blame] | 28 | bool isVisible() const { |
| 29 | return fVisible; |
| 30 | } |
| 31 | |
| 32 | void setVisible(bool toggle) { |
| 33 | fVisible = toggle; |
| 34 | } |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 35 | |
chudy@google.com | 97cee97 | 2012-08-07 20:41:37 +0000 | [diff] [blame] | 36 | SkTDArray<SkString*>* Info() {return &fInfo; }; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 37 | virtual void execute(SkCanvas* canvas)=0; |
tomhudson@google.com | 0699e02 | 2012-11-27 16:09:42 +0000 | [diff] [blame] | 38 | /** 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.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 41 | DrawType getType() { return fDrawType; }; |
| 42 | |
robertphillips@google.com | 6dec8fc | 2012-11-21 17:11:02 +0000 | [diff] [blame] | 43 | virtual const SkBitmap* getBitmap() const { return NULL; } |
| 44 | |
robertphillips@google.com | 8a1cdae | 2012-11-19 20:44:29 +0000 | [diff] [blame] | 45 | static const char* GetCommandString(DrawType type); |
| 46 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 47 | protected: |
| 48 | DrawType fDrawType; |
chudy@google.com | 97cee97 | 2012-08-07 20:41:37 +0000 | [diff] [blame] | 49 | SkTDArray<SkString*> fInfo; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 50 | |
| 51 | private: |
| 52 | bool fVisible; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | class Restore : public SkDrawCommand { |
| 56 | public: |
| 57 | Restore(); |
| 58 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
tomhudson@google.com | 0699e02 | 2012-11-27 16:09:42 +0000 | [diff] [blame] | 59 | virtual void trackSaveState(int* state) SK_OVERRIDE; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 60 | }; |
| 61 | |
| 62 | class Clear : public SkDrawCommand { |
| 63 | public: |
| 64 | Clear(SkColor color); |
| 65 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 66 | private: |
| 67 | SkColor fColor; |
| 68 | }; |
| 69 | |
| 70 | class ClipPath : public SkDrawCommand { |
| 71 | public: |
robertphillips@google.com | 6dec8fc | 2012-11-21 17:11:02 +0000 | [diff] [blame] | 72 | ClipPath(const SkPath& path, SkRegion::Op op, bool doAA, SkBitmap& bitmap); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 73 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
robertphillips@google.com | 6dec8fc | 2012-11-21 17:11:02 +0000 | [diff] [blame] | 74 | virtual const SkBitmap* getBitmap() const SK_OVERRIDE; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 75 | private: |
| 76 | const SkPath* fPath; |
| 77 | SkRegion::Op fOp; |
| 78 | bool fDoAA; |
robertphillips@google.com | 6dec8fc | 2012-11-21 17:11:02 +0000 | [diff] [blame] | 79 | SkBitmap fBitmap; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | class ClipRegion : public SkDrawCommand { |
| 83 | public: |
| 84 | ClipRegion(const SkRegion& region, SkRegion::Op op); |
| 85 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 86 | private: |
| 87 | const SkRegion* fRegion; |
| 88 | SkRegion::Op fOp; |
| 89 | }; |
| 90 | |
| 91 | class ClipRect : public SkDrawCommand { |
| 92 | public: |
| 93 | ClipRect(const SkRect& rect, SkRegion::Op op, bool doAA); |
| 94 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 95 | private: |
| 96 | const SkRect* fRect; |
| 97 | SkRegion::Op fOp; |
| 98 | bool fDoAA; |
| 99 | }; |
| 100 | |
robertphillips@google.com | 67baba4 | 2013-01-02 20:20:31 +0000 | [diff] [blame^] | 101 | class ClipRRect : public SkDrawCommand { |
| 102 | public: |
| 103 | ClipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA); |
| 104 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 105 | private: |
| 106 | const SkRRect* fRRect; |
| 107 | SkRegion::Op fOp; |
| 108 | bool fDoAA; |
| 109 | }; |
| 110 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 111 | class Concat : public SkDrawCommand { |
| 112 | public: |
| 113 | Concat(const SkMatrix& matrix); |
| 114 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 115 | private: |
| 116 | const SkMatrix* fMatrix; |
| 117 | }; |
| 118 | |
| 119 | class DrawBitmap : public SkDrawCommand { |
| 120 | public: |
| 121 | DrawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 122 | const SkPaint* paint, SkBitmap& resizedBitmap); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 123 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 124 | virtual const SkBitmap* getBitmap() const SK_OVERRIDE; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 125 | private: |
| 126 | const SkPaint* fPaint; |
| 127 | const SkBitmap* fBitmap; |
| 128 | SkScalar fLeft; |
| 129 | SkScalar fTop; |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 130 | SkBitmap fResizedBitmap; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 131 | }; |
| 132 | |
| 133 | class DrawBitmapMatrix : public SkDrawCommand { |
| 134 | public: |
| 135 | DrawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& matrix, |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 136 | const SkPaint* paint, SkBitmap& resizedBitmap); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 137 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 138 | virtual const SkBitmap* getBitmap() const SK_OVERRIDE; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 139 | private: |
| 140 | const SkPaint* fPaint; |
| 141 | const SkBitmap* fBitmap; |
| 142 | const SkMatrix* fMatrix; |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 143 | SkBitmap fResizedBitmap; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 144 | }; |
| 145 | |
| 146 | class DrawBitmapNine : public SkDrawCommand { |
| 147 | public: |
| 148 | DrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 149 | const SkRect& dst, const SkPaint* paint, SkBitmap& resizedBitmap); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 150 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 151 | virtual const SkBitmap* getBitmap() const SK_OVERRIDE; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 152 | private: |
| 153 | const SkBitmap* fBitmap; |
| 154 | const SkIRect* fCenter; |
| 155 | const SkRect* fDst; |
| 156 | const SkPaint* fPaint; |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 157 | SkBitmap fResizedBitmap; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 158 | }; |
| 159 | |
| 160 | class DrawBitmapRect : public SkDrawCommand { |
| 161 | public: |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 162 | DrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 163 | const SkRect& dst, const SkPaint* paint, SkBitmap& resizedBitmap); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 164 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 165 | virtual const SkBitmap* getBitmap() const SK_OVERRIDE; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 166 | private: |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 167 | const SkRect* fSrc; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 168 | const SkPaint* fPaint; |
| 169 | const SkBitmap* fBitmap; |
| 170 | const SkRect* fDst; |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 171 | SkBitmap fResizedBitmap; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 172 | }; |
| 173 | |
| 174 | class DrawData : public SkDrawCommand { |
| 175 | public: |
| 176 | DrawData(const void* data, size_t length); |
| 177 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 178 | private: |
| 179 | const void* fData; |
| 180 | size_t fLength; |
| 181 | }; |
| 182 | |
robertphillips@google.com | 67baba4 | 2013-01-02 20:20:31 +0000 | [diff] [blame^] | 183 | class DrawOval : public SkDrawCommand { |
| 184 | public: |
| 185 | DrawOval(const SkRect& oval, const SkPaint& paint); |
| 186 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 187 | private: |
| 188 | const SkRect* fOval; |
| 189 | const SkPaint* fPaint; |
| 190 | }; |
| 191 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 192 | class DrawPaint : public SkDrawCommand { |
| 193 | public: |
| 194 | DrawPaint(const SkPaint& paint); |
| 195 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 196 | private: |
| 197 | const SkPaint* fPaint; |
| 198 | }; |
| 199 | |
| 200 | class DrawPath : public SkDrawCommand { |
| 201 | public: |
robertphillips@google.com | 6dec8fc | 2012-11-21 17:11:02 +0000 | [diff] [blame] | 202 | DrawPath(const SkPath& path, const SkPaint& paint, SkBitmap& bitmap); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 203 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
rmistry@google.com | 4473765 | 2012-11-21 18:37:58 +0000 | [diff] [blame] | 204 | virtual const SkBitmap* getBitmap() const SK_OVERRIDE; |
robertphillips@google.com | 6dec8fc | 2012-11-21 17:11:02 +0000 | [diff] [blame] | 205 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 206 | private: |
| 207 | const SkPath* fPath; |
| 208 | const SkPaint* fPaint; |
robertphillips@google.com | 6dec8fc | 2012-11-21 17:11:02 +0000 | [diff] [blame] | 209 | SkBitmap fBitmap; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 210 | }; |
| 211 | |
| 212 | class DrawPicture : public SkDrawCommand { |
| 213 | public: |
| 214 | DrawPicture(SkPicture& picture); |
| 215 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 216 | private: |
| 217 | SkPicture* fPicture; |
| 218 | }; |
| 219 | |
| 220 | class DrawPoints : public SkDrawCommand { |
| 221 | public: |
| 222 | DrawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint pts[], |
| 223 | const SkPaint& paint); |
| 224 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 225 | private: |
| 226 | const SkPoint* fPts; |
| 227 | SkCanvas::PointMode fMode; |
| 228 | size_t fCount; |
| 229 | const SkPaint* fPaint; |
| 230 | }; |
| 231 | |
| 232 | /* TODO(chudy): DrawText is a predefined macro and was breaking something |
| 233 | * in the windows build of the debugger. |
| 234 | */ |
| 235 | class DrawTextC : public SkDrawCommand { |
| 236 | public: |
| 237 | DrawTextC(const void* text, size_t byteLength, SkScalar x, SkScalar y, |
| 238 | const SkPaint& paint); |
| 239 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 240 | private: |
| 241 | const void* fText; |
| 242 | size_t fByteLength; |
| 243 | SkScalar fX; |
| 244 | SkScalar fY; |
| 245 | const SkPaint* fPaint; |
| 246 | }; |
| 247 | |
| 248 | class DrawPosText : public SkDrawCommand { |
| 249 | public: |
| 250 | DrawPosText(const void* text, size_t byteLength, const SkPoint pos[], |
| 251 | const SkPaint& paint); |
| 252 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 253 | private: |
| 254 | const SkPoint* fPos; |
| 255 | const void* fText; |
| 256 | size_t fByteLength; |
| 257 | const SkPaint* fPaint; |
| 258 | }; |
| 259 | |
| 260 | class DrawTextOnPath : public SkDrawCommand { |
| 261 | public: |
| 262 | DrawTextOnPath(const void* text, size_t byteLength, const SkPath& path, |
| 263 | const SkMatrix* matrix, const SkPaint& paint); |
| 264 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 265 | private: |
| 266 | const SkMatrix* fMatrix; |
| 267 | const void* fText; |
| 268 | size_t fByteLength; |
| 269 | const SkPath* fPath; |
| 270 | const SkPaint* fPaint; |
| 271 | }; |
| 272 | |
| 273 | class DrawPosTextH : public SkDrawCommand { |
| 274 | public: |
| 275 | DrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], |
| 276 | SkScalar constY, const SkPaint& paint); |
| 277 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 278 | private: |
| 279 | const SkScalar* fXpos; |
| 280 | const void* fText; |
| 281 | size_t fByteLength; |
| 282 | SkScalar fConstY; |
| 283 | const SkPaint* fPaint; |
| 284 | }; |
| 285 | |
| 286 | class DrawRectC : public SkDrawCommand { |
| 287 | public: |
| 288 | DrawRectC(const SkRect& rect, const SkPaint& paint); |
| 289 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 290 | private: |
| 291 | const SkRect* fRect; |
| 292 | const SkPaint* fPaint; |
| 293 | }; |
| 294 | |
robertphillips@google.com | 67baba4 | 2013-01-02 20:20:31 +0000 | [diff] [blame^] | 295 | class DrawRRect : public SkDrawCommand { |
| 296 | public: |
| 297 | DrawRRect(const SkRRect& rrect, const SkPaint& paint); |
| 298 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 299 | private: |
| 300 | SkRRect fRRect; |
| 301 | const SkPaint* fPaint; |
| 302 | }; |
| 303 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 304 | class DrawSprite : public SkDrawCommand { |
| 305 | public: |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 306 | DrawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint, |
| 307 | SkBitmap& resizedBitmap); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 308 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 309 | virtual const SkBitmap* getBitmap() const SK_OVERRIDE; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 310 | private: |
| 311 | const SkPaint* fPaint; |
| 312 | int fLeft; |
| 313 | int fTop; |
| 314 | const SkBitmap* fBitmap; |
robertphillips@google.com | 53ec73d | 2012-11-26 13:09:17 +0000 | [diff] [blame] | 315 | SkBitmap fResizedBitmap; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 316 | }; |
| 317 | |
| 318 | class DrawVertices : public SkDrawCommand { |
| 319 | public: |
| 320 | DrawVertices(SkCanvas::VertexMode vmode, int vertexCount, |
| 321 | const SkPoint vertices[], const SkPoint texs[], const SkColor colors[], |
| 322 | SkXfermode* xfermode, const uint16_t indices[], int indexCount, |
| 323 | const SkPaint& paint); |
| 324 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 325 | private: |
| 326 | SkCanvas::VertexMode fVmode; |
| 327 | int fVertexCount; |
| 328 | int fIndexCount; |
| 329 | const SkPoint* fVertices; |
| 330 | const SkPoint* fTexs; |
| 331 | const SkColor* fColors; |
| 332 | const uint16_t* fIndices; |
| 333 | SkXfermode* fXfermode; |
| 334 | const SkPaint* fPaint; |
| 335 | }; |
| 336 | |
| 337 | class Rotate : public SkDrawCommand { |
| 338 | public: |
| 339 | Rotate(SkScalar degrees); |
| 340 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 341 | private: |
| 342 | SkScalar fDegrees; |
| 343 | }; |
| 344 | |
| 345 | class Save : public SkDrawCommand { |
| 346 | public: |
| 347 | Save(SkCanvas::SaveFlags flags); |
| 348 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
tomhudson@google.com | 0699e02 | 2012-11-27 16:09:42 +0000 | [diff] [blame] | 349 | virtual void trackSaveState(int* state) SK_OVERRIDE; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 350 | private: |
| 351 | SkCanvas::SaveFlags fFlags; |
| 352 | }; |
| 353 | |
| 354 | class SaveLayer : public SkDrawCommand { |
| 355 | public: |
| 356 | SaveLayer(const SkRect* bounds, const SkPaint* paint, |
| 357 | SkCanvas::SaveFlags flags); |
| 358 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
tomhudson@google.com | 0699e02 | 2012-11-27 16:09:42 +0000 | [diff] [blame] | 359 | virtual void trackSaveState(int* state) SK_OVERRIDE; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 360 | private: |
| 361 | const SkRect* fBounds; |
| 362 | const SkPaint* fPaint; |
| 363 | SkCanvas::SaveFlags fFlags; |
| 364 | }; |
| 365 | |
| 366 | class Scale : public SkDrawCommand { |
| 367 | public: |
| 368 | Scale(SkScalar sx, SkScalar sy); |
| 369 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 370 | private: |
| 371 | SkScalar fSx; |
| 372 | SkScalar fSy; |
| 373 | }; |
| 374 | |
| 375 | class SetMatrix : public SkDrawCommand { |
| 376 | public: |
| 377 | SetMatrix(const SkMatrix& matrix); |
| 378 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 379 | private: |
| 380 | const SkMatrix* fMatrix; |
| 381 | }; |
| 382 | |
| 383 | class Skew : public SkDrawCommand { |
| 384 | public: |
| 385 | Skew(SkScalar sx, SkScalar sy); |
| 386 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 387 | private: |
| 388 | SkScalar fSx; |
| 389 | SkScalar fSy; |
| 390 | }; |
| 391 | |
| 392 | class Translate : public SkDrawCommand { |
| 393 | public: |
| 394 | Translate(SkScalar dx, SkScalar dy); |
| 395 | virtual void execute(SkCanvas* canvas) SK_OVERRIDE; |
| 396 | private: |
| 397 | SkScalar fDx; |
| 398 | SkScalar fDy; |
| 399 | }; |
| 400 | |
| 401 | #endif |