History log of /external/skia/src/pathops/SkOpCoincidence.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ecc364c42691f24b41a672de1636b3a5f181160a 19-Apr-2017 Herb Derby <herb@google.com> Remove SkOpTAllocator

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>
/external/skia/src/pathops/SkOpCoincidence.cpp
4eed4c885050132b7131324ea336ad0f6d977fef 08-Mar-2017 Cary Clark <caryclark@skia.org> limit addEndMoveSpans loop in pathops

Prevent addEndMoveSpans from looping
forever and abort with an error
if the loop count is crazy big.

R=kjlubick@google.com
BUG=684553

Change-Id: I16c250c0b2f88534f809aba17a18081aea4e1f44
Reviewed-on: https://skia-review.googlesource.com/9458
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpCoincidence.cpp
4c76c41c981dd7ea95062a1895a6e3415b70bce1 20-Jan-2017 Cary Clark <caryclark@google.com> fix fuzz asserts triggered by old fuzzes

fuzz fixes

Fixes from running all pathops fuzz testson ToT.

R=kjlubick@google.com
BUG=skia:

Change-Id: Ic84b868a0cc53993e6561bc95fa364218bc3aa34
Reviewed-on: https://skia-review.googlesource.com/7325
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpCoincidence.cpp
5a2057aee9c6293c3dc78cfb013c06ea707d39e4 03-Jan-2017 Cary Clark <caryclark@google.com> fix fuzzer

abort if incoming data is out of range

TBR=reed@google.com
BUG=676866

Change-Id: I7d4850611654a399e32ea2012b23ca369dc53e70
Reviewed-on: https://skia-review.googlesource.com/6525
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpCoincidence.cpp
ab2d73b06fe6c518be1d399a79c9cc39db21abb6 16-Dec-2016 Cary Clark <caryclark@google.com> rework xor to be more like winding

Pathops is very well exercised with winding paths,
but less so with xor (even odd) paths.

Rewrite the xor main loop to look like the winding
one to take advantage of the latter's bug fixes.

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

Change-Id: Ied8d522254a327b1817b54f0abbf4414f5fab7da
Reviewed-on: https://skia-review.googlesource.com/6228
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpCoincidence.cpp
db8f44f497f2b67b2500bbfc7b11ce7a510c5e5c 15-Dec-2016 Cary Clark <caryclark@google.com> speculative pointer to member fix

Move the body of simple functions
out of line if they are used in
pointer to member function expressions.

This may fix a chromeos-reported bug.

TBR=reed@google.com
BUG=674047

Change-Id: Id2a080a6d047103a48ebe2319abdae444de413e3
Reviewed-on: https://skia-review.googlesource.com/6110
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpCoincidence.cpp
26ae5aba592d4169c1c53aa7fafa660589a4d554 12-Dec-2016 Cary Clark <caryclark@google.com> fix fuzz

Don't walk off the end if the loop doesn't
contain the expected value.

R=kjlubick@google.com
BUG=skia:6047

Change-Id: I96815180dc7c92b45691037ae6c4b40beedc009a
Reviewed-on: https://skia-review.googlesource.com/5845
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpCoincidence.cpp
59ed482af72beec6812b28d833d8bdf80ba32df7 08-Dec-2016 Cary Clark <caryclark@google.com> fix fuzzers

Two crashes and a hang. Abort and return false
in these cases.

TBR=kjlubick@google.com
BUG=skia:5983

Change-Id: I41ac3e56d47ee423b634b2f4886085b9caada76b
Reviewed-on: https://skia-review.googlesource.com/5716
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpCoincidence.cpp
9de097639f04e5a18da2d2b123dace9d24ab50e4 17-Nov-2016 Cary Clark <caryclark@google.com> fix fuzzer crash

Fail if data is
inconsistent.

R=kjlubick@google.com
BUG=skia:

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

Change-Id: Ie3f65c80c0d59968b1e3fc8bc91839bedb2e3da3
Reviewed-on: https://skia-review.googlesource.com/4923
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
/external/skia/src/pathops/SkOpCoincidence.cpp
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/SkOpCoincidence.cpp
595ac28c3990ea89ee40ec14117dc1667acfc126 24-Oct-2016 caryclark <caryclark@google.com> fix a few more fuzzes

