aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsWinding.cpp
Commit message (Collapse)AuthorAge
* Stop using SkTSwap.Gravatar Ben Wagner2018-06-19
| | | | | | | | | | | | | Use std::swap instead. It does not appear that any external user specializes SkTSwap, but some may still use it. This removes all use in Skia so that SkTSwap can later be removed in a smaller CL. After that the <utility> include can be removed from SkTypes.h. Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753 Reviewed-on: https://skia-review.googlesource.com/135578 Reviewed-by: Hal Canary <halcanary@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Fix float-cast-overflow in SkOpSpan::sortableTop.Gravatar Ben Wagner2017-09-19
| | | | | | | | Bug: skia:4632 Change-Id: I5af8bb7b04673307cdf7865bb7d56a041ba27d83 Reviewed-on: https://skia-review.googlesource.com/47320 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
* SkSTArenaAllocGravatar Florin Malita2017-05-24
| | | | | | | | | Syntactic sugar, gets rid of some boilerplate. Change-Id: Ibdb28b7a8f1d5e4a4e18c12d423b987d7194e340 Reviewed-on: https://skia-review.googlesource.com/17837 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Remove SkOpTAllocatorGravatar Herb Derby2017-04-19
| | | | | | | | | | Have the callsites of SkOpTAllocator call SkArenaAlloc directly. Bug: skia: Change-Id: Ic54e92c3e9a0abed038aa3ae40e8a195895af99d Reviewed-on: https://skia-review.googlesource.com/13870 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Move from SkChunkAlloc to SkArenaAlloc for PathOpsGravatar Herb Derby2017-03-07
| | | | | | | | | Attempt two. Remove ~SkOpContour because it is handled by the SkArenaAlloc. Change-Id: Id3049db97aebcc1009d403a031f2fac219f58f2f Reviewed-on: https://skia-review.googlesource.com/9381 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Revert "Move from SkChunkAlloc to SkArenaAlloc for PathOps"Gravatar Derek Sollenberger2017-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 38c60180241e335e368fdadbf7856aff114ff668. Reason for revert: breaking ASAN run in TAP build Original change's description: > Move from SkChunkAlloc to SkArenaAlloc for PathOps > > Change-Id: Iab111a4ebcae4e896b1fdfe285def9ef0ae2ab6b > Reviewed-on: https://skia-review.googlesource.com/7314 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Herb Derby <herb@google.com> > TBR=herb@google.com,caryclark@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I6364254571bb1617a9f45ed08f2af4a59f9d5841 Reviewed-on: https://skia-review.googlesource.com/9335 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Move from SkChunkAlloc to SkArenaAlloc for PathOpsGravatar Herb Derby2017-03-06
| | | | | | | Change-Id: Iab111a4ebcae4e896b1fdfe285def9ef0ae2ab6b Reviewed-on: https://skia-review.googlesource.com/7314 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Herb Derby <herb@google.com>
* check for empty contours in sortable topGravatar Cary Clark2016-12-20
| | | | | | | | | | TBR=reed@google.com BUG=675132 Change-Id: I022ce0c59574b450e47e22a3dac0929034439b1b Reviewed-on: https://skia-review.googlesource.com/6334 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* fix fuzzing empty contours squirrelly cubicsGravatar Cary Clark2016-12-16
| | | | | | | | | | | | | | | | | | | The fuzzer triggered relatively new code that missized the split cubic array, i.e., if a cubic is split in three places it makes four cubics. The fuzzer triggered other relative new code that permits a contour to be empty. This happens when a line crosses over itself but doesn't enclose anything. R=kjlubick@google.com BUG=skia:6061 Change-Id: I0c04d0d390ff1092f7b3bb28ebbfca517451f497 Reviewed-on: https://skia-review.googlesource.com/6223 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* coin debugging runs all tests in extendedGravatar Cary Clark2016-10-04
| | | | | | | | | | | | | | | | | | | This extends path ops concidence debugging to find unused algorithms and determine the extent of loops. This verifies that all 140M tests run without error in release and debug. TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2391733002 patch from issue 2391733002 at patchset 1 (http://crrev.com/2391733002#ps1) Change-Id: I02ca29764405c5ac3e7ca3b2621fba28dbaaffc2 Reviewed-on: https://skia-review.googlesource.com/2923 Reviewed-by: Cary Clark <caryclark@google.com>
* pathops coincidence and security rewriteGravatar caryclark2016-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most changes stem from working on an examples bracketed by #if DEBUG_UNDER_DEVELOPMENT // tiger These exposed many problems with coincident curves, as well as errors throughout the code. Fixing these errors also fixed a number of fuzzer-inspired bug reports. * Line/Curve Intersections Check to see if the end of the line nearly intersects the curve. This was a FIXME in the old code. * Performance Use a central chunk allocator. Plumb the allocator into the global variable state so that it can be shared. (Note that 'SkGlobalState' is allocated on the stack and is visible to children functions but not other threads.) * Refactor Let SkOpAngle grow up from a structure to a class. Let SkCoincidentSpans grow up from a structure to a class. Rename enum Alias to AliasMatch. * Coincidence Rewrite Add more debugging to coincidence detection. Parallel debugging routines have read-only logic to report the current coincidence state so that steps through the logic can expose whether things got better or worse. More functions can error-out and cause the pathops engine to non-destructively exit. * Accuracy Remove code that adjusted point locations. Instead, offset the curve part so that sorted curves all use the same origin. Reduce the size (and influence) of magic numbers. * Testing The debug suite with verify and the full release suite ./out/Debug/pathops_unittest -v -V ./out/Release/pathops_unittest -v -V -x expose one error. That error is captured as cubics_d3. This error exists in the checked in code as well. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2128633003 BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2128633003 Review-Url: https://codereview.chromium.org/2128633003
* A Mozilla developer ran the µmix static analyzer on its codebase and ↵Gravatar lsalzman2016-06-07
| | | | | | | | | | | incidentally found some issues regarding null checks in Skia. This fixes the issues that were found. Downstream bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1278452 BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2046563007 Review-Url: https://codereview.chromium.org/2046563007
* Reland of path ops: fix conic weight and partial coincidence (patchset #1 ↵Gravatar caryclark2015-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:1 of https://codereview.chromium.org/1408923003/ ) Reason for revert: suppressions have landed in chrome Original issue's description: > Revert of path ops: fix conic weight and partial coincidence (patchset #5 id:80001 of https://codereview.chromium.org/1413763002/ ) > > Reason for revert: > path ops change breaks svg clipping layout tests -- conic is now more accurate, changing edge of circle in clip > > These need to be rebaselined > > svg/clip-path/clip-path-child-clipped.svg > svg/clip-path/clip-path-nonzero.svg > svg/clip-path/clip-path-evenodd-nonzero.svg > svg/clip-path/clip-path-nonzero-evenodd.svg > > Original issue's description: > > The remaining 1m skp bugs are asserts that can be harmlessly > > suppressed and bugs around conics. > > > > The conic calculation for a subdivided w was just wrong. > > > > Also added debugging to template intersection to initialize > > reused structures and dump additional data. > > > > TBR=reed@google.com > > > > Committed: https://skia.googlesource.com/skia/+/ef33b1e739b23a1201100ff17a572da85b03d9af > > TBR= > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Committed: https://skia.googlesource.com/skia/+/f428df1be3e96d3f8970d0f7f415b862f7da5404 TBR= NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1407003016
* Revert of path ops: fix conic weight and partial coincidence (patchset #5 ↵Gravatar caryclark2015-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:80001 of https://codereview.chromium.org/1413763002/ ) Reason for revert: path ops change breaks svg clipping layout tests -- conic is now more accurate, changing edge of circle in clip These need to be rebaselined svg/clip-path/clip-path-child-clipped.svg svg/clip-path/clip-path-nonzero.svg svg/clip-path/clip-path-evenodd-nonzero.svg svg/clip-path/clip-path-nonzero-evenodd.svg Original issue's description: > The remaining 1m skp bugs are asserts that can be harmlessly > suppressed and bugs around conics. > > The conic calculation for a subdivided w was just wrong. > > Also added debugging to template intersection to initialize > reused structures and dump additional data. > > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/ef33b1e739b23a1201100ff17a572da85b03d9af TBR= NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1408923003
* The remaining 1m skp bugs are asserts that can be harmlesslyGravatar caryclark2015-10-20
| | | | | | | | | | | | | suppressed and bugs around conics. The conic calculation for a subdivided w was just wrong. Also added debugging to template intersection to initialize reused structures and dump additional data. TBR=reed@google.com Review URL: https://codereview.chromium.org/1413763002
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* fix builder winding againGravatar caryclark2015-05-18
| | | | | | | | | | Record the nesting level when finding the edge winding contribution so that inner edges can be reversed as needed. R=fmalita@chromium.org BUG=skia:3838 Review URL: https://codereview.chromium.org/1140383002
* The path ops builder code needs to determine the winding of each contour ↵Gravatar caryclark2015-05-18
| | | | | | | | | | | | | | added, and reverse windings if the contours are nested in other contours. Cheap (one contour) paths can be evaluated and reversed as needed with a minimum of checking, but multi-contour paths invoke the regular path ops machinery to determine who is contained by whom. More tests need to be added to verify that all corner cases are considered, but this fixes the cases in the bug thus far. R=fmalita@chromium.org TBR=reed@google.com BUG=skia:3838 Review URL: https://codereview.chromium.org/1129193006
* Path ops formerly found the topmost unprocessed edge and determined its ↵Gravatar caryclark2015-05-11
angle sort order to initialize the winding. This never worked correctly with cubics and was flaky with paths consisting mostly of vertical edges. This replacement shoots axis-aligned rays through all intersecting edges to find the outermost one either horizontally or vertically. The resulting code is smaller and twice as fast. To support this, most of the horizontal / vertical intersection code was rewritten and standardized, and old code supporting the top-directed winding was deleted. Contours were pointed to by an SkTDArray. Instead, put them in a linked list, and designate the list head with its own class to ensure that methods that take lists of contours start at the top. This change removed a large percentage of memory allocations used by path ops. TBR=reed@google.com BUG=skia:3588 Review URL: https://codereview.chromium.org/1111333002