| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkPaint.h" | 10 #include "SkPaint.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 fRec.fCubic.moveTo(20, 20); | 72 fRec.fCubic.moveTo(20, 20); |
| 73 fRec.fCubic.cubicTo(40, 20, 60, 40, 60, 60); | 73 fRec.fCubic.cubicTo(40, 20, 60, 40, 60, 60); |
| 74 fRec.fCubic.cubicTo(40, 60, 20, 80, 20, 100); | 74 fRec.fCubic.cubicTo(40, 60, 20, 80, 20, 100); |
| 75 } | 75 } |
| 76 | 76 |
| 77 protected: | 77 protected: |
| 78 virtual const char* onGetName() { | 78 virtual const char* onGetName() { |
| 79 return fName.c_str(); | 79 return fName.c_str(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 virtual void onDraw(const int loops, SkCanvas* canvas) { | 82 virtual void onDraw(int loops, SkCanvas* canvas) { |
| 83 fRec.fCanvas = canvas; | 83 fRec.fCanvas = canvas; |
| 84 this->setupPaint(&fRec.fPaint); | 84 this->setupPaint(&fRec.fPaint); |
| 85 fRec.fPaint.setStyle(SkPaint::kStroke_Style); | 85 fRec.fPaint.setStyle(SkPaint::kStroke_Style); |
| 86 fRec.fPaint.setStrokeCap(fCap); | 86 fRec.fPaint.setStrokeCap(fCap); |
| 87 fRec.fPaint.setStrokeJoin(fJoin); | 87 fRec.fPaint.setStrokeJoin(fJoin); |
| 88 fRec.fPaint.setStrokeWidth(fWidth); | 88 fRec.fPaint.setStrokeWidth(fWidth); |
| 89 fProc(&fRec, loops); | 89 fProc(&fRec, loops); |
| 90 } | 90 } |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 typedef Benchmark INHERITED; | 93 typedef Benchmark INHERITED; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 DEF_BENCH( return new BezierBench(SkPaint::kButt_Cap, SkPaint::kRound_Join, 2, d
raw_quad); ) | 96 DEF_BENCH( return new BezierBench(SkPaint::kButt_Cap, SkPaint::kRound_Join, 2, d
raw_quad); ) |
| 97 DEF_BENCH( return new BezierBench(SkPaint::kSquare_Cap, SkPaint::kBevel_Join, 10
, draw_quad); ) | 97 DEF_BENCH( return new BezierBench(SkPaint::kSquare_Cap, SkPaint::kBevel_Join, 10
, draw_quad); ) |
| 98 DEF_BENCH( return new BezierBench(SkPaint::kRound_Cap, SkPaint::kMiter_Join, 50,
draw_quad); ) | 98 DEF_BENCH( return new BezierBench(SkPaint::kRound_Cap, SkPaint::kMiter_Join, 50,
draw_quad); ) |
| 99 | 99 |
| 100 DEF_BENCH( return new BezierBench(SkPaint::kButt_Cap, SkPaint::kRound_Join, 2, d
raw_cubic); ) | 100 DEF_BENCH( return new BezierBench(SkPaint::kButt_Cap, SkPaint::kRound_Join, 2, d
raw_cubic); ) |
| 101 DEF_BENCH( return new BezierBench(SkPaint::kSquare_Cap, SkPaint::kBevel_Join, 10
, draw_cubic); ) | 101 DEF_BENCH( return new BezierBench(SkPaint::kSquare_Cap, SkPaint::kBevel_Join, 10
, draw_cubic); ) |
| 102 DEF_BENCH( return new BezierBench(SkPaint::kRound_Cap, SkPaint::kMiter_Join, 50,
draw_cubic); ) | 102 DEF_BENCH( return new BezierBench(SkPaint::kRound_Cap, SkPaint::kMiter_Join, 50,
draw_cubic); ) |
| OLD | NEW |