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 "PathOpsTestCommon.h" | 7 #include "PathOpsTestCommon.h" |
8 #include "SkPathOpsBounds.h" | 8 #include "SkPathOpsBounds.h" |
| 9 #include "SkPathOpsConic.h" |
9 #include "SkPathOpsCubic.h" | 10 #include "SkPathOpsCubic.h" |
10 #include "SkPathOpsLine.h" | 11 #include "SkPathOpsLine.h" |
11 #include "SkPathOpsQuad.h" | 12 #include "SkPathOpsQuad.h" |
12 #include "SkReduceOrder.h" | 13 #include "SkReduceOrder.h" |
13 #include "SkTSort.h" | 14 #include "SkTSort.h" |
14 | 15 |
15 static double calc_t_div(const SkDCubic& cubic, double precision, double start)
{ | 16 static double calc_t_div(const SkDCubic& cubic, double precision, double start)
{ |
16 const double adjust = sqrt(3.) / 36; | 17 const double adjust = sqrt(3.) / 36; |
17 SkDCubic sub; | 18 SkDCubic sub; |
18 const SkDCubic* cPtr; | 19 const SkDCubic* cPtr; |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 } | 246 } |
246 if (SkScalarIsNaN(bounds.fTop)) { | 247 if (SkScalarIsNaN(bounds.fTop)) { |
247 return false; | 248 return false; |
248 } | 249 } |
249 if (SkScalarIsNaN(bounds.fRight)) { | 250 if (SkScalarIsNaN(bounds.fRight)) { |
250 return false; | 251 return false; |
251 } | 252 } |
252 return !SkScalarIsNaN(bounds.fBottom); | 253 return !SkScalarIsNaN(bounds.fBottom); |
253 } | 254 } |
254 | 255 |
| 256 bool ValidConic(const SkDConic& conic) { |
| 257 for (int index = 0; index < SkDConic::kPointCount; ++index) { |
| 258 if (!ValidPoint(conic[index])) { |
| 259 return false; |
| 260 } |
| 261 } |
| 262 if (SkDoubleIsNaN(conic.fWeight)) { |
| 263 return false; |
| 264 } |
| 265 return true; |
| 266 } |
| 267 |
255 bool ValidCubic(const SkDCubic& cubic) { | 268 bool ValidCubic(const SkDCubic& cubic) { |
256 for (int index = 0; index < 4; ++index) { | 269 for (int index = 0; index < 4; ++index) { |
257 if (!ValidPoint(cubic[index])) { | 270 if (!ValidPoint(cubic[index])) { |
258 return false; | 271 return false; |
259 } | 272 } |
260 } | 273 } |
261 return true; | 274 return true; |
262 } | 275 } |
263 | 276 |
264 bool ValidLine(const SkDLine& line) { | 277 bool ValidLine(const SkDLine& line) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 310 } |
298 return true; | 311 return true; |
299 } | 312 } |
300 | 313 |
301 bool ValidVector(const SkDVector& v) { | 314 bool ValidVector(const SkDVector& v) { |
302 if (SkDoubleIsNaN(v.fX)) { | 315 if (SkDoubleIsNaN(v.fX)) { |
303 return false; | 316 return false; |
304 } | 317 } |
305 return !SkDoubleIsNaN(v.fY); | 318 return !SkDoubleIsNaN(v.fY); |
306 } | 319 } |
OLD | NEW |