History log of /external/skia/src/pathops/SkOpSpan.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
18fa6421e9cb7ac2ea6b1a97112a115d6643c0fc 27-Oct-2016 Hal Canary <halcanary@google.com> chmod -x *.cpp *.h

Change-Id: I5b37499505e26e0837921292c1aea0056e4d5ecd
Reviewed-on: https://skia-review.googlesource.com/4035
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pathops/SkOpSpan.cpp
e6522ea38fa3bcfdf2d718ea5ad898b3b3d46e00 17-Oct-2016 caryclark <caryclark@google.com> fix some fuzz

TBR=reed@google.com
BUG=654939, 655829, 656149
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2425733002

Review-Url: https://codereview.chromium.org/2425733002
/external/skia/src/pathops/SkOpSpan.cpp
e47ae2998c1cf944db5743a416583dd0f042b6d9 05-Oct-2016 Cary Clark <caryclark@google.com> remove dead code

Use code coverage and a new '-c' flag to find
and remove unneeded code.

TBR=reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2397593002

patch from issue 2397593002 at patchset 1 (http://crrev.com/2397593002#ps1)

Change-Id: I741a82de9191146c10457d4c0b9cb9605dff2069
Reviewed-on: https://skia-review.googlesource.com/2983
Reviewed-by: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpSpan.cpp
e7bb5b226662f01c91574b29f435acae71c76c46 22-Sep-2016 caryclark <caryclark@google.com> fix next kevin fuzz

Fix one more fuzzer crash.

R=kjlubick@google.com
BUG=skia:5775
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2357373002

Review-Url: https://codereview.chromium.org/2357373002
/external/skia/src/pathops/SkOpSpan.cpp
45f04b8ea8256476d87c677e23d9efbcb0ab937e 21-Sep-2016 caryclark <caryclark@google.com> fix skia pathops fuzzers

Add isolated tests.

R=kjlubick@google.com
BUG=skia:5775
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2358043002

Review-Url: https://codereview.chromium.org/2358043002
/external/skia/src/pathops/SkOpSpan.cpp
81a478ca6c36aac3e53ce0373a281ac8940f4780 09-Sep-2016 caryclark <caryclark@google.com> Skip adding coincident edges found
during curve intersection if their
ends are nearly the same.

Loosen conic/line intersection point
check.

Detect when coincident points are
unordered. This means that points
a/b/c on one curve may appear in
b/c/a order on the opposite curve.

Restructure addMissing to return
success and return if a coincidence
was added as a parameter.

With this, tiger part a works.
Tiger part b exposes bugs around
tight quads that are nearly coincident
with themselves, and are coincident
with something else.

The greedy coicident matcher
may cause the point order to be
out of sync.

Still working out what to do in
this case.

TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2321773002

Review-Url: https://codereview.chromium.org/2321773002
/external/skia/src/pathops/SkOpSpan.cpp
b393a49e5fa7e69ba67692929e9fa2a4e1f6bbb1 07-Sep-2016 caryclark <caryclark@google.com> fix pathops fuzzers

Extreme values trigger asserts that in range
values allow.

Disable asserts and other tests to prevent
extreme values from crashing.

TBR=reed@google.com
BUG=644684. 644680, 644640
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2316173002

Review-Url: https://codereview.chromium.org/2316173002
/external/skia/src/pathops/SkOpSpan.cpp
30b9fdd6a1d607bde20c793af65b5e2e8a1737ca 31-Aug-2016 caryclark <caryclark@google.com> pathops coincident work

This is working towards fixing all bugs around simplifying the tiger.

This installment simplifies the point-t intersection list as it is built rather than doing the analysis once the intersections are complete. This avoids getting the list in an inconsistent state and makes coincident checks faster and more stable.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2237223002

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

Review-Url: https://codereview.chromium.org/2237223002
/external/skia/src/pathops/SkOpSpan.cpp
29b2563afb1677515739f1d24fb27733626eca92 25-Aug-2016 caryclark <caryclark@google.com> path ops stream-lining

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
/external/skia/src/pathops/SkOpSpan.cpp
ef4f32ac858825dc443cfe4739ea878fb0bf550f 24-Aug-2016 caryclark <caryclark@google.com> remove point aliases

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
/external/skia/src/pathops/SkOpSpan.cpp
1597628fa38d24f23ad505bfb40e70e7c8617457 21-Jul-2016 caryclark <caryclark@google.com> fix fuzzer bug

Fix another fuzzer bug.

Some PathOps asserts only make sense if the incoming data is
well-behaved. Well-behaved tests set debugging state to
trigger these additional asserts.

Formalize this by creating macros similar to SkASSERT that
check to see if the assert should be skipped.

TBR=reed@google.com
BUG=629962
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2169863002

Review-Url: https://codereview.chromium.org/2169863002
/external/skia/src/pathops/SkOpSpan.cpp
1493b9772d6fad455a222ec6f242903128e049a0 19-Jul-2016 caryclark <caryclark@google.com> fix fuzzer

Previous spans always have a valid next pointer. The final span does not.
Change the test for a valid link to take into consideration whether
the links are chased forwards or backwards.

TBR=reed@google.com
BUG=629454
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2166543002

Review-Url: https://codereview.chromium.org/2166543002
/external/skia/src/pathops/SkOpSpan.cpp
55888e44171ffd48b591d19256884a969fe4da17 18-Jul-2016 caryclark <caryclark@google.com> pathops coincidence and security rewrite

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
/external/skia/src/pathops/SkOpSpan.cpp
18300a3aa7cb6eb55d21bb0450dffa58b6fc062c 16-Mar-2016 mtklein <mtklein@chromium.org> detach -> release

The C++ standard library uses the name "release" for the operation we call "detach".

Rewriting each "detach(" to "release(" brings us a step closer to using standard library types directly (e.g. std::unique_ptr instead of SkAutoTDelete).

This was a fairly blind transformation. There may have been unintentional conversions in here, but it's probably for the best to have everything uniformly say "release".

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1809733002

Review URL: https://codereview.chromium.org/1809733002
/external/skia/src/pathops/SkOpSpan.cpp
ef784fb7f58c9c021172045a8e0b396c81fdc425 30-Oct-2015 caryclark <caryclark@google.com> More conic-specific tests revealed a few conic-specific bugs. Because javascript / canvas make visualizing conics tricky, new native tools are required.

The utility SubsetPath removes parts of a potentially very large path to isolate a minimal test case. SubsetPath is very useful for debugging path ops, but is not path ops specific.

PathOpsBuilderConicTest compares the output of the Path Ops Builder, sequential calls to Simplify, and SkRegions for some number of rotated ovals.

Some tests caused path ops to hang. It was caught adding a loop of curves because the head was not found by the tail. Even though the root cause has been fixed, SkSegment::addCurveTo callers now abort the path op if the same curve was added twice.

The subdivided conic weight was been computed anew. Fortunately, it's a simpler computation that the one it replaces.

Some Simplify() subroutines returned false to signal that the results needed assembling. Change these to abort the current operation instead.

Coincident curve intersection triggered two small bugs; one where no perpendicular could be found for coincident curves, and one where no coincident curves remain after looping.

The SixtyOvals test can be run through multiple processes instead of multiple threads. This strategy allows a 48 core machine to saturate all cores at 100%.

The DEBUG_VISUALIZE_CONICS code in PathOpsConicIntersectionTest acknowleges that it is easier to visualize conics with Skia than with script and html canvas. This test also verifies that path ops subdivision matches geometry chopping.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1405383004
/external/skia/src/pathops/SkOpSpan.cpp
96fcdcc219d2a0d3579719b84b28bede76efba64 27-Aug-2015 halcanary <halcanary@google.com> Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
/external/skia/src/pathops/SkOpSpan.cpp
60e0fee6d4acff638ccc9670c4055aced529a7a0 26-Aug-2015 bungeman <bungeman@google.com> Remove include of stdlib.h from SkTypes.h.

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
/external/skia/src/pathops/SkOpSpan.cpp
d4349723fac9c0fd4dcf8c275fb7c756bdfdff7b 23-Jul-2015 caryclark <caryclark@google.com> fix path ops fuzz buster

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
/external/skia/src/pathops/SkOpSpan.cpp
27c8eb8ffd7e221693d840c2b9279d53fe6f03d4 06-Jul-2015 caryclark <caryclark@google.com> 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
/external/skia/src/pathops/SkOpSpan.cpp
218f21ac09c70b98a10cb8e1999b85a22fa0b151 29-Jun-2015 caryclark <caryclark@google.com> don't fix winding for empty paths

A path can be non-empty but become empty when it is simplified.
For instance, a path with the same rectangle, twice, with opposite
windings.

No contours are created for empty paths, so don't try to
fix their winding direction.

Additionally, check for a NULL coincidence since the
OpBuilder assumes that no concidence edges can be present
after the paths are simplified. This code should not get
called, but it's worth the future-proofing to check.

R=fmalita@chromium.org
BUG=502792

Review URL: https://codereview.chromium.org/1218863005
/external/skia/src/pathops/SkOpSpan.cpp
bca19f77479adfd8ba2171753382bc8bf4c2b4ca 13-May-2015 caryclark <caryclark@google.com> deal more consistently with unsortable edges

Improve line/curve coincident detection and resolution. This fixed the remaining simple failures.

When an edge is unsortable, use the ray intersection to determine the angles' winding.

Deal with degenerate segments.

TBR=reed@google.com
BUG=skia:3588,skia:3762

Review URL: https://codereview.chromium.org/1140813002
/external/skia/src/pathops/SkOpSpan.cpp
624637cc8ec22c000409704d0b403ac1b81ad4b0 11-May-2015 caryclark <caryclark@google.com> 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
/external/skia/src/pathops/SkOpSpan.cpp
08bc8488fa2ea2d2a17efb1443f0ec6579d5a3c8 24-Apr-2015 caryclark <caryclark@google.com> fix multiple intersection logic

When three or more curves intersect at the same point, ensure that
each curve records the intersections of the others. This fixes a
number of cubic tests.

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

Review URL: https://codereview.chromium.org/1105943002
/external/skia/src/pathops/SkOpSpan.cpp
1049f1246e7be4ccb68001361efceb8933e6f81c 20-Apr-2015 caryclark <caryclark@google.com> Now, path ops natively intersect conics, quads, and cubics in any 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
/external/skia/src/pathops/SkOpSpan.cpp
54359294a7c9dc54802d512a5d891a35c1663392 26-Mar-2015 caryclark <caryclark@google.com> 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
/external/skia/src/pathops/SkOpSpan.cpp
0dc4dd6dda9a7912f696b46d9c02155ec1d1ba5f 24-Mar-2015 reed <reed@google.com> 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
/external/skia/src/pathops/SkOpSpan.cpp
ccec0f958ffc71a9986d236bc2eb335cb2111119 24-Mar-2015 caryclark <caryclark@google.com> 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
/external/skia/src/pathops/SkOpSpan.cpp