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/tools/picture_utils.cpp b/tools/picture_utils.cpp
index 93d598d..f476c0d 100644
--- a/tools/picture_utils.cpp
+++ b/tools/picture_utils.cpp
@@ -83,8 +83,8 @@
SkAutoTMalloc<uint32_t> rgba(w*h);
- const void* src = bitmap.getPixels();
- uint32_t* dst = rgba.get();
+ SkJumper_MemoryCtx src = { bitmap.getPixels(), bitmap.rowBytesAsPixels() },
+ dst = { rgba.get(), w };
SkRasterPipeline_<256> p;
switch (bitmap.colorType()) {
@@ -106,12 +106,7 @@
}
p.append(SkRasterPipeline::store_8888, &dst);
- auto run = p.compile();
- for (int y = 0; y < h; y++) {
- run(0,y, w);
- src = SkTAddOffset<const void>(src, bitmap.rowBytes());
- dst += w;
- }
+ p.run(0,0, w,h);
return SkData::MakeFromMalloc(rgba.release(), w*h*sizeof(uint32_t));
}