diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-02-20 14:55:20 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-02-20 14:55:20 +0000 |
commit | f33612b923c3d065aabda6967247771d9aa6172c (patch) | |
tree | d36e537bada86f58ef203fb4082446d3fd230636 | |
parent | 5e0500fb5f17fe14db42fc3e0aad08e6b41ccc5f (diff) |
Fix compare of scalar against (int) kMaxTValue.
Also fix order of related compares, placing literal first.
http://code.google.com/p/skia/issues/detail?id=1127
Review URL: https://codereview.appspot.com/7385043
git-svn-id: http://skia.googlecode.com/svn/trunk@7791 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/core/SkPathMeasure.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp index 436753e4a1..c97c826846 100644 --- a/src/core/SkPathMeasure.cpp +++ b/src/core/SkPathMeasure.cpp @@ -283,7 +283,7 @@ static void seg_to(const SkPoint pts[], int segType, switch (segType) { case kLine_SegType: - if (stopT == kMaxTValue) { + if (SK_Scalar1 == stopT) { dst->lineTo(pts[1]); } else { dst->lineTo(SkScalarInterp(pts[0].fX, pts[1].fX, stopT), @@ -291,8 +291,8 @@ static void seg_to(const SkPoint pts[], int segType, } break; case kQuad_SegType: - if (startT == 0) { - if (stopT == SK_Scalar1) { + if (0 == startT) { + if (SK_Scalar1 == stopT) { dst->quadTo(pts[1], pts[2]); } else { SkChopQuadAt(pts, tmp0, stopT); @@ -300,7 +300,7 @@ static void seg_to(const SkPoint pts[], int segType, } } else { SkChopQuadAt(pts, tmp0, startT); - if (stopT == SK_Scalar1) { + if (SK_Scalar1 == stopT) { dst->quadTo(tmp0[3], tmp0[4]); } else { SkChopQuadAt(&tmp0[2], tmp1, SkScalarDiv(stopT - startT, @@ -310,8 +310,8 @@ static void seg_to(const SkPoint pts[], int segType, } break; case kCubic_SegType: - if (startT == 0) { - if (stopT == SK_Scalar1) { + if (0 == startT) { + if (SK_Scalar1 == stopT) { dst->cubicTo(pts[1], pts[2], pts[3]); } else { SkChopCubicAt(pts, tmp0, stopT); @@ -319,7 +319,7 @@ static void seg_to(const SkPoint pts[], int segType, } } else { SkChopCubicAt(pts, tmp0, startT); - if (stopT == SK_Scalar1) { + if (SK_Scalar1 == stopT) { dst->cubicTo(tmp0[4], tmp0[5], tmp0[6]); } else { SkChopCubicAt(&tmp0[3], tmp1, SkScalarDiv(stopT - startT, |