Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: gm/circulararcs.cpp

Issue 2281953002: avoid generating degenerate conic from arc (Closed)
Patch Set: add isolated test case Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkGeometry.cpp » ('j') | src/core/SkGeometry.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkGeometry.cpp » ('j') | src/core/SkGeometry.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698