OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 protected: | 40 protected: |
41 const char* onGetName() override { | 41 const char* onGetName() override { |
42 return fName.c_str(); | 42 return fName.c_str(); |
43 } | 43 } |
44 | 44 |
45 SkIPoint onGetSize() override { | 45 SkIPoint onGetSize() override { |
46 return SkIPoint::Make(640, 100); | 46 return SkIPoint::Make(640, 100); |
47 } | 47 } |
48 | 48 |
49 void onPreDraw() override { | 49 void onDelayedSetup() override { |
50 make_path(fPath); | 50 make_path(fPath); |
51 } | 51 } |
52 | 52 |
53 void onDraw(const int loops, SkCanvas* canvas) override { | 53 void onDraw(const int loops, SkCanvas* canvas) override { |
54 SkPaint paint; | 54 SkPaint paint; |
55 paint.setAntiAlias(true); | 55 paint.setAntiAlias(true); |
56 paint.setStyle(SkPaint::kStroke_Style); | 56 paint.setStyle(SkPaint::kStroke_Style); |
57 paint.setStrokeWidth(2); | 57 paint.setStrokeWidth(2); |
58 if (fRound) { | 58 if (fRound) { |
59 paint.setStrokeJoin(SkPaint::kRound_Join); | 59 paint.setStrokeJoin(SkPaint::kRound_Join); |
(...skipping 22 matching lines...) Expand all Loading... |
82 }; | 82 }; |
83 | 83 |
84 DEF_BENCH( return new BigPathBench(kLeft_Align, false); ) | 84 DEF_BENCH( return new BigPathBench(kLeft_Align, false); ) |
85 DEF_BENCH( return new BigPathBench(kMiddle_Align, false); ) | 85 DEF_BENCH( return new BigPathBench(kMiddle_Align, false); ) |
86 DEF_BENCH( return new BigPathBench(kRight_Align, false); ) | 86 DEF_BENCH( return new BigPathBench(kRight_Align, false); ) |
87 | 87 |
88 DEF_BENCH( return new BigPathBench(kLeft_Align, true); ) | 88 DEF_BENCH( return new BigPathBench(kLeft_Align, true); ) |
89 DEF_BENCH( return new BigPathBench(kMiddle_Align, true); ) | 89 DEF_BENCH( return new BigPathBench(kMiddle_Align, true); ) |
90 DEF_BENCH( return new BigPathBench(kRight_Align, true); ) | 90 DEF_BENCH( return new BigPathBench(kRight_Align, true); ) |
91 | 91 |
OLD | NEW |