diff options
author | Cary Clark <caryclark@google.com> | 2016-10-05 08:51:39 -0400 |
---|---|---|
committer | Cary Clark <caryclark@google.com> | 2016-10-05 12:54:39 +0000 |
commit | e47ae2998c1cf944db5743a416583dd0f042b6d9 (patch) | |
tree | dc6e9f060ffe9cfcc6035f8ab8fa9f10c043ac22 /src/pathops/SkPathOpsCommon.cpp | |
parent | 85a45d93ed6f299d09b17ae55c5d74242af4b11c (diff) |
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>
Diffstat (limited to 'src/pathops/SkPathOpsCommon.cpp')
-rw-r--r-- | src/pathops/SkPathOpsCommon.cpp | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/pathops/SkPathOpsCommon.cpp b/src/pathops/SkPathOpsCommon.cpp index 3f44d70737..3d6ba4dda5 100644 --- a/src/pathops/SkPathOpsCommon.cpp +++ b/src/pathops/SkPathOpsCommon.cpp @@ -259,7 +259,7 @@ bool HandleCoincidence(SkOpContourHead* contourList, SkOpCoincidence* coincidenc if (!coincidence->addEndMovedSpans(DEBUG_COIN_ONLY_PARAMS())) { return false; } - const int SAFETY_COUNT = 100; // FIXME: tune + const int SAFETY_COUNT = 3; int safetyHatch = SAFETY_COUNT; // look for coincidence present in A-B and A-C but missing in B-C do { @@ -276,8 +276,6 @@ bool HandleCoincidence(SkOpContourHead* contourList, SkOpCoincidence* coincidenc } move_nearby(contourList DEBUG_ITER_PARAMS(SAFETY_COUNT - safetyHatch - 1)); } while (true); - // FIXME: only call this if addMissing modified something when returning false - move_nearby(contourList DEBUG_COIN_PARAMS()); // check to see if, loosely, coincident ranges may be expanded if (coincidence->expand(DEBUG_COIN_ONLY_PARAMS())) { bool added; @@ -296,20 +294,15 @@ bool HandleCoincidence(SkOpContourHead* contourList, SkOpCoincidence* coincidenc if (!coincidence->addExpanded(DEBUG_PHASE_ONLY_PARAMS(kWalking))) { return false; } - coincidence->correctEnds(DEBUG_COIN_ONLY_PARAMS()); // mark spans of coincident segments as coincident - if (!coincidence->mark(DEBUG_COIN_ONLY_PARAMS())) { - return false; - } + coincidence->mark(DEBUG_COIN_ONLY_PARAMS()); // look for coincidence lines and curves undetected by intersection if (missing_coincidence(contourList DEBUG_COIN_PARAMS())) { (void) coincidence->expand(DEBUG_PHASE_ONLY_PARAMS(kIntersecting)); if (!coincidence->addExpanded(DEBUG_COIN_ONLY_PARAMS())) { return false; } - if (!coincidence->mark(DEBUG_PHASE_ONLY_PARAMS(kWalking))) { - return false; - } + coincidence->mark(DEBUG_PHASE_ONLY_PARAMS(kWalking)); } else { (void) coincidence->expand(DEBUG_COIN_ONLY_PARAMS()); } @@ -320,14 +313,10 @@ bool HandleCoincidence(SkOpContourHead* contourList, SkOpCoincidence* coincidenc do { SkOpCoincidence* pairs = overlaps.isEmpty() ? coincidence : &overlaps; // adjust the winding value to account for coincident edges - if (!pairs->apply(DEBUG_ITER_ONLY_PARAMS(SAFETY_COUNT - safetyHatch))) { - return false; - } + pairs->apply(DEBUG_ITER_ONLY_PARAMS(SAFETY_COUNT - safetyHatch)); // For each coincident pair that overlaps another, when the receivers (the 1st of the pair) // are different, construct a new pair to resolve their mutual span - if (!pairs->findOverlaps(&overlaps DEBUG_ITER_PARAMS(SAFETY_COUNT - safetyHatch))) { - return false; - } + pairs->findOverlaps(&overlaps DEBUG_ITER_PARAMS(SAFETY_COUNT - safetyHatch)); if (!--safetyHatch) { SkASSERT(globalState->debugSkipAssert()); return false; @@ -335,12 +324,6 @@ bool HandleCoincidence(SkOpContourHead* contourList, SkOpCoincidence* coincidenc } while (!overlaps.isEmpty()); calc_angles(contourList DEBUG_COIN_PARAMS()); sort_angles(contourList); - if (globalState->angleCoincidence()) { - (void) missing_coincidence(contourList DEBUG_COIN_PARAMS()); - if (!coincidence->apply(DEBUG_COIN_ONLY_PARAMS())) { - return false; - } - } #if DEBUG_COINCIDENCE_VERBOSE coincidence->debugShowCoincidence(); #endif |