History log of /external/skia/src/pathops/SkOpBuilder.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c3cc5fa6de0a8237d9241dbf3e6c0786a9040069 07-Mar-2017 Herb Derby <herb@google.com> Move from SkChunkAlloc to SkArenaAlloc for PathOps

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>
/external/skia/src/pathops/SkOpBuilder.cpp
c0a4c4f969464ec9854d726836a430262351d63d 07-Mar-2017 Derek Sollenberger <djsollen@google.com> Revert "Move from SkChunkAlloc to SkArenaAlloc for PathOps"

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>
/external/skia/src/pathops/SkOpBuilder.cpp
38c60180241e335e368fdadbf7856aff114ff668 01-Mar-2017 Herb Derby <herb@google.com> 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>
/external/skia/src/pathops/SkOpBuilder.cpp
fa9193dcbe813e32376acb2411bfbb2420d03c28 21-Dec-2016 Cary Clark <caryclark@google.com> one more empty contour

Add one more empty contour check.

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

Change-Id: Ie971875d37388f6bd86a0bdaeaf9230d64aca38d
Reviewed-on: https://skia-review.googlesource.com/6356
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
/external/skia/src/pathops/SkOpBuilder.cpp
51c5678f258736736c4a5d48d4e82c73be225428 07-Nov-2016 caryclark <caryclark@google.com> use reversePathTo in place of addPathReverse

Path ops was using addPathReverse, instead of reversePathTo.
The former adds a moveTo always, and the latter requires
that the caller add the moveTo if needed.

Simplify the reversePathTo implementation.

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

Committed: https://skia.googlesource.com/skia/+/d8db392be9dd1887df04b10b5670991d6b098c17
Review-Url: https://codereview.chromium.org/2481463002
/external/skia/src/pathops/SkOpBuilder.cpp
2fd58a29d305accdefdcd7c7dbf1b902cd758a84 04-Nov-2016 caryclark <caryclark@google.com> Revert of use reversePathTo in place of addPathReverse (patchset #1 id:1 of https://codereview.chromium.org/2481463002/ )

Reason for revert:
breqking some bots

Original issue's description:
> use reversePathTo in place of addPathReverse
>
> Path ops was using addPathReverse, instead of reversePathTo.
> The former adds a moveTo always, and the latter requires
> that the caller add the moveTo if needed.
>
> Simplify the reversePathTo implementation.
>
> R=reed@google.com
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2481463002
>
> Committed: https://skia.googlesource.com/skia/+/d8db392be9dd1887df04b10b5670991d6b098c17

TBR=reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2478763003
/external/skia/src/pathops/SkOpBuilder.cpp
d8db392be9dd1887df04b10b5670991d6b098c17 04-Nov-2016 caryclark <caryclark@google.com> use reversePathTo in place of addPathReverse

Path ops was using addPathReverse, instead of reversePathTo.
The former adds a moveTo always, and the latter requires
that the caller add the moveTo if needed.

Simplify the reversePathTo implementation.

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

Review-Url: https://codereview.chromium.org/2481463002
/external/skia/src/pathops/SkOpBuilder.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/SkOpBuilder.cpp
e3a4e993ef79788d5ee807b10ff588e9c46bac6d 28-Sep-2016 caryclark <caryclark@google.com> fix cubic linear test

Check to see if the line between end points is
degenerate before measuring control points.

Also, add test case for a bug to see if it
shows up on any platform.

TBR=reed@google.com
BUG=skia:5169, skia:5240
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2375053002

Review-Url: https://codereview.chromium.org/2375053002
/external/skia/src/pathops/SkOpBuilder.cpp
eed356d281adbf93ecbd89cb23913a7861cd8578 14-Sep-2016 caryclark <caryclark@google.com> Rewriting path writer

The path writer takes constructs the output path out of
curves that satisfy the pathop operation.

Curves contain lists of t/point pairs that may not be
comparable to each other. To match up curve ends in the
output path, look for adjacent curves to have a shared
membership rather than comparing point values.

Use path utilities to connect partial curve lists into
closed contours.

Share the angle code that determines if a curve has become
a degenerate line with the path writer.

Clean up some code on the way, and delete some unused
functions.

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

Review-Url: https://codereview.chromium.org/2321973005
/external/skia/src/pathops/SkOpBuilder.cpp
7b33bf1d2a8664235a9eb372024641d2da1a0dad 21-Jul-2016 caryclark <caryclark@google.com> fix builder fuzz

Fix ASAN_heap-use-after-free crash

R=kjlubick
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2168963002

Review-Url: https://codereview.chromium.org/2168963002
/external/skia/src/pathops/SkOpBuilder.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/SkOpBuilder.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/SkOpBuilder.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/SkOpBuilder.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/SkOpBuilder.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/SkOpBuilder.cpp
d83f4955a58cbb9dd523c89ad50e2374a549075e 17-Jun-2015 caryclark <caryclark@google.com> initialize firstDir

Good catch by Florin; the variable was indeed uninitialized in
the complex followed by concave case.

R=fmalita@google.com
BUG=skia:3953

Review URL: https://codereview.chromium.org/1187273005
/external/skia/src/pathops/SkOpBuilder.cpp
026beb52a29a620290fcfb24f1e7e9e75547b80f 10-Jun-2015 reed <reed@google.com> SkPath::Direction serves two masters:
- input param to addFoo (e.g. addRect), where only CW or CCW are valid)
- output param from computing functions, that sometimes return kUnknown