Minor changes to fix some fuzz conditions.
A couple of ignored asserts when the data
is fuzzy, and one fail condition when the
underlying data has already been deleted.

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

Review-Url: https://codereview.chromium.org/2443243002
/external/skia/src/pathops/SkOpCoincidence.cpp
826167111f80a4251266812cf720ad712bd29446 24-Oct-2016 caryclark <caryclark@google.com> fix one more fuzzer

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

Review-Url: https://codereview.chromium.org/2438333002
/external/skia/src/pathops/SkOpCoincidence.cpp
78a37a53365c24670b050acf993818c435922745 20-Oct-2016 caryclark <caryclark@google.com> fix more fuzz, carsvg

Fix a few kevin-generated fuzzers.

Remove an assert triggered by
carsvg when thrown through the
distance field stuff.

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

Review-Url: https://chromiumcodereview.appspot.com/2427253005
/external/skia/src/pathops/SkOpCoincidence.cpp
96dc1c9efaab4636e30f90aa377f25863f9bf3ba 20-Oct-2016 caryclark <caryclark@google.com> fix more chrome asan fuzzer failures

Small change to gracefully quit
when fuzzer values cause pathops
to fail.

TBR=reed@google.com
BUG=657411, 657559
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2426393004

Review-Url: https://chromiumcodereview.appspot.com/2426393004
/external/skia/src/pathops/SkOpCoincidence.cpp
a35ab3e6e024d0b548ded26a2e3b8ecd838ead93 20-Oct-2016 caryclark <caryclark@google.com> fix fuzzers

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
/external/skia/src/pathops/SkOpCoincidence.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/SkOpCoincidence.cpp
087140153861f4c2a003ce6b22a612acc9cc3cf9 07-Oct-2016 caryclark <caryclark@google.com> fix another fuzz

Add one more early exit.

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

Review-Url: https://codereview.chromium.org/2401673004
/external/skia/src/pathops/SkOpCoincidence.cpp
221a4bb55b51a6ba3882811990581d4bdb6bd539 07-Oct-2016 caryclark <caryclark@google.com> fix fuzz busters

When fuzz is hit
just quit

TBR=reed@google.com
BUG=skia:5837, skia:5838, skia:5839
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2404483002

Review-Url: https://codereview.chromium.org/2404483002
/external/skia/src/pathops/SkOpCoincidence.cpp
40f23780e7ca36818660add0faf783fda81bf0b1 06-Oct-2016 Cary Clark <caryclark@google.com> fuzzer fix

Error out when fuzzing
conditions are met.

Also, make degenerate
input line ends consistent.

TBR=reed@google.com
BUG=653452, 626164, skia:5829

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

Change-Id: I23a01adde9dec07b54d66ab2418b3ea0b96e4456
Reviewed-on: https://skia-review.googlesource.com/3048
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpCoincidence.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/SkOpCoincidence.cpp
3fdf52cf389d58be9ce4b948dfecffd53edb5da2 04-Oct-2016 Cary Clark <caryclark@google.com> fix fuzz with null check

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

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

Change-Id: I1957d3f8f5c78bed41bb7fe413ae870df24f7c50
Reviewed-on: https://skia-review.googlesource.com/2925
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpCoincidence.cpp
ab87d7abf1df007c90bef2e916294ca325d81c81 04-Oct-2016 Cary Clark <caryclark@google.com> coin debugging runs all tests in extended

This extends path ops concidence debugging
to find unused algorithms and determine the extent
of loops.

This verifies that all 140M tests run without error
in release and debug.

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

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

Change-Id: I02ca29764405c5ac3e7ca3b2621fba28dbaaffc2
Reviewed-on: https://skia-review.googlesource.com/2923
Reviewed-by: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpCoincidence.cpp
6c3b9cdcb047afe963c7bcf34834ba2ecccacc33 26-Sep-2016 caryclark <caryclark@google.com> fix tiger b

