Don't use AA convex path renderer if direction can't be determined
Without the changes to GrShape and GrAAConvexPathRenderer, this new GM
would not draw the red circle at the center when using Ganesh. Raster
drew the red circle. The difference came about because they checked
convexity after transforming by the view matrix, and Ganesh checked
before.
With this particular path construction and the very large scale factor
on the CTM, the convexity calculator in local space computed small
enough edge vectors that it thought the contour backtracked on itself
instead of winding in a consistent direction.
The GrAAConvexPathRenderer would claim it could draw the convex path,
but later when actually preparing to draw, it would do nothing if it
turned out the convex path didn't have a direction. This CL updates it
so that the convex path renderer's canDraw() function matches what it
is actually able to draw.
There is the separate issue of the convexity/direction checking
precision.
Bug: chromium:996140
Change-Id: I6f2af2d9ba6752663d97c8573deb2d767a3f1245
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238121
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
diff --git a/gn/gm.gni b/gn/gm.gni
index 8df253b..9909947 100644
--- a/gn/gm.gni
+++ b/gn/gm.gni
@@ -115,6 +115,7 @@
"$_gm/crbug_938592.cpp",
"$_gm/crbug_946965.cpp",
"$_gm/crbug_947055.cpp",
+ "$_gm/crbug_996140.cpp",
"$_gm/croppedrects.cpp",
"$_gm/crosscontextimage.cpp",
"$_gm/cubicpaths.cpp",