aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-07-07 18:09:32 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-07 18:09:32 -0700
commitfc95be17c3f294a86e7ba82790e38cd7ae7146eb (patch)
tree8d186a7e2dabc52bb9cd8459d307a39c0e821aa8
parentf7b54cda0d44cb1e7fd89586ff8ff3b78dfb823b (diff)
fix pathops battle test
The intermediate subtraction threw away bits causing the subsequent cross product to fail. Defer the bit truncation until after the vector is computed. TBR=reed@google.com Review URL: https://codereview.chromium.org/1226933003
-rw-r--r--src/pathops/SkOpAngle.cpp3
-rw-r--r--tests/PathOpsBattles.cpp2
-rw-r--r--tools/pathops_sorter.htm44
3 files changed, 5 insertions, 44 deletions
diff --git a/src/pathops/SkOpAngle.cpp b/src/pathops/SkOpAngle.cpp
index 6e49c4977f..36c0dd90f7 100644
--- a/src/pathops/SkOpAngle.cpp
+++ b/src/pathops/SkOpAngle.cpp
@@ -182,8 +182,7 @@ int SkOpAngle::allOnOneSide(const SkOpAngle* test) {
int lineStart = fStart->t() < fEnd->t() ? 0 : 1;
line = linePts[lineStart ^ 1] - linePts[lineStart];
} else {
- SkPoint shortPts[2] = { fCurvePart[0].asSkPoint(), fCurvePart[1].asSkPoint() };
- line = shortPts[1] - shortPts[0];
+ line = (fCurvePart[1] - fCurvePart[0]).asSkVector();
}
float crosses[3];
SkPath::Verb testVerb = test->segment()->verb();
diff --git a/tests/PathOpsBattles.cpp b/tests/PathOpsBattles.cpp
index 3cf1353891..2920a01557 100644
--- a/tests/PathOpsBattles.cpp
+++ b/tests/PathOpsBattles.cpp
@@ -5011,7 +5011,7 @@ path.lineTo(SkBits2Float(0x424b624a), SkBits2Float(0x42833479));
path.close();
SkPath path2(path);
- testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail);
+ testPathOp(reporter, path1, path2, (SkPathOp) 2, filename);
}
// op end success 1
diff --git a/tools/pathops_sorter.htm b/tools/pathops_sorter.htm
index 892dbea242..7d609e8373 100644
--- a/tools/pathops_sorter.htm
+++ b/tools/pathops_sorter.htm
@@ -7,47 +7,9 @@
<div style="height:0">
<div id="sect1">
-{{{ (fX = 27.2011719, fY = 66.6567383) (fX = 24.5820313, fY = 72.1083984)
-{{{ (fX = 24.5820313, fY = 72.1083984) (fX = 17.2832031, fY = 72.1083984)
-{{{ (fX = 17.2832031, fY = 72.1083984) (fX = 18.40625, fY = 68.6191406)
-{{{ (fX = 18.40625, fY = 68.6191406) (fX = 16.7207031, fY = 66.2197265)
-{{{ (fX = 16.7207031, fY = 66.2197265) (fX = 10.3574219, fY = 65.7841796)
-{{{ (fX = 10.3574219, fY = 65.7841796) (fX = 9.984375, fY = 59.2387695)
-{{{ (fX = 9.984375, fY = 59.2387695) (fX = 9.421875, fY = 54.6552734)
-{{{ (fX = 9.421875, fY = 54.6552734) (fX = 14.1015625, fY = 53.1269531)
-{{{ (fX = 14.1015625, fY = 53.1269531) (fX = 15.5976563, fY = 48.5419922)
-{{{ (fX = 15.5976563, fY = 48.5419922) (fX = 21.0253906, fY = 49.4160156)
-{{{ (fX = 21.0253906, fY = 49.4160156) (fX = 24.015625, fY = 49.6342773)
-{{{ (fX = 24.015625, fY = 49.6342773) (fX = 26.0761719, fY = 48.3237305)
-{{{ (fX = 26.0761719, fY = 48.3237305) (fX = 27.2011719, fY = 52.0356445)
-{{{ (fX = 27.2011719, fY = 52.0356445) (fX = 29.2558594, fY = 52.0356445)
-{{{ (fX = 29.2558594, fY = 52.0356445) (fX = 30.1914063, fY = 49.4160156)
-{{{ (fX = 30.1914063, fY = 49.4160156) (fX = 31.875, fY = 52.0356445)
-{{{ (fX = 31.875, fY = 52.0356445) (fX = 32.4394531, fY = 52.9086914)
-{{{ (fX = 32.4394531, fY = 52.9086914) (fX = 33.375, fY = 54.8735352)
-{{{ (fX = 33.375, fY = 54.8735352) (fX = 29.8203125, fY = 57.7109375)
-{{{ (fX = 29.8203125, fY = 57.7109375) (fX = 33.375, fY = 61.8569336)
-{{{ (fX = 33.375, fY = 61.8569336) (fX = 33.9355469, fY = 61.8569336)
-{{{ (fX = 33.9355469, fY = 61.8569336) (fX = 37.6777344, fY = 67.3110352)
-{{{ (fX = 37.6777344, fY = 67.3110352) (fX = 37.1152344, fY = 72.1083984)
-{{{ (fX = 37.1152344, fY = 72.1083984) (fX = 31.3164063, fY = 72.1083984)
-{{{ (fX = 31.3164063, fY = 72.1083984) (fX = 30.9414063, fY = 72.1083984)
-{{{ (fX = 30.9414063, fY = 72.1083984) (fX = 28.3222656, fY = 65.5654296)
-{{{ (fX = 28.3222656, fY = 65.5654296) (fX = 27.2011719, fY = 66.6567383)
-
-{{{ (fX = 25.5175781, fY = 62.9482421) (fX = 19.9023438, fY = 60.7661133)
-{{{ (fX = 19.9023438, fY = 60.7661133) (fX = 19.3417969, fY = 59.456543)
-{{{ (fX = 19.3417969, fY = 59.456543) (fX = 18.21875, fY = 61.8569336)
-{{{ (fX = 18.21875, fY = 61.8569336) (fX = 19.1523438, fY = 63.1665039)
-{{{ (fX = 19.1523438, fY = 63.1665039) (fX = 21.9609375, fY = 67.0932617)
-{{{ (fX = 21.9609375, fY = 67.0932617) (fX = 25.1425781, fY = 65.5654296)
-{{{ (fX = 25.1425781, fY = 65.5654296) (fX = 25.5175781, fY = 62.9482421)
-
-{{{ (fX = 29.8203125, fY = 94.3359375) (fX = 29.2558594, fY = 88.890625)
-{{{ (fX = 29.2558594, fY = 88.890625) (fX = 31.3164063, fY = 87.1479492)
-{{{ (fX = 31.3164063, fY = 87.1479492) (fX = 36.3671875, fY = 90.633789)
-{{{ (fX = 36.3671875, fY = 90.633789) (fX = 33.9355469, fY = 95.4248046)
-{{{ (fX = 33.9355469, fY = 95.4248046) (fX = 29.8203125, fY = 94.3359375)
+{{{36.756134033203125, 47.42348098754882812}, {40.32709884643554688, 44.65576934814453125}, {43.57402420043945312, 41.4935760498046875}, {46.43517684936523438, 37.99703216552734375}}},
+{{{36.756134033203125, 47.42348098754882812}, {36.75614144085933788, 47.42347524616091903}}},
+{{{36.756134033203125, 47.42348098754882812}, {50.84598541259765625, 65.6024932861328125}}},
</div>
</div>