aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-08-25 10:02:46 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-25 10:02:46 -0700
commit91298b47c547b2ab4697038c04685af957bd1416 (patch)
treee30ceb981717c4ad9ac2600b723d11bbab1cbeb5 /tests
parent6ec8b7cee7a8016ee8871faab58424ea7786c879 (diff)
Revert of fix zero-length tangent (patchset #2 id:20001 of https://codereview.chromium.org/1311273002/ )
Reason for revert: causes layout test to draw differently -- new drawing is more correct. Reverting until layout test ignore is landed. Original issue's description: > fix zero-length tangent > > If the end point and the control point are the same, computing > the tangent will result in (0, 0). In this case, use the prior > control point instead. > > R=reed@google.com > > BUG=skia:4191 > > Committed: https://skia.googlesource.com/skia/+/7544124fb8ee744f68f549a353f8a9163cd7432d TBR=reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4191 Review URL: https://codereview.chromium.org/1312243002
Diffstat (limited to 'tests')
-rw-r--r--tests/GeometryTest.cpp64
1 files changed, 0 insertions, 64 deletions
diff --git a/tests/GeometryTest.cpp b/tests/GeometryTest.cpp
index 5aa80d0b1f..00fc7797dc 100644
--- a/tests/GeometryTest.cpp
+++ b/tests/GeometryTest.cpp
@@ -105,67 +105,6 @@ static void test_conic(skiatest::Reporter* reporter) {
}
}
-static void test_quad_tangents(skiatest::Reporter* reporter) {
- SkPoint pts[] = {
- {10, 20}, {10, 20}, {20, 30},
- {10, 20}, {15, 25}, {20, 30},
- {10, 20}, {20, 30}, {20, 30},
- };
- int count = (int) SK_ARRAY_COUNT(pts) / 3;
- for (int index = 0; index < count; ++index) {
- SkConic conic(&pts[index * 3], 0.707f);
- SkVector start = SkEvalQuadTangentAt(&pts[index * 3], 0);
- SkVector mid = SkEvalQuadTangentAt(&pts[index * 3], .5f);
- SkVector end = SkEvalQuadTangentAt(&pts[index * 3], 1);
- REPORTER_ASSERT(reporter, start.fX && start.fY);
- REPORTER_ASSERT(reporter, mid.fX && mid.fY);
- REPORTER_ASSERT(reporter, end.fX && end.fY);
- REPORTER_ASSERT(reporter, SkScalarNearlyZero(start.cross(mid)));
- REPORTER_ASSERT(reporter, SkScalarNearlyZero(mid.cross(end)));
- }
-}
-
-static void test_conic_tangents(skiatest::Reporter* reporter) {
- SkPoint pts[] = {
- { 10, 20}, {10, 20}, {20, 30},
- { 10, 20}, {15, 25}, {20, 30},
- { 10, 20}, {20, 30}, {20, 30}
- };
- int count = (int) SK_ARRAY_COUNT(pts) / 3;
- for (int index = 0; index < count; ++index) {
- SkConic conic(&pts[index * 3], 0.707f);
- SkVector start = conic.evalTangentAt(0);
- SkVector mid = conic.evalTangentAt(.5f);
- SkVector end = conic.evalTangentAt(1);
- REPORTER_ASSERT(reporter, start.fX && start.fY);
- REPORTER_ASSERT(reporter, mid.fX && mid.fY);
- REPORTER_ASSERT(reporter, end.fX && end.fY);
- REPORTER_ASSERT(reporter, SkScalarNearlyZero(start.cross(mid)));
- REPORTER_ASSERT(reporter, SkScalarNearlyZero(mid.cross(end)));
- }
-}
-
-static void test_cubic_tangents(skiatest::Reporter* reporter) {
- SkPoint pts[] = {
- { 10, 20}, {10, 20}, {20, 30}, {30, 40},
- { 10, 20}, {15, 25}, {20, 30}, {30, 40},
- { 10, 20}, {20, 30}, {30, 40}, {30, 40},
- };
- int count = (int) SK_ARRAY_COUNT(pts) / 4;
- for (int index = 0; index < count; ++index) {
- SkConic conic(&pts[index * 3], 0.707f);
- SkVector start, mid, end;
- SkEvalCubicAt(&pts[index * 4], 0, NULL, &start, NULL);
- SkEvalCubicAt(&pts[index * 4], .5f, NULL, &mid, NULL);
- SkEvalCubicAt(&pts[index * 4], 1, NULL, &end, NULL);
- REPORTER_ASSERT(reporter, start.fX && start.fY);
- REPORTER_ASSERT(reporter, mid.fX && mid.fY);
- REPORTER_ASSERT(reporter, end.fX && end.fY);
- REPORTER_ASSERT(reporter, SkScalarNearlyZero(start.cross(mid)));
- REPORTER_ASSERT(reporter, SkScalarNearlyZero(mid.cross(end)));
- }
-}
-
DEF_TEST(Geometry, reporter) {
SkPoint pts[3], dst[5];
@@ -190,7 +129,4 @@ DEF_TEST(Geometry, reporter) {
testChopCubic(reporter);
test_evalquadat(reporter);
test_conic(reporter);
- test_cubic_tangents(reporter);
- test_quad_tangents(reporter);
- test_conic_tangents(reporter);
}