The tiger tests have uncovered numerous bugs.
This CL fixes the last of them.

If a pair of curves do not intersect, but
have one or both ends very close to the opposite
curve, consider that an intersection.

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

Review-Url: https://codereview.chromium.org/2356363003
/external/skia/src/pathops/SkOpCoincidence.cpp
27c015dfcf4e2b8fb1abe327cc40204e2a4f452a 23-Sep-2016 caryclark <caryclark@google.com> split tight quads and conics

Tight quads and conics may nearly fold over on themselves, confusing
coincidence against other curves. Split them at their max curvature
early on to avoid complicating later logic.

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

Review-Url: https://codereview.chromium.org/2357353002
/external/skia/src/pathops/SkOpCoincidence.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/SkOpCoincidence.cpp
bbfe92bc1dd2b0a65e63b3caed9873dbc4df522a 19-Sep-2016 caryclark <caryclark@google.com> fix fuzzer bugs

Add a couple more cases where Op() fails and
returns false when the out of range input
values make the internal numeric unstable.

TBR=reed@google.com
BUG=647834, 648068
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2348263002

Review-Url: https://codereview.chromium.org/2348263002
/external/skia/src/pathops/SkOpCoincidence.cpp
e839e78443e48d4ccad89059b4bc4b3d894fcfdd 15-Sep-2016 caryclark <caryclark@google.com> quad and conic do not intersect

If a quad a conic intersect only where the end of one
is contained by the convex hull of the other, and the
curve contained by the hull is nearly a straight line,
treating it as a line may move the end point to the
other side of the curve.

Detect this by checking to see if the end point is in
the hull, and if so, continue to subdivide the curve
rather than treating it as a line.

This fixes several existing tests that were disabled
earlier this year.

A typo in SkDCurve::nearPoint() prevented detecting when
the end of a line was nearly touching a curve.

Also fixed concidence a bit to get the second half of
tiger further along.

All existing tests, including extended testing in
Release and the first half of tiger, work.

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

Review-Url: https://codereview.chromium.org/2338323002
/external/skia/src/pathops/SkOpCoincidence.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/SkOpCoincidence.cpp
c9b90d15df5fcee848812fbab3d714aba9e41e69 09-Sep-2016 caryclark <caryclark@google.com> fix fuzzer

Earlier fix aborted coincident loop on wrong condition.
This aborts only when it reaches the end, and then
propagates the error out correctly.

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

Review-Url: https://codereview.chromium.org/2327053002
/external/skia/src/pathops/SkOpCoincidence.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/SkOpCoincidence.cpp
8016b264ceec2b11d2acbeb77a9fbe66e48368b9 06-Sep-2016 caryclark <caryclark@google.com> interpolation of coincidence must be local to a single span

Pathops makes up intersections that it doesn't detect directly,
but do exist. For instance, if a is coincident with b, and
b is coincident with c, then for where they overlap
a is coincident with c.

The intersections are made up in different ways. In a few
places, the t values that are detected are interpolated to
guess the t values that represent invented intersections.

The interpolated t is not necessarily linear, but a linear
guess is good enough if the invented t lies between known
t values.

Additionally, improve debugging.

This passes the extended release test suite and additionally
passes the first 17 levels in the tiger test suite;
previously, path ops passed 7 levels.

The tiger suite is composed of 37 levels in increasing
complexity, described by about 300K tests.

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

Review-Url: https://codereview.chromium.org/2300203002
/external/skia/src/pathops/SkOpCoincidence.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/SkOpCoincidence.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/SkOpCoincidence.cpp
025b11ecde8733d9b3eee54e132cc50a5ce8eb78 25-Aug-2016 caryclark <caryclark@google.com> add pathops debugging

Pathops has many points of failure, most of which
are triggered by extreme data generated by fuzzers.
It's difficult to figure out which failure point
was triggered when the operation gives up.

Add instrumentation so that the failure can
be debugged when the data is well-behaved.

Also, add a check that looks for a sequence of
coincident points on multiple edges that are out
of order when compared to each other.

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

