Fix to check for inf when generating quadratic points
BUG=skia:3453
Review URL: https://codereview.chromium.org/948043003
diff --git a/gm/conicpaths.cpp b/gm/conicpaths.cpp
index a5d5ee6..661f19f 100644
--- a/gm/conicpaths.cpp
+++ b/gm/conicpaths.cpp
@@ -72,6 +72,20 @@
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 @@
canvas->translate(0, 110);
}
canvas->restore();
+
+ this->drawGiantCircle(canvas);
}
private:
SkTArray<SkPath> fPaths;
+ SkPath fGiantCircle;
typedef skiagm::GM INHERITED;
};
DEF_GM( return SkNEW(ConicPathsGM); )