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/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index cf8d4ba..a299369 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -44,6 +44,7 @@
#include "SkTLogic.h"
#include <cmath>
#include <functional>
+#include "../src/jumper/SkJumper.h"
#if defined(SK_BUILD_FOR_WIN)
#include "SkAutoCoInitialize.h"
@@ -324,15 +325,14 @@
}
switch (bitmap.colorType()) {
- case kRGBA_F16_SkColorType:
- for (int y = 0; y < bitmap.height(); y++) {
- void* row = bitmap.getAddr(0, y);
- SkRasterPipeline_<256> p;
- p.append(SkRasterPipeline::load_f16, &row);
- p.append(SkRasterPipeline::premul);
- p.append(SkRasterPipeline::store_f16, &row);
- p.run(0,y, bitmap.width());
- }
+ case kRGBA_F16_SkColorType: {
+ SkJumper_MemoryCtx ctx = { bitmap.getAddr(0,0), bitmap.rowBytesAsPixels() };
+ SkRasterPipeline_<256> p;
+ p.append(SkRasterPipeline::load_f16, &ctx);
+ p.append(SkRasterPipeline::premul);
+ p.append(SkRasterPipeline::store_f16, &ctx);
+ p.run(0,0, bitmap.width(), bitmap.height());
+ }
break;
case kN32_SkColorType:
for (int y = 0; y < bitmap.height(); y++) {
@@ -1020,7 +1020,8 @@
return;
}
- void* ptr = bitmap.getAddr(0, 0);
+ SkJumper_MemoryCtx ptr = { bitmap.getAddr(0,0), bitmap.rowBytesAsPixels() };
+
SkRasterPipeline_<256> p;
p.append(SkRasterPipeline::load_f16, &ptr);
p.append(SkRasterPipeline::clamp_0);
@@ -1031,11 +1032,7 @@
}
p.append(SkRasterPipeline::store_f16, &ptr);
- auto run = p.compile();
- for (int y = 0; y < bitmap.height(); y++) {
- run(0, y, bitmap.width());
- ptr = SkTAddOffset<void>(ptr, bitmap.rowBytes());
- }
+ p.run(0,0, bitmap.width(), bitmap.height());
}
Error ColorCodecSrc::draw(SkCanvas* canvas) const {