aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRasterPipeline.h
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-10-07 13:16:35 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-07 13:16:54 +0000
commit942858774831fea6e3f5f9d6c39b9538cf031bfd (patch)
tree69506ff13179ef4076f43d069ebc10707c8cea05 /src/core/SkRasterPipeline.h
parent3786c7716c4796146835e60d7145cff252ed50bd (diff)
Revert "SkRasterPipeline: 8x pipelines"
This reverts commit I1c82e5755d8e44cc0b9c6673d04b117f85d71a3a. Reason for revert: lots of failing bots. TBR=mtklein@chromium.org,msarett@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I653bed3905187f43196504f19424985fa2a765b5 Reviewed-on: https://skia-review.googlesource.com/3063 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkRasterPipeline.h')
-rw-r--r--src/core/SkRasterPipeline.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h
index 9c4ae47d19..996c7838e3 100644
--- a/src/core/SkRasterPipeline.h
+++ b/src/core/SkRasterPipeline.h
@@ -56,20 +56,14 @@
class SkRasterPipeline {
public:
struct Stage;
-#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);
-
+ using Fn = void(SK_VECTORCALL *)(Stage*, size_t, size_t, Sk4f,Sk4f,Sk4f,Sk4f,
+ Sk4f,Sk4f,Sk4f,Sk4f);
struct Stage {
template <typename T>
T ctx() { return static_cast<T>(fCtx); }
- 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) {
+ 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) {
// 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);
@@ -90,8 +84,6 @@ public:
void run(size_t n) { this->run(0, n); }
enum StockStage {
- just_return,
-
store_565,
store_srgb,
store_f16,
@@ -142,6 +134,7 @@ 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&);
@@ -150,10 +143,15 @@ 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 = nullptr,
- fTailStart = nullptr;
+ Fn fBodyStart = &JustReturn,
+ fTailStart = &JustReturn;
};
#endif//SkRasterPipeline_DEFINED