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

Unified Diff: gm/conicpaths.cpp

Issue 948043003: Fix to check for inf when generating quadratic points (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 5 years, 10 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/SkPoint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/conicpaths.cpp
diff --git a/gm/conicpaths.cpp b/gm/conicpaths.cpp
index a5d5ee6d24519e233051e3efa99001d70aa14354..661f19fba9877f4fb6d9fd793b5d09fc8cf6e1aa 100644
--- a/gm/conicpaths.cpp
+++ b/gm/conicpaths.cpp
@@ -72,6 +72,20 @@ protected:
closedEllipse->moveTo(0, 0);
closedEllipse->conicTo(100, 100, 0, 0, SK_ScalarHalf);
}
+ {
+ const SkScalar w = SkScalarSqrt(2)/2;
+ fGiantCircle.moveTo(2.1e+11f, -1.05e+11f);
+ fGiantCircle.conicTo(2.1e+11f, 0, 1.05e+11f, 0, w);
+ fGiantCircle.conicTo(0, 0, 0, -1.05e+11f, w);
+ fGiantCircle.conicTo(0, -2.1e+11f, 1.05e+11f, -2.1e+11f, w);
+ fGiantCircle.conicTo(2.1e+11f, -2.1e+11f, 2.1e+11f, -1.05e+11f, w);
+
+ }
+ }
+
+ void drawGiantCircle(SkCanvas* canvas) {
+ SkPaint paint;
+ canvas->drawPath(fGiantCircle, paint);
}
void onDraw(SkCanvas* canvas) SK_OVERRIDE {
@@ -104,10 +118,13 @@ protected:
canvas->translate(0, 110);
}
canvas->restore();
+
+ this->drawGiantCircle(canvas);
}
private:
SkTArray<SkPath> fPaths;
+ SkPath fGiantCircle;
typedef skiagm::GM INHERITED;
};
DEF_GM( return SkNEW(ConicPathsGM); )
« no previous file with comments | « no previous file | src/core/SkPoint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698