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

Unified Diff: tests/PathMeasureTest.cpp

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 years, 1 month 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 | « tests/ParsePathTest.cpp ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathMeasureTest.cpp
diff --git a/tests/PathMeasureTest.cpp b/tests/PathMeasureTest.cpp
index 4c26bc17cde12a51eeef998c02c96a83afb7fad1..c9acb7ea0004c62a7481f141c309b9ce151072d3 100644
--- a/tests/PathMeasureTest.cpp
+++ b/tests/PathMeasureTest.cpp
@@ -51,7 +51,7 @@ static void test_small_segment() {
const SkPoint pts[] = {
{ 100000, 100000},
// big jump between these points, makes a big segment
- { SkFloatToScalar(1.0005f), SkFloatToScalar(0.9999f) },
+ { 1.0005f, 0.9999f },
// tiny (non-zero) jump between these points
{ SK_Scalar1, SK_Scalar1 },
};
@@ -123,7 +123,7 @@ static void TestPathMeasure(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter,
SkScalarNearlyEqual(position.fX,
-SK_ScalarHalf,
- SkFloatToScalar(0.0001f)));
+ 0.0001f));
REPORTER_ASSERT(reporter, position.fY == 0);
REPORTER_ASSERT(reporter, tangent.fX == -SK_Scalar1);
REPORTER_ASSERT(reporter, tangent.fY == 0);
@@ -148,26 +148,26 @@ static void TestPathMeasure(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter,
SkScalarNearlyEqual(position.fX,
SK_ScalarHalf,
- SkFloatToScalar(0.0001f)));
+ 0.0001f));
REPORTER_ASSERT(reporter, position.fY == 0);
REPORTER_ASSERT(reporter, tangent.fX == SK_Scalar1);
REPORTER_ASSERT(reporter, tangent.fY == 0);
- REPORTER_ASSERT(reporter, meas.getPosTan(SkFloatToScalar(2.5f), &position, &tangent));
+ REPORTER_ASSERT(reporter, meas.getPosTan(2.5f, &position, &tangent));
REPORTER_ASSERT(reporter,
- SkScalarNearlyEqual(position.fX, SK_Scalar1, SkFloatToScalar(0.0001f)));
+ SkScalarNearlyEqual(position.fX, SK_Scalar1, 0.0001f));
REPORTER_ASSERT(reporter,
- SkScalarNearlyEqual(position.fY, SkFloatToScalar(1.5f)));
+ SkScalarNearlyEqual(position.fY, 1.5f));
REPORTER_ASSERT(reporter, tangent.fX == 0);
REPORTER_ASSERT(reporter, tangent.fY == SK_Scalar1);
- REPORTER_ASSERT(reporter, meas.getPosTan(SkFloatToScalar(4.5f), &position, &tangent));
+ REPORTER_ASSERT(reporter, meas.getPosTan(4.5f, &position, &tangent));
REPORTER_ASSERT(reporter,
SkScalarNearlyEqual(position.fX,
- SkFloatToScalar(2.5f),
- SkFloatToScalar(0.0001f)));
+ 2.5f,
+ 0.0001f));
REPORTER_ASSERT(reporter,
SkScalarNearlyEqual(position.fY,
- SkFloatToScalar(2.0f),
- SkFloatToScalar(0.0001f)));
+ 2.0f,
+ 0.0001f));
REPORTER_ASSERT(reporter, tangent.fX == SK_Scalar1);
REPORTER_ASSERT(reporter, tangent.fY == 0);
@@ -184,7 +184,7 @@ static void TestPathMeasure(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter,
SkScalarNearlyEqual(position.fX,
SK_ScalarHalf,
- SkFloatToScalar(0.0001f)));
+ 0.0001f));
REPORTER_ASSERT(reporter, position.fY == 0);
REPORTER_ASSERT(reporter, tangent.fX == SK_Scalar1);
REPORTER_ASSERT(reporter, tangent.fY == 0);
@@ -194,12 +194,12 @@ static void TestPathMeasure(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, meas.getPosTan(SK_ScalarHalf, &position, &tangent));
REPORTER_ASSERT(reporter,
SkScalarNearlyEqual(position.fX,
- SkFloatToScalar(1.5f),
- SkFloatToScalar(0.0001f)));
+ 1.5f,
+ 0.0001f));
REPORTER_ASSERT(reporter,
SkScalarNearlyEqual(position.fY,
- SkFloatToScalar(2.0f),
- SkFloatToScalar(0.0001f)));
+ 2.0f,
+ 0.0001f));
REPORTER_ASSERT(reporter, tangent.fX == -SK_Scalar1);
REPORTER_ASSERT(reporter, tangent.fY == 0);
« no previous file with comments | « tests/ParsePathTest.cpp ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698