| 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 #include "SkRect.h" | 9 #include "SkRect.h" |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 if (count & 1) { | 65 if (count & 1) { |
| 66 min = Sk4s(pts[0].fX, pts[0].fY, pts[0].fX, pts[0].fY); | 66 min = Sk4s(pts[0].fX, pts[0].fY, pts[0].fX, pts[0].fY); |
| 67 pts += 1; | 67 pts += 1; |
| 68 count -= 1; | 68 count -= 1; |
| 69 } else { | 69 } else { |
| 70 min = Sk4s::Load(&pts[0].fX); | 70 min = Sk4s::Load(&pts[0].fX); |
| 71 pts += 2; | 71 pts += 2; |
| 72 count -= 2; | 72 count -= 2; |
| 73 } | 73 } |
| 74 accum = max = min; | 74 accum = max = min; |
| 75 accum *= Sk4s(0); | 75 accum = accum * Sk4s(0); |
| 76 | 76 |
| 77 count >>= 1; | 77 count >>= 1; |
| 78 for (int i = 0; i < count; ++i) { | 78 for (int i = 0; i < count; ++i) { |
| 79 Sk4s xy = Sk4s::Load(&pts->fX); | 79 Sk4s xy = Sk4s::Load(&pts->fX); |
| 80 accum *= xy; | 80 accum = accum * xy; |
| 81 min = Sk4s::Min(min, xy); | 81 min = Sk4s::Min(min, xy); |
| 82 max = Sk4s::Max(max, xy); | 82 max = Sk4s::Max(max, xy); |
| 83 pts += 2; | 83 pts += 2; |
| 84 } | 84 } |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * With some trickery, we may be able to use Min/Max to also propogate
non-finites, | 87 * With some trickery, we may be able to use Min/Max to also propogate
non-finites, |
| 88 * in which case we could eliminate accum entirely, and just check min
and max for | 88 * in which case we could eliminate accum entirely, and just check min
and max for |
| 89 * "is_finite". | 89 * "is_finite". |
| 90 */ | 90 */ |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 SkString strL, strT, strR, strB; | 168 SkString strL, strT, strR, strB; |
| 169 SkAppendScalarDec(&strL, fLeft); | 169 SkAppendScalarDec(&strL, fLeft); |
| 170 SkAppendScalarDec(&strT, fTop); | 170 SkAppendScalarDec(&strT, fTop); |
| 171 SkAppendScalarDec(&strR, fRight); | 171 SkAppendScalarDec(&strR, fRight); |
| 172 SkAppendScalarDec(&strB, fBottom); | 172 SkAppendScalarDec(&strB, fBottom); |
| 173 line.printf("SkRect::MakeLTRB(%s, %s, %s, %s);", | 173 line.printf("SkRect::MakeLTRB(%s, %s, %s, %s);", |
| 174 strL.c_str(), strT.c_str(), strR.c_str(), strB.c_str()); | 174 strL.c_str(), strT.c_str(), strR.c_str(), strB.c_str()); |
| 175 } | 175 } |
| 176 SkDebugf("%s\n", line.c_str()); | 176 SkDebugf("%s\n", line.c_str()); |
| 177 } | 177 } |
| OLD | NEW |