aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsAngleTest.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>
* 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>
* Revert "offset angle check edge in common"Gravatar Cary Clark2017-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d2eb581ebc8f8009e80cccccd74d5b341ef5bd5b. Reason for revert: broke Google3 MSAN run of dm Original change's description: > offset angle check edge in common > > When curves cross, their intersection points may be nearby, but not exactly the same. > Sort the angles formed by the crossing curves when all angles don't have the same > origin. > > This sets up the framework to solve test case that currently fail (e.g., joel6) but > does not fix all related test cases (e.g., joel9). > > All older existing test cases, including extended tests, pass. > > Rework the test framework to better report when tests expected to produce failing > results now pass. > > Add new point and vector operations to support offset angles. > > TBR=reed@google.com > BUG=skia:6041 > > Change-Id: I67c651ded0a25e99ad93d55d6a35109b3ee3698e > Reviewed-on: https://skia-review.googlesource.com/6624 > Commit-Queue: Cary Clark <caryclark@google.com> > Reviewed-by: Cary Clark <caryclark@google.com> > TBR=caryclark@google.com,reviews@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. BUG=skia:6041 Change-Id: I43db0808522ac44aceeb4f70e296167ea84a3663 Reviewed-on: https://skia-review.googlesource.com/7373 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* offset angle check edge in commonGravatar Cary Clark2017-01-20
| | | | | | | | | | | | | | | | | | | | | | | | When curves cross, their intersection points may be nearby, but not exactly the same. Sort the angles formed by the crossing curves when all angles don't have the same origin. This sets up the framework to solve test case that currently fail (e.g., joel6) but does not fix all related test cases (e.g., joel9). All older existing test cases, including extended tests, pass. Rework the test framework to better report when tests expected to produce failing results now pass. Add new point and vector operations to support offset angles. TBR=reed@google.com BUG=skia:6041 Change-Id: I67c651ded0a25e99ad93d55d6a35109b3ee3698e Reviewed-on: https://skia-review.googlesource.com/6624 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* fix fuzzersGravatar caryclark2016-10-20
| | | | | | | | | | | | | | | Many old pathops-related fuzz failures have built up while the codebase was under a state a flux. Now that the code is stable, address these failures. Most of the CL plumbs the debug global state to downstream routines so that, if the data is not trusted (ala fuzzed) the function can safely exit without asserting. TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2426173002 Review-Url: https://chromiumcodereview.appspot.com/2426173002
* path ops stream-liningGravatar caryclark2016-08-25
| | | | | | | | | | | | | | | | The addT() function is a workhorse of pathops. Make it simpler, removing branches and parameters. Separate addOpp() into const and modify parts. Add more debugging that asserts if the function fails and the data is not extreme (e.g., fuzzer generated). TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2273293004 Review-Url: https://codereview.chromium.org/2273293004
* remove point aliasesGravatar caryclark2016-08-24
| | | | | | | | | | | | | | | | This removes the notion of keeping track of every different t value that resolves to the same or a similar point. Other fixes make this concept unnecessary, and removing it simplifies the code. This removes an allocation, and speeds up paths with many overlapping curves. As a bonus, four fuzzer tests that failed before now succeed. TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2275703003 Review-Url: https://codereview.chromium.org/2275703003
* 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
* Remove include of stdlib.h from SkTypes.h.Gravatar bungeman2015-08-26
| | | | | | | | | | | | | | | Unfortunately, immintrin.h (which is also included by SkTypes) includes xmmintrin.h which includes mm_malloc.h which includes stdlib.h for malloc even though, from the implementation, it is difficult to see why. Fortunately, arm_neon.h does not seem to be involved in such shenanigans, so building for Android will keep things sane. TBR=reed@google.com Doesn't change Skia API, just moves an include. Review URL: https://codereview.chromium.org/1313203003
* 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
* Enabling the canvas bit to turn the clip stack into a flat replace exposed ↵Gravatar caryclark2014-06-17
| | | | | | | | | | | | | | | | | | around 100 failures when testing the 800K skp set generated from the top 1M web sites. This fixes all but one of those failures. Major changes include: - Replace angle indices with angle pointers. This was motivated by the need to add angles later but not renumber existing angles. - Aggressive segment chase. When the winding is known on a segment, more aggressively passing that winding to adjacent segments allows fragmented data sets to succeed. - Line segments with ends nearly the same are treated as coincident first. - Transfer partial coincidence by observing that if segment A is partially coincident to B and C then B and C may be partially coincident. TBR=reed Author: caryclark@google.com Review URL: https://codereview.chromium.org/272153002
* remove unused tests to fix new clang buildGravatar commit-bot@chromium.org2014-04-17
| | | | | | | | | | R=mtklein@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/241043002 git-svn-id: http://skia.googlecode.com/svn/trunk@14237 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2014-04-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@14196 2bbb7eff-a529-9590-31e7-b0007b416f81
* Mike R: please sanity check SkPostConfig.hGravatar commit-bot@chromium.org2014-04-14
| | | | | | | | | | | | | | | | | | | | | | | | Mike K: please sanity check Test.cpp and skia_test.cpp Feel free to look at the rest, but I don't expect any in depth review of path ops innards. Path Ops first iteration used QuickSort to order segments radiating from an intersection to compute the winding rule. This revision uses a circular sort instead. Breaking out the circular sort into its own long-lived structure (SkOpAngle) allows doing less work and provides a home for caching additional sorting data. The circle sort is more stable than the former sort, has a robust ordering and fewer exceptions. It finds unsortable ordering less often. It is less reliant on the initial curve tangent, using convex hulls instead whenever it can. Additional debug validation makes sure that the computed structures are self-consistent. A new visualization tool helps verify that the angle ordering is correct. The 70+M tests pass with this change on Windows, Mac, Linux 32 and Linux 64 in debug and release. R=mtklein@google.com, reed@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/131103009 git-svn-id: http://skia.googlecode.com/svn/trunk@14183 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move macros from TestClassDef.h to Test.hGravatar commit-bot@chromium.org2014-01-14
| | | | | | | | | | | | | | Motivation: those macros don't make any sense without the definitions in Test.h. BUG= R=mtklein@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/138563004 git-svn-id: http://skia.googlecode.com/svn/trunk@13074 2bbb7eff-a529-9590-31e7-b0007b416f81
* Get rid of DEFINE_TESTCLASS_SHORT() macro.Gravatar tfarina@chromium.org2014-01-02
| | | | | | | | | | | | | Instead tests should be written using DEF_TEST() macro, which is much nicer and simplifies the process of setting up an unit test. BUG=None TEST=skpskgr_test, pathops_unittest R=mtklein@google.com Review URL: https://codereview.chromium.org/117863005 git-svn-id: http://skia.googlecode.com/svn/trunk@12870 2bbb7eff-a529-9590-31e7-b0007b416f81
* I feel like my clang is especially sensitive to unused variables.Gravatar mtklein@google.com2013-11-22
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/82913006 git-svn-id: http://skia.googlecode.com/svn/trunk@12369 2bbb7eff-a529-9590-31e7-b0007b416f81
* optimize pathops coverageGravatar commit-bot@chromium.org2013-11-21
| | | | | | | | | | | | | | | Remove unused code from SkOpSegment.cpp and friends. Add new tests exposed by coverage. Fix a bug exposed by coverage -- removing the need to detect points that are nearby when intersecting. Add gyp rule for building coverage flavor on Mac. R=mtklein@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/75453003 git-svn-id: http://skia.googlecode.com/svn/trunk@12344 2bbb7eff-a529-9590-31e7-b0007b416f81
* More clang warning fixes.Gravatar commit-bot@chromium.org2013-10-21
| | | | | | | | | | | | | | | | Mostly unused functions and variables removed. BUG=None TEST=ninja -C out/Debug most ninja -C out/Release most R=bsalomon@google.com, caryclark@google.com, robertphillips@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/27933002 git-svn-id: http://skia.googlecode.com/svn/trunk@11884 2bbb7eff-a529-9590-31e7-b0007b416f81
* path ops work in progressGravatar caryclark@google.com2013-09-16
| | | | | | | | | | path ops work in progress BUG= Review URL: https://codereview.chromium.org/21359002 git-svn-id: http://skia.googlecode.com/svn/trunk@11291 2bbb7eff-a529-9590-31e7-b0007b416f81
* turn off debugging printfsGravatar caryclark@google.com2013-07-23
| | | | | | | | | | | | | fix pathops issues 1417, 1418 be more rigorous about pulling intersections of lines to end points rewrite cubic/line and quad/line intersections to share style BUG= Review URL: https://codereview.chromium.org/19543005 git-svn-id: http://skia.googlecode.com/svn/trunk@10270 2bbb7eff-a529-9590-31e7-b0007b416f81
* harden and speed up path op unit testsGravatar caryclark@google.com2013-07-16
| | | | | | | | | | | | | | | | | | | PathOps tests internal routines direcctly. Check to make sure that test points, lines, quads, curves, triangles, and bounds read from arrays are valid (i.e., don't contain NaN) before calling the test function. Repurpose the test flags. - make 'v' verbose test region output against path output - make 'z' single threaded (before it made it multithreaded) The latter change speeds up tests run by the buildbot by 2x to 3x. BUG= Review URL: https://codereview.chromium.org/19374003 git-svn-id: http://skia.googlecode.com/svn/trunk@10107 2bbb7eff-a529-9590-31e7-b0007b416f81
* path ops work in progressGravatar caryclark@google.com2013-07-08
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/18058007 git-svn-id: http://skia.googlecode.com/svn/trunk@9908 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-06-05
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@9440 2bbb7eff-a529-9590-31e7-b0007b416f81
* path ops -- try to fix build againGravatar caryclark@google.com2013-06-04
| | | | | | Review URL: https://codereview.chromium.org/15994019 git-svn-id: http://skia.googlecode.com/svn/trunk@9434 2bbb7eff-a529-9590-31e7-b0007b416f81
* path ops work in progressGravatar caryclark@google.com2013-06-04
| | | | | | | | do not check in Review URL: https://codereview.chromium.org/14865019 git-svn-id: http://skia.googlecode.com/svn/trunk@9433 2bbb7eff-a529-9590-31e7-b0007b416f81
* path ops -- rewrite angle sortGravatar caryclark@google.com2013-06-04
| | | | | | | | | | | | | | | | | | | | | | | | This is a major change resulting from a minor tweak. In the old code, the intersection point of two curves was shared between them, but the intersection points and end points of sorted edges was computed directly from the intersection T value. In this CL, both intersection points and sorted points are the same, and intermediate control points are computed to preserve their slope. The sort itself has been completely rewritten to be more robust and remove 'magic' checks, conditions that empirically worked but couldn't be rationalized. This CL was triggered by errors generated computing the clips of SKP files. At this point, all 73M standard tests work and at least the first troublesome SKPs work. Review URL: https://codereview.chromium.org/15338003 git-svn-id: http://skia.googlecode.com/svn/trunk@9432 2bbb7eff-a529-9590-31e7-b0007b416f81
* bump picture version since SkPath has changed (conics)Gravatar reed@google.com2013-05-31
| | | | | | enable conics in SkPath git-svn-id: http://skia.googlecode.com/svn/trunk@9370 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "add asserts to point<-->verb helpers"Gravatar reed@google.com2013-05-30
| | | | | | This reverts commit b4775ac7b55802e87231768f002e4b42f233b0aa. git-svn-id: http://skia.googlecode.com/svn/trunk@9347 2bbb7eff-a529-9590-31e7-b0007b416f81
* add asserts to point<-->verb helpersGravatar reed@google.com2013-05-30
| | | | | | | | | | patch from issue 16153005 BUG= Review URL: https://codereview.chromium.org/16195004 git-svn-id: http://skia.googlecode.com/svn/trunk@9344 2bbb7eff-a529-9590-31e7-b0007b416f81
* path ops -- fix skp bugsGravatar caryclark@google.com2013-05-07
| | | | | | | | | This fixes a series of bugs discovered by running the small set of Skia skp files through pathops to flatten the clips. Review URL: https://codereview.chromium.org/14798004 git-svn-id: http://skia.googlecode.com/svn/trunk@9042 2bbb7eff-a529-9590-31e7-b0007b416f81
* shape ops work in progressGravatar caryclark@google.com2013-04-17
| | | | | | | | | | | | | Try to fix the 32 bit build by making some math decisions more robust. Rewrite the cubic intersection special case that detects if only end points are shared. Rewrite the angle sort setup that computes whether a cubic bends to the left or right. git-svn-id: http://skia.googlecode.com/svn/trunk@8726 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-04-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8693 2bbb7eff-a529-9590-31e7-b0007b416f81
* path ops work in progressGravatar caryclark@google.com2013-04-15
standardize tests use SK_ARRAY_COUNT everywhere debug why x87 differs from SIMD 64 various platform specific fixes git-svn-id: http://skia.googlecode.com/svn/trunk@8689 2bbb7eff-a529-9590-31e7-b0007b416f81