Add SkRasterPipeline::dump().

Entirely for debugging.

TBR=herb@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4871

Change-Id: I6d6972c40b11854441f566c12516a2ec8c75c78f
Reviewed-on: https://skia-review.googlesource.com/4871
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
diff --git a/src/core/SkRasterPipeline.cpp b/src/core/SkRasterPipeline.cpp
index c768f1c..04d187d 100644
--- a/src/core/SkRasterPipeline.cpp
+++ b/src/core/SkRasterPipeline.cpp
@@ -25,3 +25,17 @@
 std::function<void(size_t, size_t, size_t)> SkRasterPipeline::compile() const {
     return SkOpts::compile_pipeline(fStages, fNum);
 }
+
+void SkRasterPipeline::dump() const {
+    SkDebugf("SkRasterPipeline, %d stages\n", fNum);
+    for (int i = 0; i < fNum; i++) {
+        const char* name = "";
+        switch (fStages[i].stage) {
+        #define M(x) case x: name = #x; break;
+            SK_RASTER_PIPELINE_STAGES(M)
+        #undef M
+        }
+        SkDebugf("\t%s\n", name);
+    }
+    SkDebugf("\n");
+}
diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h
index 2e7f3ee..45576a3 100644
--- a/src/core/SkRasterPipeline.h
+++ b/src/core/SkRasterPipeline.h
@@ -95,6 +95,8 @@
     // Runs the pipeline walking x through [x,x+n), holding y constant.
     std::function<void(size_t x, size_t y, size_t n)> compile() const;
 
+    void dump() const;
+
     struct Stage {
         StockStage stage;
         void*        ctx;