aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/conicpaths.cpp
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-02-25 06:41:47 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-25 06:41:47 -0800
commit5a23a14b1fbc7503bdeff83e4b45ae7c258c6e96 (patch)
tree1dfd7cfd93bc69e50726fceb4be731013bab9a51 /gm/conicpaths.cpp
parent86821b56704ebc0a1a6d1e5d1e329369ac797c98 (diff)
Fix to check for inf when generating quadratic points
Diffstat (limited to 'gm/conicpaths.cpp')
-rw-r--r--gm/conicpaths.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/gm/conicpaths.cpp b/gm/conicpaths.cpp
index a5d5ee6d24..661f19fba9 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); )