OLD | NEW |
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" |
11 #include "SkRandom.h" | 11 #include "SkRandom.h" |
12 #include "SkString.h" | 12 #include "SkString.h" |
13 | 13 |
14 class MatrixBench : public SkBenchmark { | 14 class MatrixBench : public SkBenchmark { |
15 SkString fName; | 15 SkString fName; |
16 public: | 16 public: |
17 MatrixBench(const char name[]) { | 17 MatrixBench(const char name[]) { |
18 fName.printf("matrix_%s", name); | 18 fName.printf("matrix_%s", name); |
19 fIsRendering = false; | 19 } |
| 20 |
| 21 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE { |
| 22 return backend == kNonRendering_Backend; |
20 } | 23 } |
21 | 24 |
22 virtual void performTest() = 0; | 25 virtual void performTest() = 0; |
23 | 26 |
24 protected: | 27 protected: |
25 virtual int mulLoopCount() const { return 1; } | 28 virtual int mulLoopCount() const { return 1; } |
26 | 29 |
27 virtual const char* onGetName() { | 30 virtual const char* onGetName() { |
28 return fName.c_str(); | 31 return fName.c_str(); |
29 } | 32 } |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 | 469 |
467 DEF_BENCH( return new InvertMapRectMatrixBench( | 470 DEF_BENCH( return new InvertMapRectMatrixBench( |
468 "invert_maprect_typemask_nonpersp", | 471 "invert_maprect_typemask_nonpersp", |
469 InvertMapRectMatrixBench::kUncachedTypeMask_Flag | | 472 InvertMapRectMatrixBench::kUncachedTypeMask_Flag | |
470 InvertMapRectMatrixBench::kScale_Flag | | 473 InvertMapRectMatrixBench::kScale_Flag | |
471 InvertMapRectMatrixBench::kRotate_Flag | | 474 InvertMapRectMatrixBench::kRotate_Flag | |
472 InvertMapRectMatrixBench::kTranslate_Flag); ) | 475 InvertMapRectMatrixBench::kTranslate_Flag); ) |
473 | 476 |
474 DEF_BENCH( return new ScaleTransMixedMatrixBench(); ) | 477 DEF_BENCH( return new ScaleTransMixedMatrixBench(); ) |
475 DEF_BENCH( return new ScaleTransDoubleMatrixBench(); ) | 478 DEF_BENCH( return new ScaleTransDoubleMatrixBench(); ) |
OLD | NEW |