caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | #ifndef PathOpsTestCommon_DEFINED |
| 8 | #define PathOpsTestCommon_DEFINED |
| 9 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 10 | #include "SkPathOpsQuad.h" |
caryclark@google.com | d892bd8 | 2013-06-17 14:10:36 +0000 | [diff] [blame] | 11 | #include "SkTArray.h" |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 12 | |
caryclark@google.com | 8d0a524 | 2013-07-16 16:11:16 +0000 | [diff] [blame] | 13 | struct SkPathOpsBounds; |
| 14 | |
caryclark | a35ab3e | 2016-10-20 08:32:18 -0700 | [diff] [blame] | 15 | struct QuadPts { |
| 16 | static const int kPointCount = 3; |
| 17 | SkDPoint fPts[kPointCount]; |
| 18 | }; |
| 19 | |
| 20 | struct ConicPts { |
| 21 | QuadPts fPts; |
| 22 | SkScalar fWeight; |
| 23 | }; |
| 24 | |
| 25 | struct CubicPts { |
| 26 | static const int kPointCount = 4; |
| 27 | SkDPoint fPts[kPointCount]; |
| 28 | }; |
| 29 | |
caryclark | e4097e3 | 2014-06-18 07:24:19 -0700 | [diff] [blame] | 30 | void CubicPathToQuads(const SkPath& cubicPath, SkPath* quadPath); |
| 31 | void CubicPathToSimple(const SkPath& cubicPath, SkPath* simplePath); |
caryclark@google.com | d892bd8 | 2013-06-17 14:10:36 +0000 | [diff] [blame] | 32 | void CubicToQuads(const SkDCubic& cubic, double precision, SkTArray<SkDQuad, true>& quads); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 33 | bool ValidBounds(const SkPathOpsBounds& ); |
| 34 | bool ValidConic(const SkDConic& cubic); |
caryclark@google.com | 8d0a524 | 2013-07-16 16:11:16 +0000 | [diff] [blame] | 35 | bool ValidCubic(const SkDCubic& cubic); |
| 36 | bool ValidLine(const SkDLine& line); |
| 37 | bool ValidPoint(const SkDPoint& pt); |
| 38 | bool ValidPoints(const SkPoint* pts, int count); |
| 39 | bool ValidQuad(const SkDQuad& quad); |
caryclark@google.com | 8d0a524 | 2013-07-16 16:11:16 +0000 | [diff] [blame] | 40 | bool ValidVector(const SkDVector& v); |
caryclark@google.com | 818b0cc | 2013-04-08 11:50:46 +0000 | [diff] [blame] | 41 | |
| 42 | #endif |