| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkBenchmark.h" | 8 #include "SkBenchmark.h" |
| 9 #include "SkAAClip.h" | 9 #include "SkAAClip.h" |
| 10 #include "SkPath.h" | 10 #include "SkPath.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 typedef SkBenchmark INHERITED; | 87 typedef SkBenchmark INHERITED; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 //////////////////////////////////////////////////////////////////////////////// | 90 //////////////////////////////////////////////////////////////////////////////// |
| 91 // This bench tests out nested clip stacks. It is intended to simulate | 91 // This bench tests out nested clip stacks. It is intended to simulate |
| 92 // how WebKit nests clips. | 92 // how WebKit nests clips. |
| 93 class NestedAAClipBench : public SkBenchmark { | 93 class NestedAAClipBench : public SkBenchmark { |
| 94 SkString fName; | 94 SkString fName; |
| 95 bool fDoAA; | 95 bool fDoAA; |
| 96 SkRect fDrawRect; | 96 SkRect fDrawRect; |
| 97 SkMWCRandom fRandom; | 97 SkRandom fRandom; |
| 98 | 98 |
| 99 static const int kNumDraws = SkBENCHLOOP(2); | 99 static const int kNumDraws = SkBENCHLOOP(2); |
| 100 static const int kNestingDepth = 3; | 100 static const int kNestingDepth = 3; |
| 101 static const int kImageSize = 400; | 101 static const int kImageSize = 400; |
| 102 | 102 |
| 103 SkPoint fSizes[kNestingDepth+1]; | 103 SkPoint fSizes[kNestingDepth+1]; |
| 104 | 104 |
| 105 public: | 105 public: |
| 106 NestedAAClipBench(void* param, bool doAA) | 106 NestedAAClipBench(void* param, bool doAA) |
| 107 : INHERITED(param) | 107 : INHERITED(param) |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 static BenchRegistry gReg000(Fact000); | 281 static BenchRegistry gReg000(Fact000); |
| 282 static BenchRegistry gReg001(Fact001); | 282 static BenchRegistry gReg001(Fact001); |
| 283 static BenchRegistry gReg002(Fact002); | 283 static BenchRegistry gReg002(Fact002); |
| 284 static BenchRegistry gReg003(Fact003); | 284 static BenchRegistry gReg003(Fact003); |
| 285 | 285 |
| 286 static SkBenchmark* Fact004(void* p) { return SkNEW_ARGS(NestedAAClipBench, (p,
false)); } | 286 static SkBenchmark* Fact004(void* p) { return SkNEW_ARGS(NestedAAClipBench, (p,
false)); } |
| 287 static SkBenchmark* Fact005(void* p) { return SkNEW_ARGS(NestedAAClipBench, (p,
true)); } | 287 static SkBenchmark* Fact005(void* p) { return SkNEW_ARGS(NestedAAClipBench, (p,
true)); } |
| 288 | 288 |
| 289 static BenchRegistry gReg004(Fact004); | 289 static BenchRegistry gReg004(Fact004); |
| 290 static BenchRegistry gReg005(Fact005); | 290 static BenchRegistry gReg005(Fact005); |
| OLD | NEW |