This CL's intent is to split these into distinct enums/features:
- Direction (public) loses kUnknown, and is only used for input
- FirstDirection (private) is used for computing the first direction we see when analyzing a contour

BUG=skia:

Review URL: https://codereview.chromium.org/1176953002
/external/skia/src/pathops/SkOpBuilder.cpp
4e1a4c9399b8bb0897218f3ec10c254d3bb97463 18-May-2015 caryclark <caryclark@google.com> fix builder winding again

Record the nesting level when finding the edge winding contribution
so that inner edges can be reversed as needed.

R=fmalita@chromium.org
BUG=skia:3838

Review URL: https://codereview.chromium.org/1140383002
/external/skia/src/pathops/SkOpBuilder.cpp
5b5ddd73b4baf22752924bf20d097e96236c36f8 18-May-2015 caryclark <caryclark@google.com> The path ops builder code needs to determine the winding of each contour added, and reverse windings if the contours are nested in other contours.

Cheap (one contour) paths can be evaluated and reversed as needed with a minimum of checking, but multi-contour paths invoke the regular path ops machinery to determine who is contained by whom.

More tests need to be added to verify that all corner cases are considered, but this fixes the cases in the bug thus far.

R=fmalita@chromium.org
TBR=reed@google.com
BUG=skia:3838

Review URL: https://codereview.chromium.org/1129193006
/external/skia/src/pathops/SkOpBuilder.cpp
fba9da78acf8853f0074d0518411bafc827f3771 14-May-2015 caryclark <caryclark@google.com> fix path op builder

The rewrite of path ops caused the inner contour direction to be reversed.
This exposed an existing bug in path ops builder, namely that the implicit
winding of the internal sum path could hide inner contours if they ended
up in the wrong direction.

Setting the sum path's fill type to even-odd ensures that the inner
contours aren't discarded.

R=fmalita@chromium.org
BUG=skia:3838

Review URL: https://codereview.chromium.org/1126193004
/external/skia/src/pathops/SkOpBuilder.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/SkOpBuilder.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/SkOpBuilder.cpp
45fa447460f70ec21d22cf4e1531490acfd3c578 16-Jan-2015 caryclark <caryclark@google.com> new files for pathops geometric intersection

There's no gyp references to these new files,
so this should only have the effect of reducing
the size of the commit that turns this code on.

TBR=

Review URL: https://codereview.chromium.org/853223002
/external/skia/src/pathops/SkOpBuilder.cpp