aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Stephen White <senorblanco@chromium.org>2018-06-22 10:19:20 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-22 15:27:57 +0000
commit13f3d8d4bc6863c7d890781021555fb6f65936e0 (patch)
tree07d19a327907c47f351c7839f6e2d8eae3ee961a /src
parentb9177cfaa8f56cc2f561669dc4e68cf6d43f529d (diff)
GrTessellator: avoid split with zero primary and out-of-range secondary.
Sometimes the intersector will return an intersection which is on the same primary sort criterion (eg., Y coordinate), but out-of-range on the secondary. We shouldn't do splits in this case. The only case we really care about is if it's less than one epsilon and greater than zero, and thus numerically unsplittable. Bug: 851914 Change-Id: Ia772763b6a66a14ca159cf409a832835244e83bc Reviewed-on: https://skia-review.googlesource.com/136803 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrTessellator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gpu/GrTessellator.cpp b/src/gpu/GrTessellator.cpp
index 2dd82a0892..d6a64cdd46 100644
--- a/src/gpu/GrTessellator.cpp
+++ b/src/gpu/GrTessellator.cpp
@@ -1199,7 +1199,7 @@ Vertex* create_sorted_vertex(const SkPoint& p, uint8_t alpha, VertexList* mesh,
bool nearly_flat(Comparator& c, Edge* edge) {
SkPoint diff = edge->fBottom->fPoint - edge->fTop->fPoint;
float primaryDiff = c.fDirection == Comparator::Direction::kHorizontal ? diff.fX : diff.fY;
- return fabs(primaryDiff) < std::numeric_limits<float>::epsilon();
+ return fabs(primaryDiff) < std::numeric_limits<float>::epsilon() && primaryDiff != 0.0f;
}
SkPoint clamp(SkPoint p, SkPoint min, SkPoint max, Comparator& c) {