From c9ecf8e87bb7f8b504bbd283ad8092ddac00c918 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Mon, 18 Feb 2019 11:49:00 +0100 Subject: [PATCH] Don't trust convexity when applying transforms. In theory, a convex shape transformed by an affine matrix should still be convex. However, due to numerical imprecision of floats, when we try to determine if something is convex, we can get different answers pre and post a transformation (think of two line segments nearly co-linear). Convex paths take a faster scan converter, but it is only well behaved if the path is, in fact, convex. Thus we have to be conservative about which paths we mark as convex, and cant's trust transformed paths to retain their convexity. We re-calculate when a transform is applied. --- gfx/skia/skia/src/core/SkPath.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/skia/skia/src/core/SkPath.cpp b/gfx/skia/skia/src/core/SkPath.cpp index b7d3920255..fc3db3ee54 100644 --- a/gfx/skia/skia/src/core/SkPath.cpp +++ b/gfx/skia/skia/src/core/SkPath.cpp @@ -1744,7 +1744,7 @@ void SkPath::transform(const SkMatrix& matrix, SkPath* dst) const { if (this != dst) { dst->fFillType = fFillType; - dst->fConvexity = fConvexity; + dst->fConvexity = kUnknown_Convexity; dst->fIsVolatile = fIsVolatile; }