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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « debugger/SkDebugCanvas.cpp ('k') | debugger/SkDrawCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: debugger/SkDrawCommand.h
===================================================================
--- debugger/SkDrawCommand.h (revision 9288)
+++ debugger/SkDrawCommand.h (working copy)
@@ -11,10 +11,12 @@
#include "SkPictureFlat.h"
#include "SkCanvas.h"
+#include "SkString.h"
class SkDrawCommand {
public:
/* TODO(chudy): Remove subclasses. */
+ SkDrawCommand(DrawType drawType);
SkDrawCommand();
virtual ~SkDrawCommand();
@@ -240,6 +242,41 @@
typedef SkDrawCommand INHERITED;
};
+class BeginCommentGroup : public SkDrawCommand {
+public:
+ BeginCommentGroup(const char* description);
+ virtual void execute(SkCanvas* canvas) SK_OVERRIDE {
+ canvas->beginCommentGroup(fDescription.c_str());
+ };
+private:
+ SkString fDescription;
+
+ typedef SkDrawCommand INHERITED;
+};
+
+class Comment : public SkDrawCommand {
+public:
+ Comment(const char* kywd, const char* value);
+ virtual void execute(SkCanvas* canvas) SK_OVERRIDE {
+ canvas->addComment(fKywd.c_str(), fValue.c_str());
+ };
+private:
+ SkString fKywd;
+ SkString fValue;
+
+ typedef SkDrawCommand INHERITED;
+};
+
+class EndCommentGroup : public SkDrawCommand {
+public:
+ EndCommentGroup();
+ virtual void execute(SkCanvas* canvas) SK_OVERRIDE {
+ canvas->endCommentGroup();
+ };
+private:
+ typedef SkDrawCommand INHERITED;
+};
+
class DrawOval : public SkDrawCommand {
public:
DrawOval(const SkRect& oval, const SkPaint& paint);
« 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