Review-Url: https://codereview.chromium.org/2274803003
/external/skia/src/pathops/SkOpCoincidence.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/SkOpCoincidence.cpp
429428660b247bb3ccb3195aa8b3abe3194d4d5b 19-Aug-2016 caryclark <caryclark@google.com> fix fuzzes

TBR=reed@google.com
BUG=639157, 638783
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255243003

Review-Url: https://codereview.chromium.org/2255243003
/external/skia/src/pathops/SkOpCoincidence.cpp
a1b42d91a5726683d7933b81a6e00ed28649e7ed 16-Aug-2016 caryclark <caryclark@google.com> fix fuzz bug

TBR=reed@google.com
BUG=637968, 638002
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2250573003

Review-Url: https://codereview.chromium.org/2250573003
/external/skia/src/pathops/SkOpCoincidence.cpp
c6d855f7f3d548c52f450299dc6975820cda3387 11-Aug-2016 caryclark <caryclark@google.com> start working on tiger again

The tiger tests are a suite under development
that exercise many coincident edge cases.

This fixes the case when a duplicate point is not
ignored when the coincident span references the
primary point.

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

Review-Url: https://codereview.chromium.org/2239803002
/external/skia/src/pathops/SkOpCoincidence.cpp
643ede69216c073c2dd497c382577dc9fde36b3e 08-Aug-2016 caryclark <caryclark@google.com> template intersection fuzz fixes

Plumb in the ability to ignore asserts for out of range input
deeper into the template intersection code.

Exit gracefully when error conditions are found.

TBR=reed@google.com
BUG=632607,632628,633063,633065,634251,633608
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2224823004

Review-Url: https://codereview.chromium.org/2224823004
/external/skia/src/pathops/SkOpCoincidence.cpp
fc560e09b3f777bb32dccb9f52d715383a10a620 27-Jul-2016 caryclark <caryclark@google.com> fuzz wednesday

Add debug 'skip assert' access to SkCoincidentSpans.
That permits suppressing asserts to make it easier
to detect when this fuzz data generates unparsable
data.

TBR=reed@google.com
BUG=631564, 631992
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2186973002

Review-Url: https://codereview.chromium.org/2186973002
/external/skia/src/pathops/SkOpCoincidence.cpp
e25a4f6cbeaccfdc34cf031103f0fbc3e53a3ee5 26-Jul-2016 caryclark <caryclark@google.com> fix fuzz bugs

Add ability for intersection template to detect that
the test contains bounded numbers so that extra
asserts can trigger.

Add some exit points for out of range numbers
in those templates.

TBR=reed@google.com
BUG=631383,631374,631360
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2185703002

Review-Url: https://codereview.chromium.org/2185703002
/external/skia/src/pathops/SkOpCoincidence.cpp
8bc90e2db692e02048f15e2f165f6d61c6110419 25-Jul-2016 caryclark <caryclark@google.com> fix fuzz

Extreme inputs trigger asserts intended for in range data.
Return an error without asserting unless the test signals
otherwise.

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

Review-Url: https://codereview.chromium.org/2178923002
/external/skia/src/pathops/SkOpCoincidence.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/SkOpCoincidence.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/SkOpCoincidence.cpp
3f0753d3eccece8ac7f02f6af36d66a96c3dfb26 28-Jun-2016 caryclark <caryclark@google.com> fix fuzz bugs

Detect more places where the pathops numerics cause numbers
to become nearly identical and subsequently fail. These tests
have extreme inputs and cannot succeed.

Also remove the expectSuccess parameter from PathOpsDebug
and check instead in the test framework.

R=mbarbella@chromium.org
TBR=reed@google.com
BUG=623072,623022
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2103513002

Review-Url: https://codereview.chromium.org/2103513002
/external/skia/src/pathops/SkOpCoincidence.cpp
013e0e6d482f61181b829bf5ebfcad912c0061b1 10-Jun-2016 caryclark <caryclark@google.com> add fail condition to addexpanded

If coincident pairs don't match,
give up rather than deref null.

