aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/SkRasterPipelineBench.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-02-16 06:51:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-16 12:23:06 +0000
commit8729e5bbf7c436fd7c7c13182adbbfb419f566b5 (patch)
tree956ab4a697887e8529e311c34a44486875760239 /bench/SkRasterPipelineBench.cpp
parent394d414452a5d654731b0b5a3669f8e2420048b3 (diff)
Simplify more: remove SkRasterPipeline::compile().
It's easier to work on SkJumper if everything funnels through run(). I don't anticipate huge benefit from compile() without JITing, but it's something we can always put back if we find a need. Change-Id: Id5256fd21495e8195cad1924dbad81856416d913 Reviewed-on: https://skia-review.googlesource.com/8468 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'bench/SkRasterPipelineBench.cpp')
-rw-r--r--bench/SkRasterPipelineBench.cpp45
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); )