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 "gm.h" | 8 #include "gm.h" |
9 #include "SkAnimTimer.h" | 9 #include "SkAnimTimer.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 SkScalar rx = SkScalarCos(rad) * R; | 94 SkScalar rx = SkScalarCos(rad) * R; |
95 SkScalar ry = SkScalarSin(rad) * R; | 95 SkScalar ry = SkScalarSin(rad) * R; |
96 | 96 |
97 canvas->drawLine(0, 0, rx, ry, paint); | 97 canvas->drawLine(0, 0, rx, ry, paint); |
98 | 98 |
99 SkPath path; | 99 SkPath path; |
100 path.addArc(oval, 0, deg); | 100 path.addArc(oval, 0, deg); |
101 SkPathMeasure meas(path, false); | 101 SkPathMeasure meas(path, false); |
102 SkScalar arcLen = rad * R; | 102 SkScalar arcLen = rad * R; |
103 SkPoint pos; | 103 SkPoint pos; |
104 if (meas.getPosTan(arcLen, &pos, NULL)) { | 104 if (meas.getPosTan(arcLen, &pos, nullptr)) { |
105 canvas->drawLine(0, 0, pos.x(), pos.y(), measPaint); | 105 canvas->drawLine(0, 0, pos.x(), pos.y(), measPaint); |
106 } | 106 } |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 private: | 110 private: |
111 typedef skiagm::GM INHERITED; | 111 typedef skiagm::GM INHERITED; |
112 }; | 112 }; |
113 DEF_GM( return new AddArcMeasGM; ) | 113 DEF_GM( return new AddArcMeasGM; ) |
114 | 114 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 canvas->restore(); | 224 canvas->restore(); |
225 canvas->translate(0, 40); | 225 canvas->translate(0, 40); |
226 } | 226 } |
227 } | 227 } |
228 | 228 |
229 private: | 229 private: |
230 typedef skiagm::GM INHERITED; | 230 typedef skiagm::GM INHERITED; |
231 }; | 231 }; |
232 DEF_GM( return new ManyArcsGM; ) | 232 DEF_GM( return new ManyArcsGM; ) |
233 | 233 |
OLD | NEW |