Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: debugger/SkDrawCommand.h

Issue 12979004: More SkDrawCommand cleanup (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « debugger/SkDebugCanvas.cpp ('k') | debugger/SkDrawCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef SKDRAWCOMMAND_H_ 9 #ifndef SKDRAWCOMMAND_H_
10 #define SKDRAWCOMMAND_H_ 10 #define SKDRAWCOMMAND_H_
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 private: 88 private:
89 const SkRegion* fRegion; 89 const SkRegion* fRegion;
90 SkRegion::Op fOp; 90 SkRegion::Op fOp;
91 }; 91 };
92 92
93 class ClipRect : public SkDrawCommand { 93 class ClipRect : public SkDrawCommand {
94 public: 94 public:
95 ClipRect(const SkRect& rect, SkRegion::Op op, bool doAA); 95 ClipRect(const SkRect& rect, SkRegion::Op op, bool doAA);
96 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 96 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
97 97
98 const SkRect& rect() const { return *fRect; } 98 const SkRect& rect() const { return fRect; }
99 SkRegion::Op op() const { return fOp; } 99 SkRegion::Op op() const { return fOp; }
100 bool doAA() const { return fDoAA; } 100 bool doAA() const { return fDoAA; }
101 101
102 private: 102 private:
103 const SkRect* fRect; 103 SkRect fRect;
104 SkRegion::Op fOp; 104 SkRegion::Op fOp;
105 bool fDoAA; 105 bool fDoAA;
106
107 typedef SkDrawCommand INHERITED;
106 }; 108 };
107 109
108 class ClipRRect : public SkDrawCommand { 110 class ClipRRect : public SkDrawCommand {
109 public: 111 public:
110 ClipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA); 112 ClipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA);
111 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 113 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
112 114
113 const SkRRect& rrect() const { return fRRect; } 115 const SkRRect& rrect() const { return fRRect; }
114 SkRegion::Op op() const { return fOp; } 116 SkRegion::Op op() const { return fOp; }
115 bool doAA() const { return fDoAA; } 117 bool doAA() const { return fDoAA; }
116 118
117 private: 119 private:
118 SkRRect fRRect; 120 SkRRect fRRect;
119 SkRegion::Op fOp; 121 SkRegion::Op fOp;
120 bool fDoAA; 122 bool fDoAA;
123
124 typedef SkDrawCommand INHERITED;
121 }; 125 };
122 126
123 class Concat : public SkDrawCommand { 127 class Concat : public SkDrawCommand {
124 public: 128 public:
125 Concat(const SkMatrix& matrix); 129 Concat(const SkMatrix& matrix);
126 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 130 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
127 private: 131 private:
128 const SkMatrix* fMatrix; 132 const SkMatrix* fMatrix;
129 }; 133 };
130 134
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 private: 211 private:
208 const void* fData; 212 const void* fData;
209 size_t fLength; 213 size_t fLength;
210 }; 214 };
211 215
212 class DrawOval : public SkDrawCommand { 216 class DrawOval : public SkDrawCommand {
213 public: 217 public:
214 DrawOval(const SkRect& oval, const SkPaint& paint); 218 DrawOval(const SkRect& oval, const SkPaint& paint);
215 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 219 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
216 private: 220 private:
217 const SkRect* fOval; 221 SkRect fOval;
218 const SkPaint* fPaint; 222 SkPaint fPaint;
223
224 typedef SkDrawCommand INHERITED;
219 }; 225 };
220 226
221 class DrawPaint : public SkDrawCommand { 227 class DrawPaint : public SkDrawCommand {
222 public: 228 public:
223 DrawPaint(const SkPaint& paint); 229 DrawPaint(const SkPaint& paint);
224 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 230 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
225 private: 231 private:
226 const SkPaint* fPaint; 232 SkPaint fPaint;
233
234 typedef SkDrawCommand INHERITED;
227 }; 235 };
228 236
229 class DrawPath : public SkDrawCommand { 237 class DrawPath : public SkDrawCommand {
230 public: 238 public:
231 DrawPath(const SkPath& path, const SkPaint& paint, SkBitmap& bitmap); 239 DrawPath(const SkPath& path, const SkPaint& paint, SkBitmap& bitmap);
232 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 240 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
233 virtual const SkBitmap* getBitmap() const SK_OVERRIDE; 241 virtual const SkBitmap* getBitmap() const SK_OVERRIDE;
234 242
235 private: 243 private:
236 SkPath fPath; 244 SkPath fPath;
237 SkPaint fPaint; 245 SkPaint fPaint;
238 SkBitmap fBitmap; 246 SkBitmap fBitmap;
239 247
240 typedef SkDrawCommand INHERITED; 248 typedef SkDrawCommand INHERITED;
241 }; 249 };
242 250
243 class DrawPicture : public SkDrawCommand { 251 class DrawPicture : public SkDrawCommand {
244 public: 252 public:
245 DrawPicture(SkPicture& picture); 253 DrawPicture(SkPicture& picture);
246 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 254 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
247 private: 255 private:
248 SkPicture* fPicture; 256 SkPicture* fPicture;
249 }; 257 };
250 258
251 class DrawPoints : public SkDrawCommand { 259 class DrawPoints : public SkDrawCommand {
252 public: 260 public:
253 DrawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint pts[], 261 DrawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint pts[],
254 const SkPaint& paint); 262 const SkPaint& paint);
263 virtual ~DrawPoints() { delete [] fPts; }
255 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 264 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
265
256 private: 266 private:
257 const SkPoint* fPts;
258 SkCanvas::PointMode fMode; 267 SkCanvas::PointMode fMode;
259 size_t fCount; 268 size_t fCount;
260 const SkPaint* fPaint; 269 SkPoint* fPts;
270 SkPaint fPaint;
271
272 typedef SkDrawCommand INHERITED;
261 }; 273 };
262 274
263 /* TODO(chudy): DrawText is a predefined macro and was breaking something 275 /* TODO(chudy): DrawText is a predefined macro and was breaking something
264 * in the windows build of the debugger. 276 * in the windows build of the debugger.
265 */ 277 */
266 class DrawTextC : public SkDrawCommand { 278 class DrawTextC : public SkDrawCommand {
267 public: 279 public:
268 DrawTextC(const void* text, size_t byteLength, SkScalar x, SkScalar y, 280 DrawTextC(const void* text, size_t byteLength, SkScalar x, SkScalar y,
269 const SkPaint& paint); 281 const SkPaint& paint);
270 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 282 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
271 private: 283 private:
272 const void* fText; 284 const void* fText;
273 size_t fByteLength; 285 size_t fByteLength;
274 SkScalar fX; 286 SkScalar fX;
275 SkScalar fY; 287 SkScalar fY;
276 const SkPaint* fPaint; 288 const SkPaint* fPaint;
277 }; 289 };
278 290
279 class DrawPosText : public SkDrawCommand { 291 class DrawPosText : public SkDrawCommand {
280 public: 292 public:
281 DrawPosText(const void* text, size_t byteLength, const SkPoint pos[], 293 DrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
282 const SkPaint& paint); 294 const SkPaint& paint);
295 virtual ~DrawPosText() { delete [] fPos; delete [] fText; }
283 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 296 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
284 private: 297 private:
285 const SkPoint* fPos; 298 SkPoint* fPos;
286 const void* fText; 299 char* fText;
287 size_t fByteLength; 300 size_t fByteLength;
288 const SkPaint* fPaint; 301 SkPaint fPaint;
289 }; 302 };
290 303
291 class DrawTextOnPath : public SkDrawCommand { 304 class DrawTextOnPath : public SkDrawCommand {
292 public: 305 public:
293 DrawTextOnPath(const void* text, size_t byteLength, const SkPath& path, 306 DrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
294 const SkMatrix* matrix, const SkPaint& paint); 307 const SkMatrix* matrix, const SkPaint& paint);
295 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 308 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
296 private: 309 private:
297 const SkMatrix* fMatrix; 310 const SkMatrix* fMatrix;
298 const void* fText; 311 const void* fText;
299 size_t fByteLength; 312 size_t fByteLength;
300 const SkPath* fPath; 313 const SkPath* fPath;
301 const SkPaint* fPaint; 314 const SkPaint* fPaint;
302 }; 315 };
303 316
304 class DrawPosTextH : public SkDrawCommand { 317 class DrawPosTextH : public SkDrawCommand {
305 public: 318 public:
306 DrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], 319 DrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
307 SkScalar constY, const SkPaint& paint); 320 SkScalar constY, const SkPaint& paint);
321 virtual ~DrawPosTextH() { delete [] fXpos; delete [] fText; }
308 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 322 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
309 private: 323 private:
310 const SkScalar* fXpos; 324 SkScalar* fXpos;
311 const void* fText; 325 char* fText;
312 size_t fByteLength; 326 size_t fByteLength;
313 SkScalar fConstY; 327 SkScalar fConstY;
314 SkPaint fPaint; 328 SkPaint fPaint;
315 329
316 typedef SkDrawCommand INHERITED; 330 typedef SkDrawCommand INHERITED;
317 }; 331 };
318 332
319 class DrawRectC : public SkDrawCommand { 333 class DrawRectC : public SkDrawCommand {
320 public: 334 public:
321 DrawRectC(const SkRect& rect, const SkPaint& paint); 335 DrawRectC(const SkRect& rect, const SkPaint& paint);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 455
442 SkScalar x() const { return fDx; } 456 SkScalar x() const { return fDx; }
443 SkScalar y() const { return fDy; } 457 SkScalar y() const { return fDy; }
444 458
445 private: 459 private:
446 SkScalar fDx; 460 SkScalar fDx;
447 SkScalar fDy; 461 SkScalar fDy;
448 }; 462 };
449 463
450 #endif 464 #endif
OLDNEW
« no previous file with comments | « debugger/SkDebugCanvas.cpp ('k') | debugger/SkDrawCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698