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

Side by Side Diff: gm/addarc.cpp

Issue 2388833002: Fix SkPath::arcTo when sweepAngle is tiny and radius is big (Closed)
Patch Set: remove stdio Created 4 years, 2 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/SkPath.cpp » ('j') | src/core/SkPath.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
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
234 // Lifted from https://bugs.chromium.org/p/chromium/issues/detail?id=640031
235 class TinyAngleBigRadiusArcsGM : public skiagm::GM {
236 public:
237 TinyAngleBigRadiusArcsGM() {}
238
239 protected:
240 SkString onShortName() override { return SkString("tinyanglearcs"); }
241
242 SkISize onISize() override { return SkISize::Make(620, 330); }
243
244 void onDraw(SkCanvas* canvas) override {
245 SkPaint paint;
246 paint.setAntiAlias(true);
247 paint.setStyle(SkPaint::kStroke_Style);
248
249 canvas->translate(10, 10);
250
251 SkPath path;
252 path.moveTo(50, 20);
253 path.lineTo(50, 0);
254 // A combination of tiny sweepAngle + large radius, we should draw a lin e.
255 html_canvas_arc(&path, 50, 100000, 100000, 270, 270 - 0.00572957795,
256 false);
257 path.lineTo(60, 20);
258 canvas->drawPath(path, paint);
259 }
260
261 private:
262 typedef skiagm::GM INHERITED;
263 };
264 DEF_GM( return new TinyAngleBigRadiusArcsGM; )
OLDNEW
« no previous file with comments | « no previous file | src/core/SkPath.cpp » ('j') | src/core/SkPath.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698