aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsTestCommon.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 op fuzzGravatar Cary Clark2018-03-19
| | | | | | | | | | | | | | | | | | | fixes the current four fuzzer fails by rewriting asserts as function exits. Passes all extended pathops testing. To run the extended tests: ./out/debug/pathops_unittest -V -x ./out/release/pathops_unittest -V -x R=kjlubick@google.com Docs-Preview: https://skia.org/?cl=114962 Bug: skia: Change-Id: I05bd368a87b38b1121403cf93b21caf76c2e7d7e Reviewed-on: https://skia-review.googlesource.com/114962 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* minor fixes to cubics code and overall alignment of how bounds and tops are ↵Gravatar caryclark2015-04-29
| | | | | | | | | | | | computed for all curve types All but 17 extended tests work. A helper function is privately added to SkPath.h to permit a test to modify a given point in a path. BUG=skia:3588 Review URL: https://codereview.chromium.org/1107353004
* 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
* 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
* Fix last pathops skp bugGravatar caryclark2014-06-18
| | | | | | | | | | | | | | | | | | | | | | This fixes the last bug discovered by iterating through the 800K skp corpus representing the top 1M websites. For every clip on the stack, the paths are replaced with the pathop intersection. The resulting draw is compared with the original draw for pixel errors. At least two prominent bugs remain. In one, the winding value is confused by a cubic with an inflection. In the other, a quad/cubic pair, nearly coincident, fails to find an intersection. These minor changes include ignoring very tiny self-intersections of cubics, and processing degenerate edges that don't connect to anything else. R=reed@android.com TBR=reed Author: caryclark@google.com Review URL: https://codereview.chromium.org/340103002
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-07-17
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@10122 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
* convert pathops to use SkSTArray where possible.Gravatar caryclark@google.com2013-06-17
| | | | | | | | | | | | | | | | | | Replace SkTDArray with SkTArray and use SkSTArray when the probable array size is known. In a couple of places (spans, chases) the arrays are constructed using insert() so SkTArrays can't be used for now. Also, add an optimization to cubic subdivide if either end is zero or one. BUG= Review URL: https://codereview.chromium.org/16951017 git-svn-id: http://skia.googlecode.com/svn/trunk@9635 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
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-04-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8568 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add implementation of path opsGravatar caryclark@google.com2013-04-08
This CL depends on https://codereview.chromium.org/12880016/ "Add intersections for path ops" Given a path, iterate through its contour, and construct an array of segments containing its curves. Intersect each curve with every other curve, and for cubics, with itself. Given the set of intersections, find one with the smallest y and sort the curves eminating from the intersection. Assign each curve a winding value. Operate on the curves, keeping and discarding them according to the current operation and the sum of the winding values. Assemble the kept curves into an output path. Review URL: https://codereview.chromium.org/13094010 git-svn-id: http://skia.googlecode.com/svn/trunk@8553 2bbb7eff-a529-9590-31e7-b0007b416f81