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

Side by Side Diff: bench/MatrixBench.cpp

Issue 99893003: Simplify benchmark internal API. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bench/Matrix44Bench.cpp ('k') | bench/MatrixConvolutionBench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkMatrix.h" 9 #include "SkMatrix.h"
10 #include "SkMatrixUtils.h" 10 #include "SkMatrixUtils.h"
(...skipping 13 matching lines...) Expand all
24 24
25 virtual void performTest() = 0; 25 virtual void performTest() = 0;
26 26
27 protected: 27 protected:
28 virtual int mulLoopCount() const { return 1; } 28 virtual int mulLoopCount() const { return 1; }
29 29
30 virtual const char* onGetName() { 30 virtual const char* onGetName() {
31 return fName.c_str(); 31 return fName.c_str();
32 } 32 }
33 33
34 virtual void onDraw(SkCanvas*) { 34 virtual void onDraw(const int loops, SkCanvas*) {
35 for (int i = 0; i < this->getLoops(); i++) { 35 for (int i = 0; i < loops; i++) {
36 this->performTest(); 36 this->performTest();
37 } 37 }
38 } 38 }
39 39
40 private: 40 private:
41 typedef SkBenchmark INHERITED; 41 typedef SkBenchmark INHERITED;
42 }; 42 };
43 43
44 // we want to stop the compiler from eliminating code that it thinks is a no-op 44 // we want to stop the compiler from eliminating code that it thinks is a no-op
45 // so we have a non-static global we increment, hoping that will convince the 45 // so we have a non-static global we increment, hoping that will convince the
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 469
470 DEF_BENCH( return new InvertMapRectMatrixBench( 470 DEF_BENCH( return new InvertMapRectMatrixBench(
471 "invert_maprect_typemask_nonpersp", 471 "invert_maprect_typemask_nonpersp",
472 InvertMapRectMatrixBench::kUncachedTypeMask_Flag | 472 InvertMapRectMatrixBench::kUncachedTypeMask_Flag |
473 InvertMapRectMatrixBench::kScale_Flag | 473 InvertMapRectMatrixBench::kScale_Flag |
474 InvertMapRectMatrixBench::kRotate_Flag | 474 InvertMapRectMatrixBench::kRotate_Flag |
475 InvertMapRectMatrixBench::kTranslate_Flag); ) 475 InvertMapRectMatrixBench::kTranslate_Flag); )
476 476
477 DEF_BENCH( return new ScaleTransMixedMatrixBench(); ) 477 DEF_BENCH( return new ScaleTransMixedMatrixBench(); )
478 DEF_BENCH( return new ScaleTransDoubleMatrixBench(); ) 478 DEF_BENCH( return new ScaleTransDoubleMatrixBench(); )
OLDNEW
« no previous file with comments | « bench/Matrix44Bench.cpp ('k') | bench/MatrixConvolutionBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698