aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRasterPipeline.h
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-10-10 14:23:37 +0000
committerGravatar Mike Klein <mtklein@chromium.org>2016-10-10 14:32:01 +0000
commit42f4b42e8311f168aeeadd939b476c05b329500e (patch)
tree04807739ce53135bc925f483a3b9da938280311a /src/core/SkRasterPipeline.h
parente61b3b4018a3e139e9ae19d2c47dc59deeaedd16 (diff)
Revert "SkRasterPipeline: 8x pipelines, attempt 2"
This reverts commit Id0ba250037e271a9475fe2f0989d64f0aa909bae. crbug.com/654213 Looks like Chrome Canary's picking up Haswell code on non-Haswell machines. Change-Id: I16f976da24db86d5c99636c472ffad56db213a2a Reviewed-on: https://skia-review.googlesource.com/3108 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.h32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h
index 3ef8c50d9f..996c7838e3 100644
--- a/src/core/SkRasterPipeline.h
+++ b/src/core/SkRasterPipeline.h
@@ -56,28 +56,22 @@
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.
- ((Fn)fNext)(this+1, x,tail, v0,v1,v2,v3, v4,v5,v6,v7);
+ fNext(this+1, x,tail, v0,v1,v2,v3, v4,v5,v6,v7);
}
// It makes next() a good bit cheaper if we hold the next function to call here,
// rather than logically simpler choice of the function implementing this stage.
- void (*fNext)();
+ Fn fNext;
void* fCtx;
};
@@ -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,18 +134,24 @@ 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&);
private:
using Stages = SkSTArray<10, Stage, /*MEM_COPY=*/true>;
- void append(void (*body)(), void (*tail)(), void*);
+ 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;
- void (*fBodyStart)() = nullptr;
- void (*fTailStart)() = nullptr;
+ Fn fBodyStart = &JustReturn,
+ fTailStart = &JustReturn;
};
#endif//SkRasterPipeline_DEFINED