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

Unified Diff: src/gpu/GrPathUtils.cpp

Issue 2257423002: Some assert fixes for running the Fuzzer sample in GPU mode. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 | « src/gpu/GrBlurUtils.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPathUtils.cpp
diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp
index c82895e9ba684d0010fbbb25d287687411791110..bff9490113a70ba446b193a3692f894d740ad299 100644
--- a/src/gpu/GrPathUtils.cpp
+++ b/src/gpu/GrPathUtils.cpp
@@ -44,7 +44,9 @@ uint32_t GrPathUtils::quadraticPointCount(const SkPoint points[],
SkASSERT(tol > 0);
SkScalar d = points[1].distanceToLineSegmentBetween(points[0], points[2]);
- if (d <= tol) {
+ if (!SkScalarIsFinite(d)) {
+ return MAX_POINTS_PER_CURVE;
+ } else if (d <= tol) {
return 1;
} else {
// Each time we subdivide, d should be cut in 4. So we need to
@@ -104,7 +106,9 @@ 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 (!SkScalarIsFinite(d)) {
+ return MAX_POINTS_PER_CURVE;
+ } else if (d <= tol) {
return 1;
} else {
SkScalar divSqrt = SkScalarSqrt(d / tol);
« no previous file with comments | « src/gpu/GrBlurUtils.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698