Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: tests/GeometryTest.cpp

Issue 1312243002: Revert of fix zero-length tangent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkGeometry.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GeometryTest.cpp
diff --git a/tests/GeometryTest.cpp b/tests/GeometryTest.cpp
index 5aa80d0b1fb732d77506e28a625d3e827865de88..00fc7797dc08d8b0ae0ff9f925ba4c88221ff32e 100644
--- a/tests/GeometryTest.cpp
+++ b/tests/GeometryTest.cpp
@@ -105,67 +105,6 @@
}
}
-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 @@
testChopCubic(reporter);
test_evalquadat(reporter);
test_conic(reporter);
- test_cubic_tangents(reporter);
- test_quad_tangents(reporter);
- test_conic_tangents(reporter);
}
« no previous file with comments | « src/core/SkGeometry.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698