skia2/src
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 Replace GrColor4h with SkPMColor4f 2018-10-31 19:25:20 +00:00
c expand imageinfo in C api, start on colorspace 2018-09-28 17:52:59 +00:00
codec Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
compute Minor HotSort updates 2018-11-05 18:31:33 +00:00
core don't trust convexity after a transform 2018-12-01 21:17:34 +00:00
effects Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
fonts move Sk{Test,Random}ScalerContext to tools 2017-11-10 17:02:20 +00:00
gpu Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
image Revert "Revert "add rect-parameter to makeImageSnapshot"" 2018-11-21 14:46:06 +00:00
images DeMorgan's blend-on-black logic 2018-11-02 19:28:57 +00:00
lazy begin cleanup of malloc porting layer 2018-01-05 21:29:35 +00:00
opts move NEON matrixProcs into matrixProcs.cpp 2018-11-21 16:32:37 +00:00
pathops Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
pdf Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
ports Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
sfnt Improve name table handling. 2018-08-20 20:39:54 +00:00
shaders Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
sksl Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
svg SkPaint::Align is dead 2018-11-02 21:48:27 +00:00
utils experimental alternative isconvex 2018-11-30 21:42:14 +00:00
xml Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
xps Reland "Move remove ptr args to MakeRecAndEffects" 2018-11-09 20:01:42 +00:00