skia2/gyp/pathops_unittest.gypi

82 lines
2.9 KiB
Plaintext
Raw Normal View History

# Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Common gypi for pathops unit tests.
{
'include_dirs': [
'../include/private',
'../src/core',
'../src/effects',
'../src/lazy',
'../src/pathops',
'../src/pipe/utils',
'../src/utils',
],
'dependencies': [
'flags.gyp:flags',
'skia_lib.gyp:skia_lib',
'tools.gyp:resources',
],
'sources': [
'../tests/Test.cpp',
'../tests/Test.h',
'../tests/PathOpsAngleTest.cpp',
'../tests/PathOpsBoundsTest.cpp',
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
2015-10-30 19:03:06 +00:00
'../tests/PathOpsBuilderConicTest.cpp',
'../tests/PathOpsBuilderTest.cpp',
'../tests/PathOpsBuildUseTest.cpp',
'../tests/PathOpsConicIntersectionTest.cpp',
'../tests/PathOpsConicLineIntersectionTest.cpp',
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
2015-10-16 16:03:38 +00:00
'../tests/PathOpsCubicConicIntersectionTest.cpp',
'../tests/PathOpsCubicIntersectionTest.cpp',
'../tests/PathOpsCubicIntersectionTestData.cpp',
'../tests/PathOpsCubicLineIntersectionTest.cpp',
'../tests/PathOpsCubicQuadIntersectionTest.cpp',
'../tests/PathOpsCubicReduceOrderTest.cpp',
'../tests/PathOpsDCubicTest.cpp',
'../tests/PathOpsDLineTest.cpp',
'../tests/PathOpsDPointTest.cpp',
'../tests/PathOpsDRectTest.cpp',
'../tests/PathOpsDVectorTest.cpp',
'../tests/PathOpsExtendedTest.cpp',
'../tests/PathOpsFuzz763Test.cpp',
'../tests/PathOpsInverseTest.cpp',
'../tests/PathOpsIssue3651.cpp',
'../tests/PathOpsLineIntersectionTest.cpp',
'../tests/PathOpsLineParametetersTest.cpp',
'../tests/PathOpsOpCircleThreadedTest.cpp',
'../tests/PathOpsOpCubicThreadedTest.cpp',
'../tests/PathOpsOpRectThreadedTest.cpp',
'../tests/PathOpsOpTest.cpp',
'../tests/PathOpsQuadIntersectionTest.cpp',
'../tests/PathOpsQuadIntersectionTestData.cpp',
'../tests/PathOpsQuadLineIntersectionTest.cpp',
'../tests/PathOpsQuadLineIntersectionThreadedTest.cpp',
'../tests/PathOpsQuadReduceOrderTest.cpp',
'../tests/PathOpsSimplifyDegenerateThreadedTest.cpp',
'../tests/PathOpsSimplifyFailTest.cpp',
'../tests/PathOpsSimplifyQuadralateralsThreadedTest.cpp',
'../tests/PathOpsSimplifyQuadThreadedTest.cpp',
'../tests/PathOpsSimplifyRectThreadedTest.cpp',
'../tests/PathOpsSimplifyTest.cpp',
'../tests/PathOpsSimplifyTrianglesThreadedTest.cpp',
'../tests/PathOpsSkpTest.cpp',
'../tests/PathOpsTestCommon.cpp',
'../tests/PathOpsThreadedCommon.cpp',
'../tests/PathOpsThreeWayTest.cpp',
'../tests/PathOpsTightBoundsTest.cpp',
'../tests/PathOpsTypesTest.cpp',
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
2015-10-30 19:03:06 +00:00
'../tests/SubsetPath.cpp',
'../tests/PathOpsCubicIntersectionTestData.h',
'../tests/PathOpsExtendedTest.h',
'../tests/PathOpsQuadIntersectionTestData.h',
'../tests/PathOpsTestCommon.h',
'../tests/PathOpsThreadedCommon.h',
'../tests/PathOpsTSectDebug.h',
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
2015-10-30 19:03:06 +00:00
'../tests/SubsetPath.h',
],
}