R=fmalita@chromium.org
BUG=618991
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2058773002

Review-Url: https://codereview.chromium.org/2058773002
/external/skia/src/pathops/SkOpCoincidence.cpp
dae6b97705fde08958b1a36fa6ce685d28fc692c 08-Jun-2016 caryclark <caryclark@google.com> fix pathops fuzz bugs

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
/external/skia/src/pathops/SkOpCoincidence.cpp
5c5cfe24efe4c728e787447dabffe345080d1fb9 05-Apr-2016 caryclark <caryclark@google.com> give up if huge paths have unresolvable coincidence

This fuzzy test has enormous curves with coincidence runs that break numerics.
If the computed intersections identify that the span of coincidence has been deleted,
give up and return that the path op failed.

TBR=reed@google.com
BUG=597926
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1854333002

Review URL: https://codereview.chromium.org/1854333002
/external/skia/src/pathops/SkOpCoincidence.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/SkOpCoincidence.cpp
364a0074c33f91ded60232f173f7a57a312e9280 14-Dec-2015 caryclark <caryclark@google.com> path ops: check for deleted ends

TBR=fmalita@chromium.org
BUG=569540

Review URL: https://codereview.chromium.org/1524803002
/external/skia/src/pathops/SkOpCoincidence.cpp
a3375e4251c4b2cbf0b5bbdcebfe911914496881 07-Dec-2015 caryclark <caryclark@google.com> fix coincident fuzzer

This fuzzer has very large Y values that cause the
points to sort incorrectly by t. Exit out as soon
as this is detected.

TBR=reed@google.com
BUG=561121

Review URL: https://codereview.chromium.org/1507803002
/external/skia/src/pathops/SkOpCoincidence.cpp
1c9ce610501b7b864617356aeda12cd0caebe066 20-Nov-2015 caryclark <caryclark@google.com> fix pathops coincidence fuzz bug

Simplifying a series of rects with very large bounds
triggers a coincidence bug where, after one of the
intersection points that marks a coincident range
has been deleted, it is referenced.

Both the deletion and reference is (probably) happening
in the SkOpCoincidence::AddExpanded() phase of
HandleCoincidence(), and may signify a bug that could
happen with usable input data, but I haven't been
able to determine that.

For now, abort the Simplify() when the erroneous
condition is detected.

TBR=reed@google.com
BUG=558281

Review URL: https://codereview.chromium.org/1463923002
/external/skia/src/pathops/SkOpCoincidence.cpp
952ebfe2280043b16a316e9e27a41802f1c4cb7c 02-Nov-2015 caryclark <caryclark@google.com> path ops: fix fuzz-found divide by zero

TBR=reed@google.com
BUG=542391

