skia2/include/private
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
..
GrAuditTrail.h Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
GrCCClipPath.h ccpr: Remove the dangling pointer from GrCCDrawPathsOp 2018-09-14 16:32:58 +00:00
GrCCPerOpListPaths.h include: whitespace changes for clang-format 2018-09-19 14:54:57 +00:00
GrColor.h Use GrVertexWriter for GrAAStrokeRectOp 2018-11-20 17:09:07 +00:00
GrOpList.h Use SkPMColor4f throughout clear APIs 2018-11-05 20:36:24 +00:00
GrProxyRef.h Reland "Move GrGeometryProcessor's textures out of classes and into" 2018-08-07 14:02:49 +00:00
GrRenderTargetProxy.h Reland "Reland "Have a GrBackendFormat be stored on gpu proxies."" 2018-11-19 18:51:07 +00:00
GrSharedEnums.h sksl enum support 2017-11-13 14:36:40 +00:00
GrSingleOwner.h Reland of Make a single GrSingleOwner in GrContext (patchset #1 id:1 of https://codereview.chromium.org/1565303003/ ) 2016-01-08 10:09:13 -08:00
GrSkSLFPFactoryCache.h Revert "replace SkNVRefCnt with SkRefCnt" 2018-10-30 15:23:06 +00:00
GrSurfaceProxy.h Reland "Reland "Have a GrBackendFormat be stored on gpu proxies."" 2018-11-19 18:51:07 +00:00
GrTextureProxy.h Reland "Reland "Have a GrBackendFormat be stored on gpu proxies."" 2018-11-19 18:51:07 +00:00
GrTypesPriv.h Fix occurrences of "-Wextra-semi-stmt" 2018-11-30 23:23:09 +00:00
GrVkTypesPriv.h Remove include/gpu/vk from include paths. 2018-05-22 19:59:35 +00:00
SkArenaAlloc.h Add explicit to ctor 2018-11-27 18:11:30 +00:00
SkAtomics.h port most SkAtomic<T> to std::atomic<T> 2018-08-09 23:40:31 +00:00
SkBitmaskEnum.h SkPDF: SkPDFFont class changes 2016-08-16 09:36:23 -07:00
SkChecksum.h Move SkNoncopyable to include/private. 2018-07-17 21:39:51 +00:00
SkColorData.h move LCD blits to SkBlitter_ARGB32.cpp 2018-11-09 17:03:06 +00:00
SkDeferredDisplayList.h Test YUV images in DDL 2018-10-01 12:12:29 +00:00
SkEncodedInfo.h Make SkCodec truly default to sRGB 2018-09-27 20:08:06 +00:00
SkFixed.h Revert "SkMath takes some functions from from SkTypes" 2018-09-07 17:32:54 +00:00
SkFloatBits.h include: whitespace changes for clang-format 2018-09-19 14:54:57 +00:00
SkFloatingPoint.h make float divide-by-zero fatal 2018-11-06 21:56:27 +00:00
SkHalf.h Add GrColor4h (half-float), for use in Ops and (eventually) vertices 2018-10-29 15:11:51 +00:00
SkImageInfoPriv.h Remove checks that insist on kOpaque for some color types 2018-10-11 15:30:55 +00:00
SkLeanWindows.h SkLeanWindows.h: #include "Windows.h" fewer places 2016-06-07 17:21:10 -07:00
SkMacros.h SkTypes: more into SkMacros 2018-06-12 20:24:43 +00:00
SkMalloc.h Add 2 fuzz targets for image decoding (oss-fuzz) 2018-02-12 15:25:59 +00:00
SkMessageBus.h ccpr: Use SkMessageBus for thread-safe eviction of cache entries 2018-10-19 00:25:20 +00:00
SkMutex.h Revert "SkMath takes some functions from from SkTypes" 2018-09-07 17:32:54 +00:00
SkNoncopyable.h Move SkNoncopyable to include/private. 2018-07-17 21:39:51 +00:00
SkNx_neon.h Add GrColor4h (half-float), for use in Ops and (eventually) vertices 2018-10-29 15:11:51 +00:00
SkNx_sse.h Add GrColor4h (half-float), for use in Ops and (eventually) vertices 2018-10-29 15:11:51 +00:00
SkNx.h Add GrColor4h (half-float), for use in Ops and (eventually) vertices 2018-10-29 15:11:51 +00:00
SkOnce.h tweak SkOnce.h header to work around issues with std::atomic::compare_exchange_strong 2016-12-16 22:21:27 +00:00
SkPathRef.h don't trust convexity after a transform 2018-12-01 21:17:34 +00:00
SkSafe32.h Revert "SkMath takes some functions from from SkTypes" 2018-09-07 17:32:54 +00:00
SkSafe_math.h Guard against buggy ucrt\math.h. 2016-11-28 15:40:23 +00:00
SkSemaphore.h Revert "SkMath takes some functions from from SkTypes" 2018-09-07 17:32:54 +00:00
SkShadowFlags.h Remove deprecated drawShadow interfaces 2018-02-28 19:07:29 +00:00
SkSpinlock.h Cache GrColorSpaceXforms 2016-10-20 20:47:33 +00:00
SkTArray.h SkTArray: behave a little more like std::vector 2018-10-19 16:41:51 +00:00
SkTDArray.h Remove unused methods from SkTDArray 2018-10-19 21:29:08 +00:00
SkTemplates.h Remove SkAutoTCallIProc. 2018-09-20 17:42:02 +00:00
SkTFitsIn.h Reland "use std::enable_if instead of assert()" 2018-06-14 14:51:07 +00:00
SkTHash.h Mark all deleted methods private 2018-06-21 16:37:32 +00:00
SkThreadID.h Unify ThreadID. 2015-09-29 14:38:01 -07:00
SkTInternalLList.h Move SkNoncopyable to include/private. 2018-07-17 21:39:51 +00:00
SkTLogic.h require std::is_trivially_destructible 2018-06-07 16:03:31 +00:00
SkTo.h Revert "Revert "SkTypes: extract SkTo"" 2018-06-14 14:55:17 +00:00
SkTSearch.h Convert NULL and 0 to nullptr. 2017-08-28 17:48:57 +00:00
SkWeakRefCnt.h clean up some odd SkRefCnt features 2018-10-31 20:47:16 +00:00