More conic-specific tests revealed a few conic-specific bugs. Because javascript...
authorcaryclark <caryclark@google.com>
Fri, 30 Oct 2015 19:03:06 +0000 (12:03 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 30 Oct 2015 19:03:06 +0000 (12:03 -0700)
commitef784fb7f58c9c021172045a8e0b396c81fdc425
tree2aa7203e7a6cf28737c89c7fb27d711da9223047
parent498d7ac86bfb45bdfc8f9aa7424f7236235987b5
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
17 files changed:
gyp/pathops_unittest.gypi
src/pathops/SkOpContour.cpp
src/pathops/SkOpContour.h
src/pathops/SkOpSegment.cpp
src/pathops/SkOpSegment.h
src/pathops/SkOpSpan.cpp
src/pathops/SkOpSpan.h
src/pathops/SkPathOpsConic.cpp
src/pathops/SkPathOpsOp.cpp
src/pathops/SkPathOpsSimplify.cpp
src/pathops/SkPathOpsTSect.h
tests/PathOpsBuilderConicTest.cpp [new file with mode: 0644]
tests/PathOpsConicIntersectionTest.cpp
tests/SubsetPath.cpp [new file with mode: 0644]
tests/SubsetPath.h [new file with mode: 0644]
tools/pathops_sorter.htm
tools/pathops_visualizer.htm