skia2/include
Mike Reed 07105bbcbe don't trust convexity after a transform
In theory, a convex shape is still convex if transformed by an affine
matrix. However, SkPath segments are specified using floats, and attributes
like collinearity can break under some transforms due to finite precision.

Computing convexity is non-trivial, so there is value in SkPath caching this
calculation. Convexity is useful, as both the CPU and GPU backends can draw
convex shapes faster than non-convex.

To balance these two (fragile float math and value of caching convexity),
this CL invalidates this cached state if the transform could change convexity.
In the general case, it is assumed that convexity could change. Special cases
where it is safe to keep the cached state after transform are:
- identity transform
- scale/translate transform if the path is known to be axis-aligned
All other combinations invalidate the cached state, forcing it to be
recomputed.

"axis-aligned" means the segments in the path are all axis-aligned, horizontal
or vertical (e.g. a rect or rrect)

Bug: 899689
Change-Id: I1381273eaff61d6b7134ae94b4f251c69991081a
Reviewed-on: https://skia-review.googlesource.com/c/173226
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-12-01 21:17:34 +00:00
..
android Add SafetyNetLogging and use in SkPngCodec 2018-11-14 20:06:03 +00:00
atlastext include: whitespace changes for clang-format 2018-09-19 14:54:57 +00:00
c expand imageinfo in C api, start on colorspace 2018-09-28 17:52:59 +00:00
codec Add SkEncodedOrigin to SkYUVASizeInfo, fix JPEG orientation in GPU decode path 2018-11-30 16:05:36 +00:00
config remove unused parts of SkTypes.h 2018-06-08 23:53:57 +00:00
core Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
docs Add initial support for generating tagged PDFs. 2018-09-27 19:35:40 +00:00
effects Remove unused exposedInAndroidJavaAPI 2018-11-12 21:27:02 +00:00
encode Move SkNoncopyable to include/private. 2018-07-17 21:39:51 +00:00
gpu Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
pathops fixup winding contours 2018-08-17 14:01:51 +00:00
ports SkImageGeneratorCG.h to only expose factory method. 2018-09-19 21:20:35 +00:00
private don't trust convexity after a transform 2018-12-01 21:17:34 +00:00
svg Add a SkWStream-based SkSVGCanvas factory 2017-09-19 20:33:19 +00:00
utils Remove SkCanvas::experimental_drawImageSetV0 2018-11-26 20:17:30 +00:00