diff options
Diffstat (limited to 'src/core/SkRasterPipeline.h')
-rw-r--r-- | src/core/SkRasterPipeline.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h index 996c7838e3..9c4ae47d19 100644 --- a/src/core/SkRasterPipeline.h +++ b/src/core/SkRasterPipeline.h @@ -56,14 +56,20 @@ class SkRasterPipeline { public: struct Stage; - using Fn = void(SK_VECTORCALL *)(Stage*, size_t, size_t, Sk4f,Sk4f,Sk4f,Sk4f, - Sk4f,Sk4f,Sk4f,Sk4f); +#if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_AVX2 + using V = Sk8f; +#else + using V = Sk4f; +#endif + using Fn = void(SK_VECTORCALL *)(Stage*, size_t, size_t, V,V,V,V, + V,V,V,V); + struct Stage { template <typename T> T ctx() { return static_cast<T>(fCtx); } - void SK_VECTORCALL next(size_t x, size_t tail, Sk4f v0, Sk4f v1, Sk4f v2, Sk4f v3, - Sk4f v4, Sk4f v5, Sk4f v6, Sk4f v7) { + void SK_VECTORCALL next(size_t x, size_t tail, V v0, V v1, V v2, V v3, + V v4, V v5, V v6, V v7) { // Stages are logically a pipeline, and physically are contiguous in an array. // To get to the next stage, we just increment our pointer to the next array element. fNext(this+1, x,tail, v0,v1,v2,v3, v4,v5,v6,v7); @@ -84,6 +90,8 @@ public: void run(size_t n) { this->run(0, n); } enum StockStage { + just_return, + store_565, store_srgb, store_f16, @@ -134,7 +142,6 @@ public: void append(StockStage, void* = nullptr); void append(StockStage stage, const void* ctx) { this->append(stage, const_cast<void*>(ctx)); } - // Append all stages to this pipeline. void extend(const SkRasterPipeline&); @@ -143,15 +150,10 @@ private: void append(Fn body, Fn tail, void*); - // This no-op default makes fBodyStart and fTailStart unconditionally safe to call, - // and is always the last stage's fNext as a sort of safety net to make sure even a - // buggy pipeline can't walk off its own end. - static void SK_VECTORCALL JustReturn(Stage*, size_t, size_t, Sk4f,Sk4f,Sk4f,Sk4f, - Sk4f,Sk4f,Sk4f,Sk4f); Stages fBody, fTail; - Fn fBodyStart = &JustReturn, - fTailStart = &JustReturn; + Fn fBodyStart = nullptr, + fTailStart = nullptr; }; #endif//SkRasterPipeline_DEFINED |