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

Side by Side Diff: debugger/SkDrawCommand.h

Issue 13957009: First pass at Comment API (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review issues Created 7 years, 6 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_
11 11
12 #include "SkPictureFlat.h" 12 #include "SkPictureFlat.h"
13 #include "SkCanvas.h" 13 #include "SkCanvas.h"
14 #include "SkString.h"
14 15
15 class SkDrawCommand { 16 class SkDrawCommand {
16 public: 17 public:
17 /* TODO(chudy): Remove subclasses. */ 18 /* TODO(chudy): Remove subclasses. */
19 SkDrawCommand(DrawType drawType);
18 SkDrawCommand(); 20 SkDrawCommand();
19 21
20 virtual ~SkDrawCommand(); 22 virtual ~SkDrawCommand();
21 23
22 virtual SkString toString(); 24 virtual SkString toString();
23 25
24 virtual const char* toCString() { 26 virtual const char* toCString() {
25 return GetCommandString(fDrawType); 27 return GetCommandString(fDrawType);
26 } 28 }
27 29
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 DrawData(const void* data, size_t length); 235 DrawData(const void* data, size_t length);
234 virtual ~DrawData() { delete [] fData; } 236 virtual ~DrawData() { delete [] fData; }
235 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 237 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
236 private: 238 private:
237 char* fData; 239 char* fData;
238 size_t fLength; 240 size_t fLength;
239 241
240 typedef SkDrawCommand INHERITED; 242 typedef SkDrawCommand INHERITED;
241 }; 243 };
242 244
245 class BeginCommentGroup : public SkDrawCommand {
246 public:
247 BeginCommentGroup(const char* description);
248 virtual void execute(SkCanvas* canvas) SK_OVERRIDE {
249 canvas->beginCommentGroup(fDescription.c_str());
250 };
251 private:
252 SkString fDescription;
253
254 typedef SkDrawCommand INHERITED;
255 };
256
257 class Comment : public SkDrawCommand {
258 public:
259 Comment(const char* kywd, const char* value);
260 virtual void execute(SkCanvas* canvas) SK_OVERRIDE {
261 canvas->addComment(fKywd.c_str(), fValue.c_str());
262 };
263 private:
264 SkString fKywd;
265 SkString fValue;
266
267 typedef SkDrawCommand INHERITED;
268 };
269
270 class EndCommentGroup : public SkDrawCommand {
271 public:
272 EndCommentGroup();
273 virtual void execute(SkCanvas* canvas) SK_OVERRIDE {
274 canvas->endCommentGroup();
275 };
276 private:
277 typedef SkDrawCommand INHERITED;
278 };
279
243 class DrawOval : public SkDrawCommand { 280 class DrawOval : public SkDrawCommand {
244 public: 281 public:
245 DrawOval(const SkRect& oval, const SkPaint& paint); 282 DrawOval(const SkRect& oval, const SkPaint& paint);
246 virtual void execute(SkCanvas* canvas) SK_OVERRIDE; 283 virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
247 private: 284 private:
248 SkRect fOval; 285 SkRect fOval;
249 SkPaint fPaint; 286 SkPaint fPaint;
250 287
251 typedef SkDrawCommand INHERITED; 288 typedef SkDrawCommand INHERITED;
252 }; 289 };
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 SkScalar y() const { return fDy; } 553 SkScalar y() const { return fDy; }
517 554
518 private: 555 private:
519 SkScalar fDx; 556 SkScalar fDx;
520 SkScalar fDy; 557 SkScalar fDy;
521 558
522 typedef SkDrawCommand INHERITED; 559 typedef SkDrawCommand INHERITED;
523 }; 560 };
524 561
525 #endif 562 #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