OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkBuffer.h" | 10 #include "SkBuffer.h" |
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2235 void addPt(const SkPoint& pt) { | 2235 void addPt(const SkPoint& pt) { |
2236 if (SkPath::kConcave_Convexity == fConvexity) { | 2236 if (SkPath::kConcave_Convexity == fConvexity) { |
2237 return; | 2237 return; |
2238 } | 2238 } |
2239 | 2239 |
2240 if (0 == fPtCount) { | 2240 if (0 == fPtCount) { |
2241 fCurrPt = pt; | 2241 fCurrPt = pt; |
2242 ++fPtCount; | 2242 ++fPtCount; |
2243 } else { | 2243 } else { |
2244 SkVector vec = pt - fCurrPt; | 2244 SkVector vec = pt - fCurrPt; |
2245 if (vec.fX || vec.fY) { | 2245 if (!SkScalarNearlyZero(vec.lengthSqd(), SK_ScalarNearlyZero*SK_Scal arNearlyZero)) { |
caryclark
2014/11/17 19:37:55
looks like SK_ScalarNearlyZero*SK_ScalarNearlyZero
| |
2246 fLastPt = fCurrPt; | 2246 fLastPt = fCurrPt; |
2247 fCurrPt = pt; | 2247 fCurrPt = pt; |
2248 if (++fPtCount == 2) { | 2248 if (++fPtCount == 2) { |
2249 fFirstVec = fLastVec = vec; | 2249 fFirstVec = fLastVec = vec; |
2250 } else { | 2250 } else { |
2251 SkASSERT(fPtCount > 2); | 2251 SkASSERT(fPtCount > 2); |
2252 this->addVec(vec); | 2252 this->addVec(vec); |
2253 } | 2253 } |
2254 | 2254 |
2255 int sx = sign(vec.fX); | 2255 int sx = sign(vec.fX); |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2864 switch (this->getFillType()) { | 2864 switch (this->getFillType()) { |
2865 case SkPath::kEvenOdd_FillType: | 2865 case SkPath::kEvenOdd_FillType: |
2866 case SkPath::kInverseEvenOdd_FillType: | 2866 case SkPath::kInverseEvenOdd_FillType: |
2867 w &= 1; | 2867 w &= 1; |
2868 break; | 2868 break; |
2869 default: | 2869 default: |
2870 break; | 2870 break; |
2871 } | 2871 } |
2872 return SkToBool(w); | 2872 return SkToBool(w); |
2873 } | 2873 } |
OLD | NEW |