diff options
author | Mike Klein <mtklein@chromium.org> | 2017-04-25 15:51:23 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-26 14:38:25 +0000 |
commit | c7be00366bb0171e2d247ea71e291a64e3d10254 (patch) | |
tree | 20c96690ed1b6a99cbd374f1c00da7d901da1314 /bench/SkRasterPipelineBench.cpp | |
parent | 21c131395fd032f962e138f7d91e654e1721e98c (diff) |
remove to_2dot2 and from_2dot2
The parametric_{r,g,b} stages are just as good now;
under the hood it's all going through approx_powf.
Change-Id: If7f3ae1e24fcee2ddb201c1d66ce1dd64820c89a
Reviewed-on: https://skia-review.googlesource.com/14320
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'bench/SkRasterPipelineBench.cpp')
-rw-r--r-- | bench/SkRasterPipelineBench.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/bench/SkRasterPipelineBench.cpp b/bench/SkRasterPipelineBench.cpp index fa2df4b3e1..f54efc546d 100644 --- a/bench/SkRasterPipelineBench.cpp +++ b/bench/SkRasterPipelineBench.cpp @@ -91,6 +91,13 @@ public: }; DEF_BENCH( return (new SkRasterPipelineLegacyBench); ) +static SkColorSpaceTransferFn gamma(float g) { + SkColorSpaceTransferFn fn = {0,0,0,0,0,0,0}; + fn.fG = g; + fn.fA = 1; + return fn; +} + class SkRasterPipeline_2dot2 : public Benchmark { public: bool isSuitableFor(Backend backend) override { return backend == kNonRendering_Backend; } @@ -100,10 +107,17 @@ public: void onDraw(int loops, SkCanvas*) override { SkColor4f c = { 1.0f, 1.0f, 1.0f, 1.0f }; + + SkColorSpaceTransferFn from_2dot2 = gamma( 2.2f), + to_2dot2 = gamma(1/2.2f); SkRasterPipeline p; p.append(SkRasterPipeline::constant_color, &c); - p.append(SkRasterPipeline::from_2dot2); - p.append(SkRasterPipeline::to_2dot2); + p.append(SkRasterPipeline::parametric_r, &from_2dot2); + p.append(SkRasterPipeline::parametric_g, &from_2dot2); + p.append(SkRasterPipeline::parametric_b, &from_2dot2); + p.append(SkRasterPipeline::parametric_r, & to_2dot2); + p.append(SkRasterPipeline::parametric_g, & to_2dot2); + p.append(SkRasterPipeline::parametric_b, & to_2dot2); while (loops --> 0) { p.run(0,N); |