diff options
author | Mike Klein <mtklein@chromium.org> | 2016-10-12 09:52:55 -0400 |
---|---|---|
committer | Mike Klein <mtklein@chromium.org> | 2016-10-12 14:41:29 +0000 |
commit | 04adfda9c74481d0b640c0ce18864588babfcdf6 (patch) | |
tree | 034c424be3beb3da149766f7015726ef5af5545c /src/core/SkRasterPipeline.cpp | |
parent | 65a09274184ffd25d446352a96d3890ea7e625fa (diff) |
SkRasterPipeline: 8x pipelines, without any 8x code enabled.
Original review here: https://skia-review.googlesource.com/c/2990/
Second attempt here: https://skia-review.googlesource.com/c/3064/
This is the same as the second attempt, but with the change to SkOpts_hsw.cpp left out.
That omitted part is the key piece... this just lands the refactoring.
CQ_INCLUDE_TRYBOTS=master.client.skia:Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot,Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-GN,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Fast-Trybot;master.client.skia.compile:Build-Win-MSVC-x86_64-Debug-Trybot
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3242
Change-Id: Iaafa793a4854c2c9cd7e85cca3701bf871253f71
Reviewed-on: https://skia-review.googlesource.com/3242
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkRasterPipeline.cpp')
-rw-r--r-- | src/core/SkRasterPipeline.cpp | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/src/core/SkRasterPipeline.cpp b/src/core/SkRasterPipeline.cpp index 72d5b7b963..bc7feaccc7 100644 --- a/src/core/SkRasterPipeline.cpp +++ b/src/core/SkRasterPipeline.cpp @@ -8,11 +8,12 @@ #include "SkOpts.h" #include "SkRasterPipeline.h" -SkRasterPipeline::SkRasterPipeline() {} +SkRasterPipeline::SkRasterPipeline() { + fBodyStart = SkOpts::body[just_return]; + fTailStart = SkOpts::tail[just_return]; +} -void SkRasterPipeline::append(SkRasterPipeline::Fn body, - SkRasterPipeline::Fn tail, - void* ctx) { +void SkRasterPipeline::append(void (*body)(), void (*tail)(), void* ctx) { // Each stage holds its own context and the next function to call. // So the pipeline itself has to hold onto the first function that starts the pipeline. (fBody.empty() ? fBodyStart : fBody.back().fNext) = body; @@ -20,19 +21,19 @@ void SkRasterPipeline::append(SkRasterPipeline::Fn body, // Each last stage starts with its next function set to JustReturn as a safety net. // It'll be overwritten by the next call to append(). - fBody.push_back({ &JustReturn, ctx }); - fTail.push_back({ &JustReturn, ctx }); + fBody.push_back({ SkOpts::body[just_return], ctx }); + fTail.push_back({ SkOpts::tail[just_return], ctx }); } void SkRasterPipeline::append(StockStage stage, void* ctx) { - this->append(SkOpts::stages_4[stage], SkOpts::stages_1_3[stage], ctx); + this->append(SkOpts::body[stage], SkOpts::tail[stage], ctx); } void SkRasterPipeline::extend(const SkRasterPipeline& src) { SkASSERT(src.fBody.count() == src.fTail.count()); - Fn body = src.fBodyStart, - tail = src.fTailStart; + auto body = src.fBodyStart, + tail = src.fTailStart; for (int i = 0; i < src.fBody.count(); i++) { SkASSERT(src.fBody[i].fCtx == src.fTail[i].fCtx); this->append(body, tail, src.fBody[i].fCtx); @@ -42,18 +43,5 @@ void SkRasterPipeline::extend(const SkRasterPipeline& src) { } void SkRasterPipeline::run(size_t x, size_t n) { - // It's fastest to start uninitialized if the compilers all let us. If not, next fastest is 0. - Sk4f v; - - while (n >= 4) { - fBodyStart(fBody.begin(), x,0, v,v,v,v, v,v,v,v); - x += 4; - n -= 4; - } - if (n > 0) { - fTailStart(fTail.begin(), x,n, v,v,v,v, v,v,v,v); - } + SkOpts::run_pipeline(x,n, fBodyStart,fBody.begin(), fTailStart,fTail.begin()); } - -void SK_VECTORCALL SkRasterPipeline::JustReturn(Stage*, size_t, size_t, Sk4f,Sk4f,Sk4f,Sk4f, - Sk4f,Sk4f,Sk4f,Sk4f) {} |