First pass at Comment API

https://codereview.chromium.org/13957009/



git-svn-id: http://skia.googlecode.com/svn/trunk@9310 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/debugger/SkDrawCommand.cpp b/debugger/SkDrawCommand.cpp
index 8489397..0504fb5 100644
--- a/debugger/SkDrawCommand.cpp
+++ b/debugger/SkDrawCommand.cpp
@@ -12,6 +12,11 @@
 
 // TODO(chudy): Refactor into non subclass model.
 
+SkDrawCommand::SkDrawCommand(DrawType type) 
+    : fDrawType(type)
+    , fVisible(true) {
+}
+
 SkDrawCommand::SkDrawCommand() {
     fVisible = true;
 }
@@ -56,6 +61,9 @@
         case SKEW: return "Skew";
         case TRANSLATE: return "Translate";
         case NOOP: return "NoOp";
+        case BEGIN_COMMENT_GROUP: return "BeginCommentGroup";
+        case COMMENT: return "Comment";
+        case END_COMMENT_GROUP: return "EndCommentGroup";
         default:
             SkDebugf("DrawType error 0x%08x\n", type);
             SkASSERT(0);
@@ -298,6 +306,26 @@
     canvas->drawData(fData, fLength);
 }
 
+BeginCommentGroup::BeginCommentGroup(const char* description) 
+    : INHERITED(BEGIN_COMMENT_GROUP)
+    , fDescription(description) {
+    SkString* temp = new SkString;
+    temp->appendf("Description: %s", description);
+    fInfo.push(temp);
+}
+
+Comment::Comment(const char* kywd, const char* value)
+    : INHERITED(COMMENT)
+    , fKywd(kywd)
+    , fValue(value) {
+    SkString* temp = new SkString;
+    temp->appendf("%s: %s", kywd, value);
+    fInfo.push(temp);
+}
+
+EndCommentGroup::EndCommentGroup() : INHERITED(END_COMMENT_GROUP) {
+}
+
 DrawOval::DrawOval(const SkRect& oval, const SkPaint& paint) {
     fOval = oval;
     fPaint = paint;