diff options
author | 2016-11-30 09:55:08 -0500 | |
---|---|---|
committer | 2016-11-30 15:44:36 +0000 | |
commit | 94528981c8f668280fd56aea75fd720078f4ea3c (patch) | |
tree | d6b19e7fa7483aa9552f96239a840b8fa2c42741 /src | |
parent | c5619cd1702759990f278ed87c3654a292f044d1 (diff) |
restore sRGB memset optimization
https://skia-review.googlesource.com/c/5275/ removed it, and perf noticed.
This is obviously not very pretty or scalable. I plan to folow up with a more thorough and principled way to do this sort of constant-color + invariant-stage == constant-color optimization.
BUG=skia:6013
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Change-Id: I377386f67e66169cce6e0cb0831f3b7154496840
Reviewed-on: https://skia-review.googlesource.com/5338
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/opts/SkRasterPipeline_opts.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h index a40fe6c72e..163b9ebbf0 100644 --- a/src/opts/SkRasterPipeline_opts.h +++ b/src/opts/SkRasterPipeline_opts.h @@ -897,6 +897,29 @@ namespace SK_OPTS_NS { default: break; } } + if (nstages == 3 && stages[0].stage == SkRasterPipeline::constant_color + && stages[1].stage == SkRasterPipeline::to_srgb + && stages[2].stage == SkRasterPipeline::store_8888) { + auto src = (const SkPM4f*)stages[0].ctx; + auto dst = (uint32_t**)stages[2].ctx; + return Memset32{dst, Sk4f_toS32(src->to4f())}; + } + if (nstages == 4 && stages[0].stage == SkRasterPipeline::constant_color + && stages[1].stage == SkRasterPipeline::to_srgb + && stages[2].stage == SkRasterPipeline::swap_rb + && stages[3].stage == SkRasterPipeline::store_8888) { + auto src = (const SkPM4f*)stages[0].ctx; + auto dst = (uint32_t**)stages[3].ctx; + return Memset32{dst, Sk4f_toS32(swizzle_rb(src->to4f())) }; + } + if (nstages == 4 && stages[0].stage == SkRasterPipeline::constant_color + && stages[1].stage == SkRasterPipeline::swap_rb + && stages[2].stage == SkRasterPipeline::to_srgb + && stages[3].stage == SkRasterPipeline::store_8888) { + auto src = (const SkPM4f*)stages[0].ctx; + auto dst = (uint32_t**)stages[3].ctx; + return Memset32{dst, Sk4f_toS32(swizzle_rb(src->to4f())) }; + } struct Compiled { Compiled(const SkRasterPipeline::Stage* stages, int nstages) { |