aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkRasterPipelineTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-06-02 10:03:30 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-04 22:50:14 +0000
commitbba02c203190a19bce7eb60887c4ae64041c8ae8 (patch)
tree4cd3376751a145f5e70e9bc6ea1c5c1c03f1b525 /tests/SkRasterPipelineTest.cpp
parentf4e498601755073fb43cdbe8db02f236ce1249a3 (diff)
start on SkJumper lowp mode
Just 3 stages implemented so far: load_8888 swap_rb store_8888 That's enough to make the shortest non-trivial pipeline that you see in the new unit test. Change-Id: Iabf90866ab452f7183d8c8dec1405ece2db695dc Reviewed-on: https://skia-review.googlesource.com/18458 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'tests/SkRasterPipelineTest.cpp')
-rw-r--r--tests/SkRasterPipelineTest.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/SkRasterPipelineTest.cpp b/tests/SkRasterPipelineTest.cpp
index f65a2c9868..014683c9b9 100644
--- a/tests/SkRasterPipelineTest.cpp
+++ b/tests/SkRasterPipelineTest.cpp
@@ -205,3 +205,31 @@ DEF_TEST(SkRasterPipeline_tail, r) {
}
}
}
+
+DEF_TEST(SkRasterPipeline_lowp, r) {
+ uint32_t rgba[64];
+ for (int i = 0; i < 64; i++) {
+ rgba[i] = (4*i+0) << 0
+ | (4*i+1) << 8
+ | (4*i+2) << 16
+ | (4*i+3) << 24;
+ }
+
+ void* ptr = rgba;
+
+ SkRasterPipeline_<256> p;
+ p.append(SkRasterPipeline::load_8888, &ptr);
+ p.append(SkRasterPipeline::swap_rb);
+ p.append(SkRasterPipeline::store_8888, &ptr);
+ p.run(0,0,64);
+
+ for (int i = 0; i < 64; i++) {
+ uint32_t want = (4*i+0) << 16
+ | (4*i+1) << 8
+ | (4*i+2) << 0
+ | (4*i+3) << 24;
+ if (rgba[i] != want) {
+ ERRORF(r, "got %08x, want %08x\n", rgba[i], want);
+ }
+ }
+}