diff options
Diffstat (limited to 'bench/SkRasterPipelineBench.cpp')
-rw-r--r-- | bench/SkRasterPipelineBench.cpp | 45 |
1 files changed, 12 insertions, 33 deletions
diff --git a/bench/SkRasterPipelineBench.cpp b/bench/SkRasterPipelineBench.cpp index 7447f4d059..d911c5d7ad 100644 --- a/bench/SkRasterPipelineBench.cpp +++ b/bench/SkRasterPipelineBench.cpp @@ -22,16 +22,14 @@ static uint8_t mask[N]; // 8-bit linear // - src = srcover(dst, src) // - store src back as srgb/f16 -template <bool kF16, bool kCompiled> +template <bool kF16> class SkRasterPipelineBench : public Benchmark { public: bool isSuitableFor(Backend backend) override { return backend == kNonRendering_Backend; } const char* onGetName() override { - switch ((int)kCompiled << 1 | (int)kF16) { - case 0: return "SkRasterPipeline_srgb_run"; - case 1: return "SkRasterPipeline_f16_run"; - case 2: return "SkRasterPipeline_srgb_compile"; - case 3: return "SkRasterPipeline_f16_compile"; + switch ((int)kF16) { + case 0: return "SkRasterPipeline_srgb"; + case 1: return "SkRasterPipeline_f16"; } return "whoops"; } @@ -60,30 +58,19 @@ public: p.append(SkRasterPipeline::store_8888, &dst_ctx); } - if (kCompiled) { - auto compiled = p.compile(); - while (loops --> 0) { - compiled(0,N); - } - } else { - while (loops --> 0) { - p.run(0,N); - } + while (loops --> 0) { + p.run(0,N); } } }; -DEF_BENCH( return (new SkRasterPipelineBench< true, true>); ) -DEF_BENCH( return (new SkRasterPipelineBench<false, true>); ) -DEF_BENCH( return (new SkRasterPipelineBench< true, false>); ) -DEF_BENCH( return (new SkRasterPipelineBench<false, false>); ) +DEF_BENCH( return (new SkRasterPipelineBench< true>); ) +DEF_BENCH( return (new SkRasterPipelineBench<false>); ) -template <bool kCompiled> class SkRasterPipelineLegacyBench : public Benchmark { public: bool isSuitableFor(Backend backend) override { return backend == kNonRendering_Backend; } const char* onGetName() override { - return kCompiled ? "SkRasterPipeline_legacy_compile" - : "SkRasterPipeline_legacy_run"; + return "SkRasterPipeline_legacy"; } void onDraw(int loops, SkCanvas*) override { @@ -97,17 +84,9 @@ public: p.append(SkRasterPipeline::srcover); p.append(SkRasterPipeline::store_8888, &dst_ctx); - if (kCompiled) { - auto compiled = p.compile(); - while (loops --> 0) { - compiled(0,N); - } - } else { - while (loops --> 0) { - p.run(0,N); - } + while (loops --> 0) { + p.run(0,N); } } }; -DEF_BENCH( return (new SkRasterPipelineLegacyBench< true>); ) -DEF_BENCH( return (new SkRasterPipelineLegacyBench<false>); ) +DEF_BENCH( return (new SkRasterPipelineLegacyBench); ) |