Review URL: https://codereview.chromium.org/1427913005
/external/skia/src/pathops/SkOpCoincidence.cpp
ed0935a28a29af7d3b16ac8d9365f291a335c6bd 22-Oct-2015 caryclark <caryclark@google.com> Reland of path ops: fix conic weight and partial coincidence (patchset #1 id:1 of https://codereview.chromium.org/1408923003/ )

Reason for revert:
suppressions have landed in chrome

Original issue's description:
> Revert of path ops: fix conic weight and partial coincidence (patchset #5 id:80001 of https://codereview.chromium.org/1413763002/ )
>
> Reason for revert:
> path ops change breaks svg clipping layout tests -- conic is now more accurate, changing edge of circle in clip
>
> These need to be rebaselined
>
> svg/clip-path/clip-path-child-clipped.svg
> svg/clip-path/clip-path-nonzero.svg
> svg/clip-path/clip-path-evenodd-nonzero.svg
> svg/clip-path/clip-path-nonzero-evenodd.svg
>
> Original issue's description:
> > The remaining 1m skp bugs are asserts that can be harmlessly
> > suppressed and bugs around conics.
> >
> > The conic calculation for a subdivided w was just wrong.
> >
> > Also added debugging to template intersection to initialize
> > reused structures and dump additional data.
> >
> > TBR=reed@google.com
> >
> > Committed: https://skia.googlesource.com/skia/+/ef33b1e739b23a1201100ff17a572da85b03d9af
>
> TBR=
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/f428df1be3e96d3f8970d0f7f415b862f7da5404

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1407003016
/external/skia/src/pathops/SkOpCoincidence.cpp
f428df1be3e96d3f8970d0f7f415b862f7da5404 21-Oct-2015 caryclark <caryclark@google.com> Revert of path ops: fix conic weight and partial coincidence (patchset #5 id:80001 of https://codereview.chromium.org/1413763002/ )

Reason for revert:
path ops change breaks svg clipping layout tests -- conic is now more accurate, changing edge of circle in clip

These need to be rebaselined

svg/clip-path/clip-path-child-clipped.svg
svg/clip-path/clip-path-nonzero.svg
svg/clip-path/clip-path-evenodd-nonzero.svg
svg/clip-path/clip-path-nonzero-evenodd.svg

Original issue's description:
> The remaining 1m skp bugs are asserts that can be harmlessly
> suppressed and bugs around conics.
>
> The conic calculation for a subdivided w was just wrong.
>
> Also added debugging to template intersection to initialize
> reused structures and dump additional data.
>
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/ef33b1e739b23a1201100ff17a572da85b03d9af

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1408923003
/external/skia/src/pathops/SkOpCoincidence.cpp
ef33b1e739b23a1201100ff17a572da85b03d9af 20-Oct-2015 caryclark <caryclark@google.com> The remaining 1m skp bugs are asserts that can be harmlessly
suppressed and bugs around conics.

The conic calculation for a subdivided w was just wrong.

Also added debugging to template intersection to initialize
reused structures and dump additional data.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1413763002
/external/skia/src/pathops/SkOpCoincidence.cpp
26ad22ab61539e3d3b6bc5e0da8dcebbd52a53de 16-Oct-2015 caryclark <caryclark@google.com> Enabling clip stack flattening exercises path ops.
Iterating through the 903K skps that represent the
imagable 1M top web pages triggers a number of
bugs, some of which are addressed here.

Some web pages trigger intersecting cubic
representations of arc with their conic
counterparts. This exposed a flaw in coincident
detection that caused an infinite loop. The loop
alternatively extended the coincident section and,
determining the that the bounds of the curve pairs
did not overlap, deleted the extension.

Track the number of times the coincident detection
is called, and if it exceeds an empirically found
limit, assume that the curves are coincident and
force it to be so.

The loop count limit can be determined by enabling
DEBUG_T_SECT_LOOP_COUNT and running all tests. The
largest count is reported on completion.

Another class of bugs was caused by concident
detection duplicating nearly identical points that
had been merged earlier. To track these bugs, the
'handle coincidence' code was duplicated as a
const debug variety that reported if one of a
dozen or so irregularities are present; then it is
easier to see when a block of code that fixes one
irregularity regresses another.

Creating the debug const code version exposed some
non-debug code that could be const, and some that
was experimental and could be removed. Set
DEBUG_COINCIDENCE to track coincidence health and
handling.

For running on Chrome, DEBUG_VERIFY checks the
result of pathops against the same operation
using SkRegion to verify that the results are
nearly the same.

When visualizing the pathops work using
tools/pathops_visualizer.htm, set
DEBUG_DUMP_ALIGNMENT to see the curves after
they've been aligned for coincidence.

Other bugs fixed include detecting when a
section of a pair of curves have devolved into
lines and are coincident.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1394503003
/external/skia/src/pathops/SkOpCoincidence.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/SkOpCoincidence.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/SkOpCoincidence.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/SkOpCoincidence.cpp
182b499cd75c971f85cdf52c1827b3c220cc9011 14-May-2015 caryclark <caryclark@google.com> look for deleted pts when detecting line/curve coincident edges

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

Review URL: https://codereview.chromium.org/1129863007
/external/skia/src/pathops/SkOpCoincidence.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/SkOpCoincidence.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/SkOpCoincidence.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/SkOpCoincidence.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/SkOpCoincidence.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/SkOpCoincidence.cpp