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

Unified Diff: bench/XfermodeBench.cpp

Issue 1868333002: Add some benches for SkArithmeticMode. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Speculative win32 fix Created 4 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/XfermodeBench.cpp
diff --git a/bench/XfermodeBench.cpp b/bench/XfermodeBench.cpp
index 829c437e092e9eb3cd80b7ecaa735fd02a58975b..7d00f411bd05ce904fbf97a2229a7b62f5b2d869 100644
--- a/bench/XfermodeBench.cpp
+++ b/bench/XfermodeBench.cpp
@@ -6,6 +6,7 @@
*/
#include "Benchmark.h"
+#include "SkArithmeticMode.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkRandom.h"
@@ -22,9 +23,8 @@ public:
fName.printf("Xfermode_%s%s", SkXfermode::ModeName(mode), aa ? "_aa" : "");
}
- XfermodeBench(SkXfermode* xferMode, const char* name, bool aa) {
- SkASSERT(xferMode);
- fXfermode.reset(xferMode);
+ XfermodeBench(sk_sp<SkXfermode> xferMode, const char* name, bool aa) {
+ fXfermode = xferMode;
fAA = aa;
fName.printf("Xfermode_%s%s", name, aa ? "_aa" : "");
}
@@ -135,4 +135,13 @@ BENCH(SkXfermode::kSaturation_Mode)
BENCH(SkXfermode::kColor_Mode)
BENCH(SkXfermode::kLuminosity_Mode)
+DEF_BENCH( return new XfermodeBench(SkArithmeticMode::Make(0.2f, -0.3f, 1.5f, -0.7f, false), \
+ "arithmetic", false); )
+DEF_BENCH( return new XfermodeBench(SkArithmeticMode::Make(0.2f, -0.3f, 1.5f, -0.7f, true), \
+ "arithmetic_enforce_pm", false); )
+DEF_BENCH( return new XfermodeBench(SkArithmeticMode::Make(0.2f, -0.3f, 1.5f, -0.7f, false), \
+ "arithmetic", true); )
+DEF_BENCH( return new XfermodeBench(SkArithmeticMode::Make(0.2f, -0.3f, 1.5f, -0.7f, true), \
+ "arithmetic_enforce_pm", true); )
+
DEF_BENCH(return new XferCreateBench;)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698