aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkOpts.h
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-09-29 09:04:15 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-09-29 16:20:26 +0000
commitbaaf8ad95237d1defdb7d93077d9bf8410d8ad7f (patch)
tree4635750d0b6c5b792a6d0e226e7fe8042a394fa9 /src/core/SkOpts.h
parent8e6791fb9a79c38228339ffc5c75d73b58893fa8 (diff)
Start moving SkRasterPipeline stages to SkOpts.
This lets them pick up runtime CPU specializations. Here I've plugged in SSE4.1. This is still one of the N prelude CLs to full 8-at-a-time AVX. I've moved the union of the stages used by SkRasterPipelineBench and SkRasterPipelineBlitter to SkOpts... they'll all be used by the blitter eventually. Picking up SSE4.1 specialization here (even still just 4 pixels at a time) is a significant speedup, especially to store_srgb(), so much that it's no longer really interesting to compare against the fused-but-default-instruction-set version in the bench. So that's gone now. That left the SkRasterPipeline unit test as the only other user of the EasyFn simplified interface to SkRasterPipeline. So I converted that back down to the bare-metal interface, and EasyFn and its friends became SkRasterPipeline_opts.h exclusive abbreviations (now called Kernel_Sk4f). This isn't really unexpected: SkXfermode also wanted to build up its own little abstractions, and once you build your own abstraction, the value of an additional EasyFn-like layer plummets to negative. For simplicity I've left the SkXfermode stages alone, except srcover() which was always part of the blitter. No particular reason except keeping the churn down while I hack. These _can_ be in SkOpts, but don't have to be until we go 8-at-a-time. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2752 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: I3b476b18232a1598d8977e425be2150059ab71dc Reviewed-on: https://skia-review.googlesource.com/2752 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkOpts.h')
-rw-r--r--src/core/SkOpts.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/SkOpts.h b/src/core/SkOpts.h
index 44e337d950..c310a79aa0 100644
--- a/src/core/SkOpts.h
+++ b/src/core/SkOpts.h
@@ -8,6 +8,7 @@
#ifndef SkOpts_DEFINED
#define SkOpts_DEFINED
+#include "SkRasterPipeline.h"
#include "SkTextureCompressor.h"
#include "SkTypes.h"
#include "SkXfermode.h"
@@ -71,6 +72,25 @@ namespace SkOpts {
static inline uint32_t hash(const void* data, size_t bytes, uint32_t seed=0) {
return hash_fn(data, bytes, seed);
}
+
+ // Each of the SkRasterPipeline::Fn's lists its context pointer type in the comments.
+
+ extern SkRasterPipeline::Fn srcover, // (none)
+ constant_color, // const SkPM4f*
+ lerp_constant_float; // const float*, in [0,1]
+
+ extern SkRasterPipeline::Fn load_d_srgb_body, load_d_srgb_tail, // const uint32_t*
+ load_s_srgb_body, load_s_srgb_tail, // const uint32_t*
+ store_srgb_body, store_srgb_tail, // uint32_t*
+ load_d_f16_body, load_d_f16_tail, // const uint64_t*
+ load_s_f16_body, load_s_f16_tail, // const uint64_t*
+ store_f16_body, store_f16_tail, // uint64_t*
+ load_d_565_body, load_d_565_tail, // const uint16_t*
+ load_s_565_body, load_s_565_tail, // const uint16_t*
+ store_565_body, store_565_tail, // uint16_t*
+ scale_u8_body, scale_u8_tail, // const uint8_t*
+ lerp_u8_body, lerp_u8_tail, // const uint8_t*
+ lerp_565_body, lerp_565_tail; // const uint16_t*
}
#endif//SkOpts_DEFINED