diff options
author | 2016-07-13 08:22:20 -0700 | |
---|---|---|
committer | 2016-07-13 08:22:20 -0700 | |
commit | 0abddf7bb7f77b1ff6a48efc9d1eafd053d975d2 (patch) | |
tree | e1c90476b5c025a6dd1c1ec172379dd5413037f4 /src/core/SkRasterPipeline.h | |
parent | f461e7c2277984783f43b5578044fc9a0c856e64 (diff) |
SkRasterPipeline: simplify impl and remove need to rewire stages
This builds the stages correctly wired from the get-go. With a little clever
setup, we can also design around the previous error cases like having no stages
or pipelines that call st->next() off the end.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2149443002
Review-Url: https://codereview.chromium.org/2149443002
Diffstat (limited to 'src/core/SkRasterPipeline.h')
-rw-r--r-- | src/core/SkRasterPipeline.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h index 8ae7bb1f2e..186ee654c2 100644 --- a/src/core/SkRasterPipeline.h +++ b/src/core/SkRasterPipeline.h @@ -96,9 +96,16 @@ public: private: using Stages = SkSTArray<10, Stage, /*MEM_COPY=*/true>; + // 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, Sk4f,Sk4f,Sk4f,Sk4f, + Sk4f,Sk4f,Sk4f,Sk4f); + Stages fBody, fTail; - bool fReadyToRun = false; + Fn fBodyStart = &JustReturn, + fTailStart = &JustReturn; }; #endif//SkRasterPipeline_DEFINED |