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

Unified Diff: src/gpu/batches/GrAAConvexTessellator.cpp

Issue 1557903002: Fixed an assertion error in GrAAConvexTessellator. While adding a new point, it would check that th… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 12 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAAConvexTessellator.cpp
diff --git a/src/gpu/batches/GrAAConvexTessellator.cpp b/src/gpu/batches/GrAAConvexTessellator.cpp
index 5ef9aefddd4afc46d46c6d76cc7c92e86a409861..c3d25948deeb1345fc3140da6d40ac1a3c526339 100644
--- a/src/gpu/batches/GrAAConvexTessellator.cpp
+++ b/src/gpu/batches/GrAAConvexTessellator.cpp
@@ -835,6 +835,13 @@ void GrAAConvexTessellator::lineTo(SkPoint p, bool isCurve) {
this->popLastPt();
fNorms.pop();
fIsCurve.pop();
+ // double-check that the new last point is not a duplicate of the new point. In an ideal
+ // world this wouldn't be necessary (since it's only possible for non-convex paths), but
+ // floating point precision issues mean it can actually happen on paths that were determined
+ // to be convex.
+ if (duplicate_pt(p, this->lastPoint())) {
+ return;
+ }
}
SkScalar initialRingCoverage = fStrokeWidth < 0.0f ? 0.5f : 1.0f;
this->addPt(p, 0.0f, initialRingCoverage, false, isCurve);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698