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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkPath.cpp » ('j') | src/core/SkPath.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/addarc.cpp
diff --git a/gm/addarc.cpp b/gm/addarc.cpp
index 9280140794af70413a949847c64fde74d9171efd..8c23aa89bde1641eebeffb7da5ca1000d33e44a2 100644
--- a/gm/addarc.cpp
+++ b/gm/addarc.cpp
@@ -230,3 +230,35 @@ private:
typedef skiagm::GM INHERITED;
};
DEF_GM( return new ManyArcsGM; )
+
+// Lifted from https://bugs.chromium.org/p/chromium/issues/detail?id=640031
+class TinyAngleBigRadiusArcsGM : public skiagm::GM {
+public:
+ TinyAngleBigRadiusArcsGM() {}
+
+protected:
+ SkString onShortName() override { return SkString("tinyanglearcs"); }
+
+ SkISize onISize() override { return SkISize::Make(620, 330); }
+
+ void onDraw(SkCanvas* canvas) override {
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setStyle(SkPaint::kStroke_Style);
+
+ canvas->translate(10, 10);
+
+ SkPath path;
+ path.moveTo(50, 20);
+ path.lineTo(50, 0);
+ // A combination of tiny sweepAngle + large radius, we should draw a line.
+ html_canvas_arc(&path, 50, 100000, 100000, 270, 270 - 0.00572957795,
+ false);
+ path.lineTo(60, 20);
+ canvas->drawPath(path, paint);
+ }
+
+private:
+ typedef skiagm::GM INHERITED;
+};
+DEF_GM( return new TinyAngleBigRadiusArcsGM; )
« 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