convert over to 2d-mode

 [√] convert all stages to use SkJumper_MemoryCtx / be 2d-compatible
 [√] convert compile to 2d also, remove 1d run/compile
 [√] convert all call sites
 [√] no diffs

Change-Id: I3b806eb8fe0c3ec043359616409f7cd1211a1e43
Reviewed-on: https://skia-review.googlesource.com/24263
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp
index a2981ca..02e6ff2 100644
--- a/src/codec/SkWebpCodec.cpp
+++ b/src/codec/SkWebpCodec.cpp
@@ -16,6 +16,7 @@
 #include "SkStreamPriv.h"
 #include "SkTemplates.h"
 #include "SkWebpCodec.h"
+#include "../jumper/SkJumper.h"
 
 // A WebP decoder on top of (subset of) libwebp
 // For more information on WebP image format, and libwebp library, see:
@@ -351,7 +352,7 @@
 }
 
 static void blend_line(SkColorType dstCT, void* dst,
-                       SkColorType srcCT, void* src,
+                       SkColorType srcCT, const void* src,
                        bool needsSrgbToLinear, SkAlphaType at,
                        int width) {
     // Setup conversion from the source and dest, which will be the same.
@@ -364,19 +365,22 @@
         convert_to_linear_premul.append(SkRasterPipeline::premul);
     }
 
+    SkJumper_MemoryCtx dst_ctx = { (void*)dst, 0 },
+                       src_ctx = { (void*)src, 0 };
+
     SkRasterPipeline_<256> p;
     SkRasterPipeline::StockStage load_dst, store_dst;
     pick_memory_stages(dstCT, &load_dst, &store_dst);
 
     // Load the final dst.
-    p.append(load_dst, dst);
+    p.append(load_dst, &dst_ctx);
     p.extend(convert_to_linear_premul);
     p.append(SkRasterPipeline::move_src_dst);
 
     // Load the src.
     SkRasterPipeline::StockStage load_src;
     pick_memory_stages(srcCT, &load_src, nullptr);
-    p.append(load_src, src);
+    p.append(load_src, &src_ctx);
     p.extend(convert_to_linear_premul);
 
     p.append(SkRasterPipeline::srcover);
@@ -388,9 +392,9 @@
     if (needsSrgbToLinear) {
         p.append(SkRasterPipeline::to_srgb);
     }
-    p.append(store_dst, dst);
+    p.append(store_dst, &dst_ctx);
 
-    p.run(0,0, width);
+    p.run(0,0, width,1);
 }
 
 SkCodec::Result SkWebpCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t rowBytes,
@@ -601,7 +605,7 @@
         for (int y = 0; y < rowsDecoded; y++) {
             this->applyColorXform(xformDst, xformSrc, scaledWidth, xformAlphaType);
             if (blendWithPrevFrame) {
-                blend_line(dstCT, &dst, dstCT, &xformDst, needsSrgbToLinear, xformAlphaType,
+                blend_line(dstCT, dst, dstCT, xformDst, needsSrgbToLinear, xformAlphaType,
                         scaledWidth);
                 dst = SkTAddOffset<void>(dst, rowBytes);
             } else {
@@ -613,7 +617,7 @@
         const uint8_t* src = config.output.u.RGBA.rgba;
 
         for (int y = 0; y < rowsDecoded; y++) {
-            blend_line(dstCT, &dst, webpDst.colorType(), &src, needsSrgbToLinear,
+            blend_line(dstCT, dst, webpDst.colorType(), src, needsSrgbToLinear,
                     xformAlphaType, scaledWidth);
             src = SkTAddOffset<const uint8_t>(src, srcRowBytes);
             dst = SkTAddOffset<void>(dst, rowBytes);