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

Unified Diff: src/gpu/GrPathUtils.cpp

Issue 855513004: Tessellating GPU path renderer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Speculative ChromeOS build fix 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
Index: src/gpu/GrPathUtils.cpp
diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp
index 8e7a01d0915aa74a039c8d8e05abf3540fd4e4c3..d975833053ffbad93874147f6e7f42b840641cc0 100644
--- a/src/gpu/GrPathUtils.cpp
+++ b/src/gpu/GrPathUtils.cpp
@@ -44,7 +44,7 @@ uint32_t GrPathUtils::quadraticPointCount(const SkPoint points[],
SkASSERT(tol > 0);
SkScalar d = points[1].distanceToLineSegmentBetween(points[0], points[2]);
- if (d <= tol) {
+ if (d <= tol || !SkScalarIsFinite(d)) {
return 1;
} else {
// Each time we subdivide, d should be cut in 4. So we need to
@@ -99,7 +99,7 @@ uint32_t GrPathUtils::cubicPointCount(const SkPoint points[],
points[1].distanceToLineSegmentBetweenSqd(points[0], points[3]),
points[2].distanceToLineSegmentBetweenSqd(points[0], points[3]));
d = SkScalarSqrt(d);
- if (d <= tol) {
+ if (d <= tol || !SkScalarIsFinite(d)) {
return 1;
} else {
int temp = SkScalarCeilToInt(SkScalarSqrt(SkScalarDiv(d, tol)));

Powered by Google App Engine
This is Rietveld 408576698