aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops
Commit message (Collapse)AuthorAge
* ccpr: Normalize the cubic inflection function instead of its rootsGravatar Chris Dalton2018-04-16
| | | | | | | | | | | | When solving for KLM, switches back to normalizing the cubic's inflection function rather than both individual roots. Also performs some general code clean up for SkClassifyCubic. Bug: skia: Change-Id: Id513e7e02c50a8709f3eccf92fad9e5134d73d83 Reviewed-on: https://skia-review.googlesource.com/121201 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* fix pathop fuzzesGravatar Cary Clark2018-04-03
| | | | | | | | | | | | | | | | | throw an error instead of asserting for one for the other, only assert if the values are trusted. That's not ideal, but I don't see an easy way to insert a fail safety hatch in this code and if the assert is ignored, no further assert is triggered. verified that extended tests run without problem on debug and release R=kjlubick@google.com Bug: skia: Change-Id: I5544b6cbef97479854dbecb05baae6b2c41cabc9 Reviewed-on: https://skia-review.googlesource.com/117725 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* fix pathop fuzzerGravatar Cary Clark2018-03-20
| | | | | | | | | | | turn assert into fail R=kjlubick@google.com Bug: skia: Change-Id: I1124573959c90c7dae1a8cd54199dae429b8ca73 Reviewed-on: https://skia-review.googlesource.com/115481 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* 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>
* fix pathops fuzzers and debuggingGravatar Cary Clark2018-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | En route to fixing fuzzer bugs, I discovered that most debugging in pathops was broken. Pathops has extensive runtime functions that trace links and connections between data structures that are invaluable to debugging. The only practical way to use these functions is to call them from the debugger in immediate mode. Some time, some where, the MSVS Immediate Window ceased to be able to call functions that are members of structs or classes, and functions that take templated parameters. I can find no mention of this on the web, so I assume that something about our setup is triggering this, but I've had no luck finding the culprit. In the meantime, I've added global functions wrapped in a namespace to sneak calls to these functions without MSVS being any the wiser. While this works, it is likely to bitrot by tomorrow or next Tuesday so I will continue to try to find and fix the root cause. This also fixes the fuzzer bugs; generally one-line edits that change asserts to fails. All pathops tests succeed with this. To run all tests, do: ./out/debug/pathops_unittest -V -x ./out/release/pathops_unittest -V -x TBR=caryclark@google.com Bug: skia: Change-Id: I956ae3d8df6d25e155e62bd6dede64519c7fbdb1 Reviewed-on: https://skia-review.googlesource.com/114321 Reviewed-by: Kevin Lubick <kjlubick@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* avoid divide by zeroGravatar Cary Clark2018-03-13
| | | | | | | | | | R=kjlubick@google.com Bug: skia:7623 Change-Id: Ia9fb31201a39a4540d94f97e8d2f06eb290ab6e5 Reviewed-on: https://skia-review.googlesource.com/114082 Commit-Queue: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* fix a couple pathops fuzzersGravatar Cary Clark2018-03-13
| | | | | | | | | | | | | | This fixes these: src/pathops/SkOpCoincidence.cpp -- 1 crash-causing fuzzes src/pathops/SkOpSpan.h -- 1 crash-causing fuzzes R=kjlubick@google.com Bug: skia: Change-Id: I2b0dbd74757a32e522901753e2e17114a1a9f79b Reviewed-on: https://skia-review.googlesource.com/113751 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* some fuzzer fixesGravatar Cary Clark2018-03-09
| | | | | | | | | | | | should fix three or four of the PathOp asserts triggered by the fuzzer tool. R=kjlubick@google.com Bug: skia: Change-Id: I470895addf1e922da6a7c41d44d54eca92e68fb6 Reviewed-on: https://skia-review.googlesource.com/113163 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* avoid divide in pathopsquadGravatar Cary Clark2018-02-27
| | | | | | | | Bug: skia: Change-Id: I535b1833712e87bb562e2cbef450a4f6e16ec2c5 Reviewed-on: https://skia-review.googlesource.com/110441 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Cary Clark <caryclark@skia.org>
* handle degenerate cubic loopsGravatar Cary Clark2018-02-02
| | | | | | | | | | | | | | | | | | | fuzzer generated a cubic with a very tiny loop at one end. Breaking the cubic in two generated a piece so small it was discarded, passing the original along. Instead, use the loop detection as a hint that passing the original may fail further along. Keep the big piece, which is more linear than the original; and change its end to match the original input if the small piece isn't worth keeping. R=kjlubick Bug: skia:7480 Change-Id: If4c5cd46dbf7e16526269f2854e4f2278f427461 Reviewed-on: https://skia-review.googlesource.com/103100 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* bug fixes from PVS Studio (static analysis)Gravatar Mike Klein2018-01-26
| | | | | | | | | | | | | | | - Hal, please check out SkPDFCanon... was this unused? - Cary, please SkOpContour... is it right that allDone isn't necessary? - Brian, the rest? Bug: chromium:805881 Change-Id: I7cbbcf44f4460a114f4ed2a59ed3856203049cdc Reviewed-on: https://skia-review.googlesource.com/99960 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Hal Canary <halcanary@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* fix external link in commentGravatar Cary Clark2018-01-09
| | | | | | | | | | | | update link to one that is accessible by all TBR=iclelland@google.com NOTRY=true Change-Id: Ib8fb6d05779d863641d323311435dbbb5807eeee Reviewed-on: https://skia-review.googlesource.com/92685 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org>
* Enable conditional-uninitialized flagGravatar Kevin Lubick2018-01-05
| | | | | | | | | Bug: skia:7462 Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD Change-Id: I1c0a09984bf28a5c620a89af56040f018bae6310 Reviewed-on: https://skia-review.googlesource.com/90941 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* move divide by zero inside guardGravatar Cary Clark2017-12-13
| | | | | | | | | | | | speculative fix to see if this helps developer. It's the right thing to do in any case. TBR=reed@google.com Change-Id: I4fa576a096a6188f290957a7f2fabe73668f142d Reviewed-on: https://skia-review.googlesource.com/84521 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* fix float-cast-overflow in pathopsGravatar Cary Clark2017-12-13
| | | | | | | | | | | | | | | | | these tests can be taken off the blacklist: clippedcubic2 PathOpsCubicIntersection PathOpsCubicLineIntersection PathOpsOpCubicsThreaded PathOpsOpLoopsThreaded R=benjaminwagner@google.com Bug: skia:7052 Change-Id: I25b422e78ea1d19531613fea0a3fece7f4096e16 Reviewed-on: https://skia-review.googlesource.com/80863 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* fix pathops handling of tiny wrapback quads and cubicsGravatar Cary Clark2017-12-01
| | | | | | | | | | | | | If a quad or cubic reverses on itself, path ops breaks it in two. It determines the type of curve remaining, but needs to replace near-zero with zero first. TBR=reed@google.com Bug:790731 Change-Id: I3a1afa14fff064ca874b5abc768ec1ec5c2cf22f Reviewed-on: https://skia-review.googlesource.com/79400 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Cary Clark <caryclark@skia.org>
* move parts of SkPoint to SkPointPrivGravatar Cary Clark2017-11-08
| | | | | | | | | | | | Move specialized SkPoint methods to SkPointPriv. Use constexpr and inline initialization where possible. R=reed@google.com,bsalomon@google.com Bug: skia: 6898 Change-Id: I01ec5186f010f2dc80c068c70d9cc352f3221338 Reviewed-on: https://skia-review.googlesource.com/68700 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ravi Mistry <rmistry@google.com>
* add fuzzer timeout escapeGravatar Cary Clark2017-10-18
| | | | | | | | | | | | | | | | | SkOpSegment::moveNearby may loop for a long time, maybe forever. The longest loop isolated is 500 in a fuzzer generated test, and 50 in a real world test. Add an escape hatch to abandon the op after 9999 loops. While this puts a limit on the complexity path ops can handle, realistically paths this complex fail otherwise. TBR:hcm@google.com Bug: 764699 Change-Id: Iad62b9d505b94b2c2845ad2874342ac90478642e Reviewed-on: https://skia-review.googlesource.com/61200 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* fix typoGravatar Cary Clark2017-10-17
| | | | | | | | | | | | | developer reported a harmless, but misleading typo in pathops. Verified that correcting it is also harmless TBR:reed@google.com Bug: skia:7172 Change-Id: I3aff926752ef6c5d95a78f4e6cf57c9b42789f64 Reviewed-on: https://skia-review.googlesource.com/60561 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* Small pathops cleanup.Gravatar Ben Wagner2017-10-09
| | | | | | | | | | | | | | | | | | Newer clang compiler produces the diagnostic ../../tests/PathOpsDebug.cpp:1349:44: error: comparison of unsigned enum expression >= 0 is always true [-Werror,-Wtautological-unsigned-enum-zero-compare] if (!firstOp && c->operand() && op >= 0) { The check seems to be defending against bad values of SkPathOp, but this now seems unnecessary. This also adds 'rdiff' to kPathOpStr for future debugging. Change-Id: I08e5ba77c56e519ce4d9ae89491f7ccd5eb7f944 Reviewed-on: https://skia-review.googlesource.com/57104 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Remove trailing whitespace.Gravatar Ben Wagner2017-10-09
| | | | | | | | | | | Also adds a presubmit to prevent adding trailing whitespace to source code in the future. Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6 Reviewed-on: https://skia-review.googlesource.com/57380 Reviewed-by: Ravi Mistry <rmistry@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Remove carriage returns.Gravatar Ben Wagner2017-10-09
| | | | | | | | | Also add a presubmit so they don't get added to source code. Change-Id: I6a85c6a934b1068a63646a0dcc0d3a08baa96ced Reviewed-on: https://skia-review.googlesource.com/57110 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Fix float-cast-overflow in SkOpSpan::sortableTop.Gravatar Ben Wagner2017-09-19
| | | | | | | | Bug: skia:4632 Change-Id: I5af8bb7b04673307cdf7865bb7d56a041ba27d83 Reviewed-on: https://skia-review.googlesource.com/47320 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
* possible fix for pathops timeoutGravatar Cary Clark2017-09-06
| | | | | | | | | | | | | | | | | | | | fuzzer causes pathops to loop somewhere finding complex intersections, but does not have a reproducible test case. Somewhat grasping at straws, the failing condition in this CL was triggered by the fuzzer tests, but may or may not be related to the hang. TBR=reed@google.com Bug: 754434 Change-Id: Ia8edc0709cec559b277ed83a5ad6feb67d8088c6 Reviewed-on: https://skia-review.googlesource.com/42780 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* Move all Linux GCE bots to DebianGravatar Eric Boren2017-06-28
| | | | | | | | | NOTREECHECKS:true Bug: skia: Change-Id: I612989c6ce2f309d2f70f896500f73e4baa971a7 Reviewed-on: https://skia-review.googlesource.com/19811 Commit-Queue: Eric Boren <borenet@google.com> Reviewed-by: Eric Boren <borenet@google.com>
* Convert SkClassifyCubic to double precisionGravatar Chris Dalton2017-06-12
| | | | | | | | | | | | | Even though it's in homogeneous coordinates, we still get unfortunate artifacts if this math is not done in double precision. Prioritizing correctness for now; we can revisit in the future as the need for performance dictates. Bug: skia: Change-Id: If416ef6b70291f1454fcb9f7630d1108644ac2a5 Reviewed-on: https://skia-review.googlesource.com/19501 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Improve cubic KLM accuracyGravatar Chris Dalton2017-06-09
| | | | | | | | | | | | | | | | | | | | | | Moves cubic root finding logic out of GrPathUtils and PathOpsCubicIntersectionTest, and unifies it in SkGeometry. "Normalizes" the homogeneous parameter values of the roots, rather than the cubic inflection function. Does this normalization by twiddling the exponents instead of division (which causes a loss of precision). Abandons the built-in derivatives in GrCubicEffect. These don't have high enough precision on many mobile gpus. Instead we pass the KLM matrix to the vertex shader via uniform, where we can use it to set up new linear functionals from which the fragment shader can calculate the gradient of the implicit function. Bug: skia:4410 Change-Id: Ibd64e999520adc8cdef7803a492d3699995aef5a Reviewed-on: https://skia-review.googlesource.com/19017 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Use more stable root finding methods for cubicsGravatar Christopher Dalton2017-06-06
| | | | | | | | | | | | | | Applies the quadratic formula from "Numerical Recipes in C", Section 5.6, to the homogeneous quadratic equations that find cubic inflection points and loop intersections. Also addresses KLM orientation ahead of time, rather than negating K and L after the fact. Bug: skia: Change-Id: Ic7e0818e2fe49b7724f9b583bae52281cfb1aea1 Reviewed-on: https://skia-review.googlesource.com/13481 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* SkSTArenaAllocGravatar Florin Malita2017-05-24
| | | | | | | | | Syntactic sugar, gets rid of some boilerplate. Change-Id: Ibdb28b7a8f1d5e4a4e18c12d423b987d7194e340 Reviewed-on: https://skia-review.googlesource.com/17837 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Remove SkOpTAllocatorGravatar Herb Derby2017-04-19
| | | | | | | | | | 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>
* keep integral rectangle intersections integralGravatar Cary Clark2017-04-18
| | | | | | | | | | | | | | | | | | | | | | A pair of coincident lines can generate multiple intersection points. Path ops is more stable when the intersection T value is used to recompute the intersection point, but this has the side-effect of making integral edges intersect at non-integral values. While it's worthwhile to fix this, for the moment it is less disruptive to only worry about keeping intersection values integral if the original intersection point is integral in both axes. Also, fix some debugging code that bit-rotted. R=msarett@google.com Change-Id: Iefd27b25d1d21c22b224c174bd59bc6c105033c4 Reviewed-on: https://skia-review.googlesource.com/13721 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* Improve accuracy of cubic classificationGravatar Chris Dalton2017-04-14
| | | | | | | | | | | | | | | | | | - Updates the logic to reflect the Loop-Blinn paper instead of the GPU gems website. - Removes the threshold for detecting local cusps. The serpentine codepath works for these cusps anyway, so what we really want to know is whether the discriminant is negative. - Makes sure to not scale the inflection function by 1/0. - Shifts the inflection function coefficients in d[] so they match the paper. - Stores the cubic discriminant in d[0]. Bug: skia: Change-Id: I909a522a0fd27c9c8dfbc27d968bc43eeb7a416f Reviewed-on: https://skia-review.googlesource.com/13304 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* fix fuzzGravatar Cary Clark2017-03-21
| | | | | | | | | | | | | | | | corrupted intersection point lists can loop forever. Add a safety hatch to abort after a large number of iterations. TBR=kjlubick@google.com BUG=700679 Change-Id: Ifd4b180b47ba3bbde38ade0bb13b16b8d645c1cb Reviewed-on: https://skia-review.googlesource.com/9967 Reviewed-by: Cary Clark <caryclark@skia.org> Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* limit addEndMoveSpans loop in pathopsGravatar Cary Clark2017-03-09
| | | | | | | | | | | | | | 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>
* Move from SkChunkAlloc to SkArenaAlloc for PathOpsGravatar Herb Derby2017-03-07
| | | | | | | | | 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>
* Revert "Move from SkChunkAlloc to SkArenaAlloc for PathOps"Gravatar Derek Sollenberger2017-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Move from SkChunkAlloc to SkArenaAlloc for PathOpsGravatar Herb Derby2017-03-06
| | | | | | | 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>
* fix fuzzerGravatar Cary Clark2017-03-01
| | | | | | | | | | | | turn asserts into error returns to fix fuzz R=kjlubick@google.com BUG=skia:6162 Change-Id: I7508eb5cb41425dcfc2718aaa9cc1ee8aa00acc9 Reviewed-on: https://skia-review.googlesource.com/9118 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* Revert "offset angle check edge in common"Gravatar Cary Clark2017-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d2eb581ebc8f8009e80cccccd74d5b341ef5bd5b. Reason for revert: broke Google3 MSAN run of dm Original change's description: > offset angle check edge in common > > When curves cross, their intersection points may be nearby, but not exactly the same. > Sort the angles formed by the crossing curves when all angles don't have the same > origin. > > This sets up the framework to solve test case that currently fail (e.g., joel6) but > does not fix all related test cases (e.g., joel9). > > All older existing test cases, including extended tests, pass. > > Rework the test framework to better report when tests expected to produce failing > results now pass. > > Add new point and vector operations to support offset angles. > > TBR=reed@google.com > BUG=skia:6041 > > Change-Id: I67c651ded0a25e99ad93d55d6a35109b3ee3698e > Reviewed-on: https://skia-review.googlesource.com/6624 > Commit-Queue: Cary Clark <caryclark@google.com> > Reviewed-by: Cary Clark <caryclark@google.com> > TBR=caryclark@google.com,reviews@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. BUG=skia:6041 Change-Id: I43db0808522ac44aceeb4f70e296167ea84a3663 Reviewed-on: https://skia-review.googlesource.com/7373 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* offset angle check edge in commonGravatar Cary Clark2017-01-20
| | | | | | | | | | | | | | | | | | | | | | | | When curves cross, their intersection points may be nearby, but not exactly the same. Sort the angles formed by the crossing curves when all angles don't have the same origin. This sets up the framework to solve test case that currently fail (e.g., joel6) but does not fix all related test cases (e.g., joel9). All older existing test cases, including extended tests, pass. Rework the test framework to better report when tests expected to produce failing results now pass. Add new point and vector operations to support offset angles. TBR=reed@google.com BUG=skia:6041 Change-Id: I67c651ded0a25e99ad93d55d6a35109b3ee3698e Reviewed-on: https://skia-review.googlesource.com/6624 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* fix fuzz asserts triggered by old fuzzesGravatar Cary Clark2017-01-20
| | | | | | | | | | | | | | 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>
* Scale the result of TightBounds when path was inverse-scaledGravatar Fredrik Söderquist2017-01-04
| | | | | | | | | | | | | When the path was "large" (as defined by ScaleFactor(...)), the computed bounds would not be adjusted to the correct space. Make sure to scale the result in those cases. BUG=chromium:678162 Change-Id: Ia2eb94050c4620286e9abb69976dbc0202ecc307 Reviewed-on: https://skia-review.googlesource.com/6501 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* fix fuzzGravatar Cary Clark2017-01-04
| | | | | | | | | | R=kjlubick@google.com BUG=skia:6084 Change-Id: I5978805c8d9048e399d83a13173c6a776cabe8ac Reviewed-on: https://skia-review.googlesource.com/6544 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* fix fuzzerGravatar Cary Clark2017-01-03
| | | | | | | | | | | | 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>
* one more empty contourGravatar Cary Clark2016-12-21
| | | | | | | | | | | | 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>
* check for empty contours in sortable topGravatar Cary Clark2016-12-20
| | | | | | | | | | TBR=reed@google.com BUG=675132 Change-Id: I022ce0c59574b450e47e22a3dac0929034439b1b Reviewed-on: https://skia-review.googlesource.com/6334 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* handle empty contours in a couple more placesGravatar Cary Clark2016-12-19
| | | | | | | | | | R=kjlubick@google.com BUG=skia:6061 Change-Id: I5b465f1495f80a5ac44253cadf4afd7f509fa75b Reviewed-on: https://skia-review.googlesource.com/6268 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* rework xor to be more like windingGravatar Cary Clark2016-12-16
| | | | | | | | | | | | | | | | 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>
* fix fuzzing empty contours squirrelly cubicsGravatar Cary Clark2016-12-16
| | | | | | | | | | | | | | | | | | | The fuzzer triggered relatively new code that missized the split cubic array, i.e., if a cubic is split in three places it makes four cubics. The fuzzer triggered other relative new code that permits a contour to be empty. This happens when a line crosses over itself but doesn't enclose anything. R=kjlubick@google.com BUG=skia:6061 Change-Id: I0c04d0d390ff1092f7b3bb28ebbfca517451f497 Reviewed-on: https://skia-review.googlesource.com/6223 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* speculative pointer to member fixGravatar Cary Clark2016-12-15
| | | | | | | | | | | | | | | | 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>