OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkMatrix44.h" | 9 #include "SkMatrix44.h" |
10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
11 #include "SkString.h" | 11 #include "SkString.h" |
12 | 12 |
13 class Matrix44Bench : public Benchmark { | 13 class Matrix44Bench : public Benchmark { |
14 SkString fName; | 14 SkString fName; |
15 public: | 15 public: |
16 Matrix44Bench(const char name[]) { | 16 Matrix44Bench(const char name[]) { |
17 fName.printf("matrix44_%s", name); | 17 fName.printf("matrix44_%s", name); |
18 } | 18 } |
19 | 19 |
20 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE { | 20 bool isSuitableFor(Backend backend) SK_OVERRIDE { |
21 return backend == kNonRendering_Backend; | 21 return backend == kNonRendering_Backend; |
22 } | 22 } |
23 | 23 |
24 virtual void performTest() = 0; | 24 virtual void performTest() = 0; |
25 | 25 |
26 protected: | 26 protected: |
27 virtual int mulLoopCount() const { return 1; } | 27 virtual int mulLoopCount() const { return 1; } |
28 | 28 |
29 virtual const char* onGetName() { | 29 virtual const char* onGetName() { |
30 return fName.c_str(); | 30 return fName.c_str(); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 DEF_BENCH( return new SetIdentityMatrix44Bench(); ) | 295 DEF_BENCH( return new SetIdentityMatrix44Bench(); ) |
296 DEF_BENCH( return new EqualsMatrix44Bench(); ) | 296 DEF_BENCH( return new EqualsMatrix44Bench(); ) |
297 DEF_BENCH( return new PreScaleMatrix44Bench(); ) | 297 DEF_BENCH( return new PreScaleMatrix44Bench(); ) |
298 DEF_BENCH( return new PostScaleMatrix44Bench(); ) | 298 DEF_BENCH( return new PostScaleMatrix44Bench(); ) |
299 DEF_BENCH( return new InvertMatrix44Bench(); ) | 299 DEF_BENCH( return new InvertMatrix44Bench(); ) |
300 DEF_BENCH( return new InvertAffineMatrix44Bench(); ) | 300 DEF_BENCH( return new InvertAffineMatrix44Bench(); ) |
301 DEF_BENCH( return new InvertScaleTranslateMatrix44Bench(); ) | 301 DEF_BENCH( return new InvertScaleTranslateMatrix44Bench(); ) |
302 DEF_BENCH( return new InvertTranslateMatrix44Bench(); ) | 302 DEF_BENCH( return new InvertTranslateMatrix44Bench(); ) |
303 DEF_BENCH( return new SetConcatMatrix44Bench(); ) | 303 DEF_BENCH( return new SetConcatMatrix44Bench(); ) |
304 DEF_BENCH( return new GetTypeMatrix44Bench(); ) | 304 DEF_BENCH( return new GetTypeMatrix44Bench(); ) |
OLD | NEW |