aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsTightBounds.cpp
Commit message (Collapse)AuthorAge
* 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>
* 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>
* Scale the result of TightBounds when path was inverse-scaledGravatar Fredrik Söderquist2017-01-04
| | | | | | | | | | | | | When the path was "large" (as defined by ScaleFactor(...)), the computed bounds would not be adjusted to the correct space. Make sure to scale the result in those cases. BUG=chromium:678162 Change-Id: Ia2eb94050c4620286e9abb69976dbc0202ecc307 Reviewed-on: https://skia-review.googlesource.com/6501 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* tight bounds optimizationGravatar caryclark2016-10-05
| | | | | | | | | | | | | | | | | Add support for tight bounds to detect and return moveTo followed by close or zero-length lineTo. Also short circuit so that hard work is avoided when the path bounds is also the tight bounds. Avoid doing work if the bounds can be trivially computed. Include naked moveTo coordinates in the tight bounds. R=fmalita@chromium.org BUG=skia:5555, skia:5553 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2394443004 Review-Url: https://codereview.chromium.org/2394443004
* Rewriting path writerGravatar caryclark2016-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | The path writer takes constructs the output path out of curves that satisfy the pathop operation. Curves contain lists of t/point pairs that may not be comparable to each other. To match up curve ends in the output path, look for adjacent curves to have a shared membership rather than comparing point values. Use path utilities to connect partial curve lists into closed contours. Share the angle code that determines if a curve has become a degenerate line with the path writer. Clean up some code on the way, and delete some unused functions. TBR=reed@google.com BUG=5188 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2321973005 Review-Url: https://codereview.chromium.org/2321973005
* 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
* fix pathops fuzz bugsGravatar caryclark2016-06-08
| | | | | | | | | | | | | | | | | | | Fail out in a couple of new places when the input data is very large and exceeds the limits of the pathops machinery. Most of the change here plumbs in a way to exclude an assert in one of these exceptional cases. The current SkAddIntersection implementation and the inner functions it calls has no way to report an error to the root caller for an early exit, so rather than add that in, exclude the assert when the test that would trigger it runs (allowing the test to otherwise ensure that it properly fails). TBR=reed@google.com BUG=617586,617635 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2046713003 Review-Url: https://codereview.chromium.org/2046713003
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* fix path ops fuzz busterGravatar caryclark2015-07-23
| | | | | | | | | | | | Mark collapsed segments as done and remove collapsed segment references from the coincidence array. Also add test names to global debugging. R=fmalita@chromium.org BUG=512592 Review URL: https://codereview.chromium.org/1250293002
* 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
* Now, path ops natively intersect conics, quads, and cubics in any ↵Gravatar caryclark2015-04-20
| | | | | | | | | | | combination. There are still a class of cubic tests that fail and a handful of undiagnosed failures from skps and fuzz tests, but things are much better overall. Extended tests (150M+) run to completion in release in about 6 minutes; the standard test suite exceeds 100K and finishes in a few seconds on desktops. TBR=reed BUG=skia:3588 Review URL: https://codereview.chromium.org/1037953004
* cumulative pathops patchGravatar caryclark2015-03-26
| | | | | | | | | | | | | | | | | | | | | Replace the implicit curve intersection with a geometric curve intersection. The implicit intersection proved mathematically unstable and took a long time to zero in on an answer. Use pointers instead of indices to refer to parts of curves. Indices required awkward renumbering. Unify t and point values so that small intervals can be eliminated in one pass. Break cubics up front to eliminate loops and cusps. Make the Simplify and Op code more regular and eliminate arbitrary differences. Add a builder that takes an array of paths and operators. Delete unused code. BUG=skia:3588 R=reed@google.com Review URL: https://codereview.chromium.org/1037573004
* Revert of pathops version two (patchset #16 id:150001 of ↵Gravatar reed2015-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1002693002/) Reason for revert: ASAN investigation Original issue's description: > pathops version two > > R=reed@google.com > > marked 'no commit' to attempt to get trybots to run > > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/ccec0f958ffc71a9986d236bc2eb335cb2111119 TBR=caryclark@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1029993002
* Revert of fix destructor order to fix build (patchset #1 id:1 of ↵Gravatar caryclark2015-03-24
| | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1033703002/) Reason for revert: working on asan fix Original issue's description: > fix destructor order to fix build > > TBR=reed > > Committed: https://skia.googlesource.com/skia/+/c207f9b2e8d6fb5386197fa8a8d258d2c4603418 TBR=reed@android.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1033803002
* fix destructor order to fix buildGravatar caryclark2015-03-24
| | | | | | TBR=reed Review URL: https://codereview.chromium.org/1033703002
* pathops version twoGravatar caryclark2015-03-24
| | | | | | | | | | R=reed@google.com marked 'no commit' to attempt to get trybots to run TBR=reed@google.com Review URL: https://codereview.chromium.org/1002693002
* add pathops tight bounds; conform path ops' gyp to unit testsGravatar caryclark2014-06-24
Implement path tight bounds using path ops machinery. This is not as efficient as it could be; for instance, internally, it creates a path ops structure more suited to intersection. If this shows up as a performance bottleneck, it could be improved. Fix path ops gyp files, which have fallen out of sync with other tests. R=mtklein@google.com, bsalomon@google.com TBR=mtklein BUG=skia:1712 Author: caryclark@google.com Review URL: https://codereview.chromium.org/348343002