diff options
Diffstat (limited to 'tests/PathOpsTestCommon.cpp')
-rw-r--r-- | tests/PathOpsTestCommon.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/PathOpsTestCommon.cpp b/tests/PathOpsTestCommon.cpp index f1cba8ed8b..d933115132 100644 --- a/tests/PathOpsTestCommon.cpp +++ b/tests/PathOpsTestCommon.cpp @@ -6,6 +6,7 @@ */ #include "PathOpsTestCommon.h" #include "SkPathOpsBounds.h" +#include "SkPathOpsConic.h" #include "SkPathOpsCubic.h" #include "SkPathOpsLine.h" #include "SkPathOpsQuad.h" @@ -252,6 +253,18 @@ bool ValidBounds(const SkPathOpsBounds& bounds) { return !SkScalarIsNaN(bounds.fBottom); } +bool ValidConic(const SkDConic& conic) { + for (int index = 0; index < SkDConic::kPointCount; ++index) { + if (!ValidPoint(conic[index])) { + return false; + } + } + if (SkDoubleIsNaN(conic.fWeight)) { + return false; + } + return true; +} + bool ValidCubic(const SkDCubic& cubic) { for (int index = 0; index < 4; ++index) { if (!ValidPoint(cubic[index])) { |