aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/F16StagesTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-07-18 18:15:13 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-20 19:50:32 +0000
commit45c16fa82cd2fec010d4cb7763b654a413cabd0c (patch)
tree2c6e4376e11dca4b4c3ae479b7835096124016f5 /tests/F16StagesTest.cpp
parent3f4671871fac8e5439440ce756d0666bc2a96f46 (diff)
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>
Diffstat (limited to 'tests/F16StagesTest.cpp')
-rw-r--r--tests/F16StagesTest.cpp41
1 files changed, 21 insertions, 20 deletions
diff --git a/tests/F16StagesTest.cpp b/tests/F16StagesTest.cpp
index 51cb861c89..d07f6ba4a7 100644
--- a/tests/F16StagesTest.cpp
+++ b/tests/F16StagesTest.cpp
@@ -7,6 +7,7 @@
#include "SkRasterPipeline.h"
#include "Test.h"
+#include "../src/jumper/SkJumper.h"
DEF_TEST(F16Stages, r) {
// Make sure SkRasterPipeline::load_f16 and store_f16 can handle a range of
@@ -18,36 +19,36 @@ DEF_TEST(F16Stages, r) {
};
uint16_t halfs[16] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
- float* f32 = floats;
- uint16_t* f16 = halfs;
+ SkJumper_MemoryCtx f32 = { floats, 0 },
+ f16 = { halfs, 0 };
{
SkRasterPipeline_<256> p;
p.append(SkRasterPipeline:: load_f32, &f32);
p.append(SkRasterPipeline::store_f16, &f16);
- p.run(0,0,16/4);
+ p.run(0,0,16/4,1);
}
- REPORTER_ASSERT(r, f16[0] == 0x0000);
- REPORTER_ASSERT(r, f16[1] == 0x3400);
- REPORTER_ASSERT(r, f16[2] == 0x3800);
- REPORTER_ASSERT(r, f16[3] == 0x3c00);
- REPORTER_ASSERT(r, f16[4] == 0xbd00);
- REPORTER_ASSERT(r, f16[5] == 0xb800);
- REPORTER_ASSERT(r, f16[6] == 0x3d00);
- REPORTER_ASSERT(r, f16[7] == 0x4000);
+ REPORTER_ASSERT(r, halfs[0] == 0x0000);
+ REPORTER_ASSERT(r, halfs[1] == 0x3400);
+ REPORTER_ASSERT(r, halfs[2] == 0x3800);
+ REPORTER_ASSERT(r, halfs[3] == 0x3c00);
+ REPORTER_ASSERT(r, halfs[4] == 0xbd00);
+ REPORTER_ASSERT(r, halfs[5] == 0xb800);
+ REPORTER_ASSERT(r, halfs[6] == 0x3d00);
+ REPORTER_ASSERT(r, halfs[7] == 0x4000);
{
SkRasterPipeline_<256> p;
p.append(SkRasterPipeline:: load_f16, &f16);
p.append(SkRasterPipeline::store_f32, &f32);
- p.run(0,0,16/4);
+ p.run(0,0,16/4,1);
}
- REPORTER_ASSERT(r, f32[0] == 0.00f);
- REPORTER_ASSERT(r, f32[1] == 0.25f);
- REPORTER_ASSERT(r, f32[2] == 0.50f);
- REPORTER_ASSERT(r, f32[3] == 1.00f);
- REPORTER_ASSERT(r, f32[4] == -1.25f);
- REPORTER_ASSERT(r, f32[5] == -0.50f);
- REPORTER_ASSERT(r, f32[6] == 1.25f);
- REPORTER_ASSERT(r, f32[7] == 2.00f);
+ REPORTER_ASSERT(r, floats[0] == 0.00f);
+ REPORTER_ASSERT(r, floats[1] == 0.25f);
+ REPORTER_ASSERT(r, floats[2] == 0.50f);
+ REPORTER_ASSERT(r, floats[3] == 1.00f);
+ REPORTER_ASSERT(r, floats[4] == -1.25f);
+ REPORTER_ASSERT(r, floats[5] == -0.50f);
+ REPORTER_ASSERT(r, floats[6] == 1.25f);
+ REPORTER_ASSERT(r, floats[7] == 2.00f);
}