OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBuffer.h" | 8 #include "SkBuffer.h" |
9 #include "SkCubicClipper.h" | 9 #include "SkCubicClipper.h" |
10 #include "SkErrorInternals.h" | 10 #include "SkErrorInternals.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 if (count != compare.fPathRef->countVerbs()) { | 198 if (count != compare.fPathRef->countVerbs()) { |
199 return false; | 199 return false; |
200 } | 200 } |
201 if (!count) { | 201 if (!count) { |
202 return true; | 202 return true; |
203 } | 203 } |
204 if (memcmp(fPathRef->verbsMemBegin(), compare.fPathRef->verbsMemBegin(), | 204 if (memcmp(fPathRef->verbsMemBegin(), compare.fPathRef->verbsMemBegin(), |
205 count)) { | 205 count)) { |
206 return false; | 206 return false; |
207 } | 207 } |
208 return !SkToBool(memcmp(fPathRef->conicWeights(), compare.fPathRef->conicWei
ghts(), | 208 return !fPathRef->countWeights() || |
| 209 !SkToBool(memcmp(fPathRef->conicWeights(), compare.fPathRef->conicWe
ights(), |
209 fPathRef->countWeights() * sizeof(*fPathRef->conicWeights()))); | 210 fPathRef->countWeights() * sizeof(*fPathRef->conicWeights()))); |
210 } | 211 } |
211 | 212 |
212 bool SkPath::interpolate(const SkPath& ending, SkScalar weight, SkPath* out) con
st { | 213 bool SkPath::interpolate(const SkPath& ending, SkScalar weight, SkPath* out) con
st { |
213 int verbCount = fPathRef->countVerbs(); | 214 int verbCount = fPathRef->countVerbs(); |
214 if (verbCount != ending.fPathRef->countVerbs()) { | 215 if (verbCount != ending.fPathRef->countVerbs()) { |
215 return false; | 216 return false; |
216 } | 217 } |
217 if (!verbCount) { | 218 if (!verbCount) { |
218 return true; | 219 return true; |
(...skipping 2990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3209 } | 3210 } |
3210 } while (!done); | 3211 } while (!done); |
3211 return SkToBool(tangents.count()) ^ isInverse; | 3212 return SkToBool(tangents.count()) ^ isInverse; |
3212 } | 3213 } |
3213 | 3214 |
3214 int SkPath::ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPo
int& p2, | 3215 int SkPath::ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPo
int& p2, |
3215 SkScalar w, SkPoint pts[], int pow2) { | 3216 SkScalar w, SkPoint pts[], int pow2) { |
3216 const SkConic conic(p0, p1, p2, w); | 3217 const SkConic conic(p0, p1, p2, w); |
3217 return conic.chopIntoQuadsPOW2(pts, pow2); | 3218 return conic.chopIntoQuadsPOW2(pts, pow2); |
3218 } | 3219 } |
OLD | NEW |