Move new convex path towards the end of the path array in GM convexpaths.
Makes triaging a lot easier.
TBR=jvanverth@google.com
Bug: skia:8928
Change-Id: Id800b8e90e94e41c3ce3faaae8f3e10b501f0e04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204784
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
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.
No-Tree-Checks: true
No-Try: true
No-Presubmit: true
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>
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205264
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/gm/convexpaths.cpp b/gm/convexpaths.cpp
index 6354832..ea0f690 100644
--- a/gm/convexpaths.cpp
+++ b/gm/convexpaths.cpp
@@ -252,6 +252,16 @@
0, 0,
100 * SK_Scalar1, 100 * SK_Scalar1);
+ // skbug.com/8928
+ fPaths.push_back().moveTo(16.875f, 192.594f);
+ fPaths.back().cubicTo(45.625f, 192.594f, 74.375f, 192.594f, 103.125f, 192.594f);
+ fPaths.back().cubicTo(88.75f, 167.708f, 74.375f, 142.823f, 60, 117.938f);
+ fPaths.back().cubicTo(45.625f, 142.823f, 31.25f, 167.708f, 16.875f, 192.594f);
+ fPaths.back().close();
+ SkMatrix m;
+ m.setAll(0.1f, 0, -1, 0, 0.115207f, -2.64977f, 0, 0, 1);
+ fPaths.back().transform(m);
+
// small circle. This is listed last so that it has device coords far
// from the origin (small area relative to x,y values).
fPaths.push_back().addCircle(0, 0, 1.2f);
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index bb45932..fac181f 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);
}