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 "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkCommandLineFlags.h" | 10 #include "SkCommandLineFlags.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 SkString fName; | 33 SkString fName; |
34 const char* computeName(const char root[]) { | 34 const char* computeName(const char root[]) { |
35 fName.printf("%s_%d", root, fShift); | 35 fName.printf("%s_%d", root, fShift); |
36 if (fStroke > 0) { | 36 if (fStroke > 0) { |
37 fName.appendf("_stroke_%d", fStroke); | 37 fName.appendf("_stroke_%d", fStroke); |
38 } | 38 } |
39 return fName.c_str(); | 39 return fName.c_str(); |
40 } | 40 } |
41 | 41 |
| 42 bool isVisual() override { return true; } |
| 43 |
42 protected: | 44 protected: |
43 virtual void drawThisRect(SkCanvas* c, const SkRect& r, const SkPaint& p) { | 45 virtual void drawThisRect(SkCanvas* c, const SkRect& r, const SkPaint& p) { |
44 c->drawRect(r, p); | 46 c->drawRect(r, p); |
45 } | 47 } |
46 | 48 |
47 virtual const char* onGetName() { return computeName("rects"); } | 49 virtual const char* onGetName() { return computeName("rects"); } |
48 | 50 |
49 virtual void onPreDraw() { | 51 virtual void onPreDraw() { |
50 SkRandom rand; | 52 SkRandom rand; |
51 const SkScalar offset = SK_Scalar1/3; | 53 const SkScalar offset = SK_Scalar1/3; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 "maskopaque");) | 276 "maskopaque");) |
275 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, | 277 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, |
276 BlitMaskBench::kMaskBlack, | 278 BlitMaskBench::kMaskBlack, |
277 "maskblack");) | 279 "maskblack");) |
278 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, | 280 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, |
279 BlitMaskBench::kMaskColor, | 281 BlitMaskBench::kMaskColor, |
280 "maskcolor");) | 282 "maskcolor");) |
281 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, | 283 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, |
282 BlitMaskBench::KMaskShader, | 284 BlitMaskBench::KMaskShader, |
283 "maskshader");) | 285 "maskshader");) |
OLD | NEW |