diff options
author | 2016-07-22 08:53:26 -0700 | |
---|---|---|
committer | 2016-07-22 08:53:26 -0700 | |
commit | 3011e337693a9786f62d8de9ac4b239ad6dbdaca (patch) | |
tree | 757e3e86b8d8918debff3d68cfa3a03b78b303a3 /src/core/SkRasterPipeline.cpp | |
parent | d50e2401787dc5632453293b65f8255b12450b9b (diff) |
Add SkRasterPipeline blitter.
This is now pixel-exact with the existing sRGB SW impl as far as I've tested.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146413002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
Review-Url: https://codereview.chromium.org/2146413002
Diffstat (limited to 'src/core/SkRasterPipeline.cpp')
-rw-r--r-- | src/core/SkRasterPipeline.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/core/SkRasterPipeline.cpp b/src/core/SkRasterPipeline.cpp index 899142886c..c50383af01 100644 --- a/src/core/SkRasterPipeline.cpp +++ b/src/core/SkRasterPipeline.cpp @@ -22,11 +22,23 @@ void SkRasterPipeline::append(SkRasterPipeline::Fn body_fn, const void* body_ctx fTail.push_back({ &JustReturn, const_cast<void*>(tail_ctx) }); } -void SkRasterPipeline::run(size_t n) { +void SkRasterPipeline::extend(const SkRasterPipeline& src) { + SkASSERT(src.fBody.count() == src.fTail.count()); + + Fn body_fn = src.fBodyStart, + tail_fn = src.fTailStart; + for (int i = 0; i < src.fBody.count(); i++) { + this->append(body_fn, src.fBody[i].fCtx, + tail_fn, src.fTail[i].fCtx); + body_fn = src.fBody[i].fNext; + tail_fn = src.fTail[i].fNext; + } +} + +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; - size_t x = 0; while (n >= 4) { fBodyStart(fBody.begin(), x, v,v,v,v, v,v,v,v); x += 4; |