| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 "butt", "round", "square" | 57 "butt", "round", "square" |
| 58 }; | 58 }; |
| 59 static const char* gJoinName[] = { | 59 static const char* gJoinName[] = { |
| 60 "miter", "round", "bevel" | 60 "miter", "round", "bevel" |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 fCap = c; | 63 fCap = c; |
| 64 fJoin = j; | 64 fJoin = j; |
| 65 fProc = proc; | 65 fProc = proc; |
| 66 fWidth = SkIntToScalar(w); | 66 fWidth = SkIntToScalar(w); |
| 67 fName.printf("draw_stroke_bezier_%s_%s_%s_%g", proc(NULL, 0), gCapName[c
], gJoinName[j], w); | 67 fName.printf("draw_stroke_bezier_%s_%s_%s_%g", proc(nullptr, 0), gCapNam
e[c], gJoinName[j], w); |
| 68 | 68 |
| 69 fRec.fQuad.moveTo(20, 20); | 69 fRec.fQuad.moveTo(20, 20); |
| 70 fRec.fQuad.quadTo(60, 20, 60, 60); | 70 fRec.fQuad.quadTo(60, 20, 60, 60); |
| 71 fRec.fQuad.quadTo(20, 60, 20, 100); | 71 fRec.fQuad.quadTo(20, 60, 20, 100); |
| 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: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 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 |