In GrAAConvexPathRenderer check whether middle quadtric control point is
close to line segment between first and last control points and if so
draw as a line.
Previously we just checked whether the middle control point was close to
either the first or last.
Bug: skia:8928
Bug: chromium:945449
Change-Id: I1f7353623c29dcdc329812c44815b80898f83625
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204981
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index 2be279f..47f5047 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp
@@ -242,8 +242,7 @@
static inline void add_quad_segment(const SkPoint pts[3],
SegmentArray* segments) {
- if (SkPointPriv::DistanceToSqd(pts[0], pts[1]) < kCloseSqd ||
- SkPointPriv::DistanceToSqd(pts[1], pts[2]) < kCloseSqd) {
+ if (SkPointPriv::DistanceToLineSegmentBetweenSqd(pts[1], pts[0], pts[2]) < kCloseSqd) {
if (pts[0] != pts[2]) {
add_line_to_segment(pts[2], segments);
}