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
diff --git a/bench/Sk4fBench.cpp b/bench/Sk4fBench.cpp
index d5201fa..a932c29 100644
--- a/bench/Sk4fBench.cpp
+++ b/bench/Sk4fBench.cpp
@@ -40,6 +40,22 @@
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; }