Commit Graph

11 Commits

Author SHA1 Message Date
halcanary
96fcdcc219 Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
2015-08-27 07:41:16 -07:00
caryclark
fc95be17c3 fix pathops battle test
The intermediate subtraction threw away bits causing
the subsequent cross product to fail. Defer the
bit truncation until after the vector is computed.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1226933003
2015-07-07 18:09:32 -07:00
caryclark
27c8eb8ffd When three or more edges are coincident, the logic needs
to compute the overlapping ranges and combine the winding
into a single destination.

This computes coincidence more rigorously, fixing the
edge cases exposed by this bug.

Also, add the ability to debug and dump pathop structures
from the coincident context.

TBR=reed@google.com
BUG=skia:3651

Review URL: https://codereview.chromium.org/1182493015
2015-07-06 11:38:33 -07:00
caryclark
624637cc8e Path ops formerly found the topmost unprocessed edge and determined its 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
2015-05-11 07:21:28 -07:00
caryclark
54359294a7 cumulative pathops patch
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
2015-03-26 07:52:43 -07:00
reed
0dc4dd6dda Revert of pathops version two (patchset #16 id:150001 of 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
2015-03-24 13:55:33 -07:00
caryclark
ccec0f958f pathops version two
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
2015-03-24 07:28:17 -07:00
caryclark
65f553182a These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
The fixes include
- detect when finding the active top loops between two possible answers
- preflight chasing winding to ensure answer is consistent
- binary search more often when quadratic intersection fails
- add more failure paths when an intersect is missed

While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.

TBR=
BUG=421132

Committed: https://skia.googlesource.com/skia/+/6f726addf3178b01949bb389ef83cf14a1d7b6b2

Review URL: https://codereview.chromium.org/633393002
2014-11-13 06:58:52 -08:00
hcm
27c46a08a9 Revert of harden pathops for pathological test (patchset #19 id:410001 of https://codereview.chromium.org/633393002/)
Reason for revert:
Compile errors on bots

Original issue's description:
> These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
>
> The fixes include
> - detect when finding the active top loops between two possible answers
> - preflight chasing winding to ensure answer is consistent
> - binary search more often when quadratic intersection fails
> - add more failure paths when an intersect is missed
>
> While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.
>
> TBR=
> BUG=421132
>
> Committed: https://skia.googlesource.com/skia/+/6f726addf3178b01949bb389ef83cf14a1d7b6b2

TBR=caryclark@google.com
NOTREECHECKS=true
NOTRY=true
BUG=421132

Review URL: https://codereview.chromium.org/686843002
2014-10-28 10:55:54 -07:00
caryclark
6f726addf3 These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
The fixes include
- detect when finding the active top loops between two possible answers
- preflight chasing winding to ensure answer is consistent
- binary search more often when quadratic intersection fails
- add more failure paths when an intersect is missed

While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.

TBR=
BUG=421132

Review URL: https://codereview.chromium.org/633393002
2014-10-28 10:33:09 -07:00
caryclark
65b427cff9 fix battlefield website by disallowing very small coordinates
also add and remove comments to document other attempts to fix this that had drawbacks

R=fmalita@chromium.org
BUG=414409

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/575553003
2014-09-18 10:32:57 -07:00