Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2970)

Unified Diff: bench/Sk4fBench.cpp

Issue 1685773002: Sk4f: add floor() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add a bench Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkNx.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/Sk4fBench.cpp
diff --git a/bench/Sk4fBench.cpp b/bench/Sk4fBench.cpp
index d5201fa2f0a2292430454789562e57a4f1f7585a..a932c295d4aa2f9bab65c165b37bbebeee85e569 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; }
« no previous file with comments | « no previous file | src/core/SkNx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698