diff options
author | Mike Klein <mtklein@chromium.org> | 2017-09-22 15:32:59 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-22 22:06:08 +0000 |
commit | f3b4e16c36a6c789fc129aa3bd15c34b44ee8743 (patch) | |
tree | 441fddf9ad89c5d606b40ac2597bfc5844fea7ec /tests/SkRasterPipelineTest.cpp | |
parent | 6f67cf7c4e14a65a54ee1fc67e81e5aa3d1e3d0e (diff) |
Fold clamp_{x,y} into the gathers.
All three image tile modes go through exclusive_clamp() and then a
gather today, so we can move the work of exclusive_clamp() into eac
gather_ stage, eliminating the need for clamp_{x,y} stages.
Luckily, we've got a convenient place to bottleneck this, ptr_and_ix(),
which works out the pointer and vector of indices to load for gathers.
This deletes SkRasterPipeline_repeat_tiling unit test, which now
no longer exactly makes sense. It tests that repeat_x does that
clamp, but that's now done automatically outside that stage.
Change-Id: I24637ef60921bec7aa00082984c0c6a49dd86ca9
Reviewed-on: https://skia-review.googlesource.com/50260
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'tests/SkRasterPipelineTest.cpp')
-rw-r--r-- | tests/SkRasterPipelineTest.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/tests/SkRasterPipelineTest.cpp b/tests/SkRasterPipelineTest.cpp index a3b2045ce1..bab3d5b63b 100644 --- a/tests/SkRasterPipelineTest.cpp +++ b/tests/SkRasterPipelineTest.cpp @@ -262,37 +262,3 @@ DEF_TEST(SkRasterPipeline_2d, r) { REPORTER_ASSERT(r, ((rgba[2] >> 8) & 0xff) == 128); REPORTER_ASSERT(r, ((rgba[3] >> 8) & 0xff) == 128); } - -DEF_TEST(SkRasterPipeline_repeat_tiling, r) { - // Repeat tiling works roughly like - // v' = v - floor(v / limit) * limit - // - // If v = 19133558.0f and limit = 9.0f, that's - // - // v' = 19133558.0f - floor(19133558.0f / 9.0f) * 9.0f - // - // The problem comes with that division term. In infinite precision, - // that'd be 2125950 + 8/9, but the nearest float is 2125951.0f. - // - // Then 2125951.0f * 9.0f = 19133559.0f, which is greater than v, - // so v' becomes negative. :'( - - // Here's a regression test to make sure this doesn't happen. - float in[4 * SkJumper_kMaxStride]; - float out[4 * SkJumper_kMaxStride]; - for (float& f : in) { - f = 0; - } - in[0] = 19133558.0f; - - SkJumper_TileCtx tile = { 9.0f, 1/9.0f }; - - SkSTArenaAlloc<256> alloc; - SkRasterPipeline p(&alloc); - p.append(SkRasterPipeline::load_rgba, in); - p.append(SkRasterPipeline::repeat_x, &tile); - p.append(SkRasterPipeline::store_rgba, out); - p.run(0,0,1,1); - - REPORTER_ASSERT(r, 0.0f <= out[0] && out[0] < 9.0f); -} |