aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-02-09 15:41:36 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-09 15:41:36 -0800
commit126626e52310b39429ad5eaa8e68e0caa24e6202 (patch)
treef3037609300c28c3adf4cc3da61057dbb2435c08 /bench
parentc023210893da7ca407bad8c9f07c8339ee81854c (diff)
Sk4f: add floor()
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1685773002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/86c6c4935171a1d2d6a9ffbff37ec6dac1326614 CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release-Trybot,Test-Android-GCC-Nexus9-GPU-TegraK1-Arm64-Release-Trybot Review URL: https://codereview.chromium.org/1685773002
Diffstat (limited to 'bench')
-rw-r--r--bench/Sk4fBench.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/bench/Sk4fBench.cpp b/bench/Sk4fBench.cpp
index d5201fa2f0..a932c295d4 100644
--- a/bench/Sk4fBench.cpp
+++ b/bench/Sk4fBench.cpp
@@ -40,6 +40,22 @@ DEF_BENCH(return new Sk4fRoundtripBench<uint8_t>;)
DEF_BENCH(return new Sk4fRoundtripBench<uint16_t>;)
DEF_BENCH(return new Sk4fRoundtripBench<int>;)
+struct Sk4fFloorBench : public Benchmark {
+ Sk4fFloorBench() {}
+
+ const char* onGetName() override { return "Sk4f_floor"; }
+ bool isSuitableFor(Backend backend) override { return backend == kNonRendering_Backend; }
+
+ void onDraw(int loops, SkCanvas* canvas) override {
+ Sk4f fs(1,2,3,4);
+ while (loops --> 0) {
+ fs = fs.floor();
+ }
+ fs.store((float*)blackhole);
+ }
+};
+DEF_BENCH(return new Sk4fFloorBench;)
+
struct Sk4fGradientBench : public Benchmark {
const char* onGetName() override { return "Sk4f_gradient"; }
bool isSuitableFor(Backend backend) override { return backend == kNonRendering_Backend; }