| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 public: | 32 public: |
| 33 BigPathBench(Align align, bool round) : fAlign(align), fRound(round) { | 33 BigPathBench(Align align, bool round) : fAlign(align), fRound(round) { |
| 34 fName.printf("bigpath_%s", gAlignName[fAlign]); | 34 fName.printf("bigpath_%s", gAlignName[fAlign]); |
| 35 if (round) { | 35 if (round) { |
| 36 fName.append("_round"); | 36 fName.append("_round"); |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 const char* onGetName() SK_OVERRIDE { | 41 const char* onGetName() override { |
| 42 return fName.c_str(); | 42 return fName.c_str(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 SkIPoint onGetSize() SK_OVERRIDE { | 45 SkIPoint onGetSize() override { |
| 46 return SkIPoint::Make(640, 100); | 46 return SkIPoint::Make(640, 100); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void onPreDraw() SK_OVERRIDE { | 49 void onPreDraw() override { |
| 50 make_path(fPath); | 50 make_path(fPath); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void onDraw(const int loops, SkCanvas* canvas) SK_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); |
| 60 } | 60 } |
| 61 this->setupPaint(&paint); | 61 this->setupPaint(&paint); |
| 62 | 62 |
| 63 const SkRect r = fPath.getBounds(); | 63 const SkRect r = fPath.getBounds(); |
| (...skipping 18 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 |