From 6f5e77a08faf9d967eba8194811cbf2391092c23 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Mon, 23 Apr 2018 21:14:42 -0600 Subject: ccpr: Cull extremely thin triangles When triangles get too thin it's possible for FP round-off error to actually give us the wrong winding direction, causing rendering artifacts. This change also allows us to unblacklist ANGLE. Bug: skia:7805 Bug: skia:7820 Change-Id: Ibaa0f033eba625d720e3a594c4515d8264cc413d Reviewed-on: https://skia-review.googlesource.com/123262 Reviewed-by: Brian Osman Commit-Queue: Chris Dalton --- bench/GrCCGeometryBench.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bench') diff --git a/bench/GrCCGeometryBench.cpp b/bench/GrCCGeometryBench.cpp index 5e47df042c..0628644ab9 100644 --- a/bench/GrCCGeometryBench.cpp +++ b/bench/GrCCGeometryBench.cpp @@ -22,6 +22,7 @@ public: fPoints[1].set(x1, y1); fPoints[2].set(x2, y2); fPoints[3].set(x3, y3); + fPoints[4].set(x0, y0); // Flat closing edge. fName = "ccprgeometry"; switch (SkClassifyCubic(fPoints)) { @@ -52,7 +53,7 @@ public: fGeometry.beginContour(fPoints[0]); for (int i = 0; i < kNumBaseLoops; ++i) { fGeometry.cubicTo(fPoints); - fGeometry.lineTo(fPoints[0]); + fGeometry.lineTo(fPoints+3); } fGeometry.endContour(); fGeometry.reset(); @@ -60,7 +61,7 @@ public: } private: - SkPoint fPoints[4]; + SkPoint fPoints[5]; SkString fName; GrCCGeometry fGeometry{4*100*kNumBaseLoops, 2*100*kNumBaseLoops}; -- cgit v1.2.3