Add SkNWayCanvas comment API overrides.
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Sat, 20 Jul 2013 15:03:26 +0000 (15:03 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Sat, 20 Jul 2013 15:03:26 +0000 (15:03 +0000)
SkNWayCanvas should also dispatch beginCommentGroup(), addComment() & endCommentGroup.

R=robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://chromiumcodereview.appspot.com/19723012

git-svn-id: http://skia.googlecode.com/svn/trunk@10224 2bbb7eff-a529-9590-31e7-b0007b416f81

include/utils/SkNWayCanvas.h
src/utils/SkNWayCanvas.cpp

index 9d7c430..5669cd0 100644 (file)
@@ -74,6 +74,10 @@ public:
     virtual SkBounder* setBounder(SkBounder*) SK_OVERRIDE;
     virtual SkDrawFilter* setDrawFilter(SkDrawFilter*) SK_OVERRIDE;
 
+    virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
+    virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
+    virtual void endCommentGroup() SK_OVERRIDE;
+
 private:
     SkTDArray<SkCanvas*> fList;
 
index bfc7a7a..5eebd01 100644 (file)
@@ -311,3 +311,24 @@ SkDrawFilter* SkNWayCanvas::setDrawFilter(SkDrawFilter* filter) {
     }
     return this->INHERITED::setDrawFilter(filter);
 }
+
+void SkNWayCanvas::beginCommentGroup(const char* description) {
+    Iter iter(fList);
+    while (iter.next()) {
+        iter->beginCommentGroup(description);
+    }
+}
+
+void SkNWayCanvas::addComment(const char* kywd, const char* value) {
+    Iter iter(fList);
+    while (iter.next()) {
+        iter->addComment(kywd, value);
+    }
+}
+
+void SkNWayCanvas::endCommentGroup() {
+    Iter iter(fList);
+    while (iter.next()) {
+        iter->endCommentGroup();
+    }
+}