diff options
author | Mike Klein <mtklein@chromium.org> | 2016-10-20 18:05:23 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-20 22:32:25 +0000 |
commit | 49372e69d3ad4497ee2d46f1ab363d10d3432471 (patch) | |
tree | 8fa56955046e58c665304fc063393fd86292432f /src | |
parent | 7cfd46aebda7b7d2b88e73621ed0d1be7244c2ca (diff) |
SkRasterPipeline_opts: split next() into next_body() and next_tail().
This may work around an Chrome/MSVC/PGO compiler crasher.
Even if not, it's harmless for performance, and arguably more readable.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3789
Change-Id: I0bf23f65d7832b9f43e275f85e7985fcd6b13b9f
Reviewed-on: https://skia-review.googlesource.com/3789
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/opts/SkRasterPipeline_opts.h | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h index f266433cd3..0759229608 100644 --- a/src/opts/SkRasterPipeline_opts.h +++ b/src/opts/SkRasterPipeline_opts.h @@ -33,12 +33,19 @@ using Tail = void(SK_VECTORCALL *)(SkRasterPipeline::Stage*, size_t, size_t, #define SI static inline -template <typename Fn, typename... Args> -SI void next(SkRasterPipeline::Stage* st, Args&&... args) { - // 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)st->fNext)(st+1, std::forward<Args>(args)...); +// 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. +SI void SK_VECTORCALL next_body(SkRasterPipeline::Stage* st, size_t x, + SkNf r, SkNf g, SkNf b, SkNf a, + SkNf dr, SkNf dg, SkNf db, SkNf da) { + ((Body)st->fNext)(st+1, x, r,g,b,a, dr,dg,db,da); } +SI void SK_VECTORCALL next_tail(SkRasterPipeline::Stage* st, size_t x, size_t tail, + SkNf r, SkNf g, SkNf b, SkNf a, + SkNf dr, SkNf dg, SkNf db, SkNf da) { + ((Tail)st->fNext)(st+1, x,tail, r,g,b,a, dr,dg,db,da); +} + #define STAGE(name, kCallNext) \ template <bool kIsTail> \ @@ -50,7 +57,7 @@ SI void next(SkRasterPipeline::Stage* st, Args&&... args) { SkNf dr, SkNf dg, SkNf db, SkNf da) { \ name##_kernel<false>(st->fCtx, x,0, r,g,b,a, dr,dg,db,da); \ if (kCallNext) { \ - next<Body>(st, x, r,g,b,a, dr,dg,db,da); \ + next_body(st, x, r,g,b,a, dr,dg,db,da); \ } \ } \ SI void SK_VECTORCALL name##_tail(SkRasterPipeline::Stage* st, size_t x, size_t tail, \ @@ -58,7 +65,7 @@ SI void next(SkRasterPipeline::Stage* st, Args&&... args) { SkNf dr, SkNf dg, SkNf db, SkNf da) { \ name##_kernel<true>(st->fCtx, x,tail, r,g,b,a, dr,dg,db,da); \ if (kCallNext) { \ - next<Tail>(st, x,tail, r,g,b,a, dr,dg,db,da); \ + next_tail(st, x,tail, r,g,b,a, dr,dg,db,da); \ } \ } \ template <bool kIsTail> \ @@ -78,7 +85,7 @@ SI void next(SkRasterPipeline::Stage* st, Args&&... args) { g = name##_kernel(g,a,dg,da); \ b = name##_kernel(b,a,db,da); \ a = name##_kernel(a,a,da,da); \ - next<Body>(st, x, r,g,b,a, dr,dg,db,da); \ + next_body(st, x, r,g,b,a, dr,dg,db,da); \ } \ SI void SK_VECTORCALL name##_tail(SkRasterPipeline::Stage* st, size_t x, size_t tail, \ SkNf r, SkNf g, SkNf b, SkNf a, \ @@ -87,7 +94,7 @@ SI void next(SkRasterPipeline::Stage* st, Args&&... args) { g = name##_kernel(g,a,dg,da); \ b = name##_kernel(b,a,db,da); \ a = name##_kernel(a,a,da,da); \ - next<Tail>(st, x,tail, r,g,b,a, dr,dg,db,da); \ + next_tail(st, x,tail, r,g,b,a, dr,dg,db,da); \ } \ static SK_ALWAYS_INLINE SkNf name##_kernel(const SkNf& s, const SkNf& sa, \ const SkNf& d, const SkNf& da) @@ -103,7 +110,7 @@ SI void next(SkRasterPipeline::Stage* st, Args&&... args) { g = name##_kernel(g,a,dg,da); \ b = name##_kernel(b,a,db,da); \ a = a + (da * (1.0f-a)); \ - next<Body>(st, x, r,g,b,a, dr,dg,db,da); \ + next_body(st, x, r,g,b,a, dr,dg,db,da); \ } \ SI void SK_VECTORCALL name##_tail(SkRasterPipeline::Stage* st, size_t x, size_t tail, \ SkNf r, SkNf g, SkNf b, SkNf a, \ @@ -112,7 +119,7 @@ SI void next(SkRasterPipeline::Stage* st, Args&&... args) { g = name##_kernel(g,a,dg,da); \ b = name##_kernel(b,a,db,da); \ a = a + (da * (1.0f-a)); \ - next<Tail>(st, x,tail, r,g,b,a, dr,dg,db,da); \ + next_tail(st, x,tail, r,g,b,a, dr,dg,db,da); \ } \ static SK_ALWAYS_INLINE SkNf name##_kernel(const SkNf& s, const SkNf& sa, \ const SkNf& d, const SkNf& da) |