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

Unified Diff: bench/Matrix44Bench.cpp

Issue 22872015: Add performance benchmark before landing perf improvements that remove sk_bezero in SkMatrix44 (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: real patch for landing, previous one is wrong Created 7 years, 4 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/Matrix44Bench.cpp
===================================================================
--- bench/Matrix44Bench.cpp (revision 10929)
+++ bench/Matrix44Bench.cpp (working copy)
@@ -58,6 +58,27 @@
typedef Matrix44Bench INHERITED;
};
+class SetIdentityMatrix44Bench : public Matrix44Bench {
+public:
+ SetIdentityMatrix44Bench(void* param) : INHERITED(param, "setidentity") {
+ double rowMajor[16] =
+ { 1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16};
+ mat.setRowMajord(rowMajor);
+ }
+protected:
+ virtual void performTest() {
+ for (int i = 0; i < 10; ++i) {
+ mat.setIdentity();
+ }
+ }
+private:
+ SkMatrix44 mat;
+ typedef Matrix44Bench INHERITED;
+};
+
class PreScaleMatrix44Bench : public Matrix44Bench {
public:
PreScaleMatrix44Bench(void* param) : INHERITED(param, "prescale") {
@@ -232,6 +253,7 @@
typedef Matrix44Bench INHERITED;
};
+DEF_BENCH( return new SetIdentityMatrix44Bench(p); )
DEF_BENCH( return new EqualsMatrix44Bench(p); )
DEF_BENCH( return new PreScaleMatrix44Bench(p); )
DEF_BENCH( return new PostScaleMatrix44Bench(p); )
« 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