| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 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 #include "SkPathOpsLine.h" | 7 #include "SkPathOpsLine.h" |
| 8 | 8 |
| 9 SkDLine SkDLine::subDivide(double t1, double t2) const { | 9 SkDLine SkDLine::subDivide(double t1, double t2) const { |
| 10 SkDVector delta = tangent(); | 10 SkDVector delta = tangent(); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 double distSq = distU.fX * distU.fX + distU.fY * distU.fY; | 182 double distSq = distU.fX * distU.fX + distU.fY * distU.fY; |
| 183 double dist = sqrt(distSq); // OPTIMIZATION: can we compare against distSq i
nstead ? | 183 double dist = sqrt(distSq); // OPTIMIZATION: can we compare against distSq i
nstead ? |
| 184 double tiniest = SkTMin(SkTMin(x, top), bottom); | 184 double tiniest = SkTMin(SkTMin(x, top), bottom); |
| 185 double largest = SkTMax(SkTMax(x, top), bottom); | 185 double largest = SkTMax(SkTMax(x, top), bottom); |
| 186 largest = SkTMax(largest, -tiniest); | 186 largest = SkTMax(largest, -tiniest); |
| 187 if (!AlmostEqualUlps(largest, largest + dist)) { // is the dist within ULPS
tolerance? | 187 if (!AlmostEqualUlps(largest, largest + dist)) { // is the dist within ULPS
tolerance? |
| 188 return -1; | 188 return -1; |
| 189 } | 189 } |
| 190 return t; | 190 return t; |
| 191 } | 191 } |
| 192 | |
| 193 #ifdef SK_DEBUG | |
| 194 void SkDLine::dump() { | |
| 195 SkDebugf("{{"); | |
| 196 fPts[0].dump(); | |
| 197 SkDebugf(", "); | |
| 198 fPts[1].dump(); | |
| 199 SkDebugf("}}\n"); | |
| 200 } | |
| 201 #endif | |
| OLD | NEW |