aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-02-09 13:46:49 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-09 13:46:49 -0800
commit86c6c4935171a1d2d6a9ffbff37ec6dac1326614 (patch)
tree500badd83fef02cc26d45ab047ce38fb7efd4568 /bench
parentb8d6e088590160f1198110c2371b802c1d541a36 (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 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; }