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

Unified Diff: src/utils/SkInterpolator.cpp

Issue 351713005: Promote SkInterpolator unit test to our tests driver. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: review Created 6 years, 6 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 | « include/utils/SkInterpolator.h ('k') | tests/InterpolatorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkInterpolator.cpp
diff --git a/src/utils/SkInterpolator.cpp b/src/utils/SkInterpolator.cpp
index dd884b881cc42121a8ac535fe3418917a87957dd..97574e475b4ed791702cd688cd7e35672a5b06e2 100644
--- a/src/utils/SkInterpolator.cpp
+++ b/src/utils/SkInterpolator.cpp
@@ -269,59 +269,3 @@ SkScalar SkUnitCubicInterp(SkScalar value, SkScalar bx, SkScalar by,
C = 3*(b - c) + Dot14_ONE;
return SkFixedToScalar(eval_cubic(t, A, B, C) << 2);
}
-
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-#ifdef SK_DEBUG
-
-#ifdef SK_SUPPORT_UNITTEST
- static SkScalar* iset(SkScalar array[3], int a, int b, int c) {
- array[0] = SkIntToScalar(a);
- array[1] = SkIntToScalar(b);
- array[2] = SkIntToScalar(c);
- return array;
- }
-#endif
-
-void SkInterpolator::UnitTest() {
-#ifdef SK_SUPPORT_UNITTEST
- SkInterpolator inter(3, 2);
- SkScalar v1[3], v2[3], v[3], vv[3];
- Result result;
-
- inter.setKeyFrame(0, 100, iset(v1, 10, 20, 30), 0);
- inter.setKeyFrame(1, 200, iset(v2, 110, 220, 330));
-
- result = inter.timeToValues(0, v);
- SkASSERT(result == kFreezeStart_Result);
- SkASSERT(memcmp(v, v1, sizeof(v)) == 0);
-
- result = inter.timeToValues(99, v);
- SkASSERT(result == kFreezeStart_Result);
- SkASSERT(memcmp(v, v1, sizeof(v)) == 0);
-
- result = inter.timeToValues(100, v);
- SkASSERT(result == kNormal_Result);
- SkASSERT(memcmp(v, v1, sizeof(v)) == 0);
-
- result = inter.timeToValues(200, v);
- SkASSERT(result == kNormal_Result);
- SkASSERT(memcmp(v, v2, sizeof(v)) == 0);
-
- result = inter.timeToValues(201, v);
- SkASSERT(result == kFreezeEnd_Result);
- SkASSERT(memcmp(v, v2, sizeof(v)) == 0);
-
- result = inter.timeToValues(150, v);
- SkASSERT(result == kNormal_Result);
- SkASSERT(memcmp(v, iset(vv, 60, 120, 180), sizeof(v)) == 0);
-
- result = inter.timeToValues(125, v);
- SkASSERT(result == kNormal_Result);
- result = inter.timeToValues(175, v);
- SkASSERT(result == kNormal_Result);
-#endif
-}
-
-#endif
« no previous file with comments | « include/utils/SkInterpolator.h ('k') | tests/InterpolatorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698