| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 <functional> | 8 #include <functional> |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkDashPathEffect.h" | 10 #include "SkDashPathEffect.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 canvas->translate(kS + kPad, 0.f); | 203 canvas->translate(kS + kPad, 0.f); |
| 204 } | 204 } |
| 205 for (auto arc : arcs) { | 205 for (auto arc : arcs) { |
| 206 canvas->drawArc(arc.fOval, arc.fStart, arc.fSweep, true, paint); | 206 canvas->drawArc(arc.fOval, arc.fStart, arc.fSweep, true, paint); |
| 207 canvas->translate(kS + kPad, 0.f); | 207 canvas->translate(kS + kPad, 0.f); |
| 208 } | 208 } |
| 209 canvas->restore(); | 209 canvas->restore(); |
| 210 canvas->translate(0, kS + kPad); | 210 canvas->translate(0, kS + kPad); |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 |
| 214 DEF_SIMPLE_GM(onebadarc, canvas, 100, 100) { |
| 215 SkPath path; |
| 216 path.moveTo(SkBits2Float(0x41a00000), SkBits2Float(0x41a00000)); // 20, 20 |
| 217 path.lineTo(SkBits2Float(0x4208918c), SkBits2Float(0x4208918c)); // 34.1421
f, 34.1421f |
| 218 path.conicTo(SkBits2Float(0x41a00000), SkBits2Float(0x42412318), // 20, 48.
2843f |
| 219 SkBits2Float(0x40bb73a0), SkBits2Float(0x4208918c), // 5.85786
f, 34.1421f |
| 220 SkBits2Float(0x3f3504f3)); // 0.70710
7f |
| 221 path.quadTo(SkBits2Float(0x40bb73a0), SkBits2Float(0x4208918c), // 5.85786
f, 34.1421f |
| 222 SkBits2Float(0x40bb73a2), SkBits2Float(0x4208918c)); // 5.85787
f, 34.1421f |
| 223 path.lineTo(SkBits2Float(0x41a00000), SkBits2Float(0x41a00000)); // 20, 20 |
| 224 path.close(); |
| 225 SkPaint p0; |
| 226 p0.setColor(SK_ColorRED); |
| 227 p0.setStrokeWidth(15.f); |
| 228 p0.setStyle(SkPaint::kStroke_Style); |
| 229 p0.setAlpha(100); |
| 230 canvas->translate(20, 0); |
| 231 canvas->drawPath(path, p0); |
| 232 |
| 233 SkRect kRect = { 60, 0, 100, 40}; |
| 234 canvas->drawArc(kRect, 45, 90, true, p0); |
| 235 } |
| OLD | NEW |