Returns array of PathSegmentType this Path contains. Returns empty array if Path contains no lines, or curves: quads, conics, or cubics. getSegmentTypes() returns a cached result; it is very fast. @return array of PathSegmentType this Path con
()
| 932 | * @return array of {@link PathSegmentType} this {@link Path} contains |
| 933 | */ |
| 934 | @Contract(pure = true) |
| 935 | public PathSegmentType[] getSegmentTypes() { |
| 936 | try { |
| 937 | Stats.onNativeCall(); |
| 938 | int mask = _nGetSegmentMasks(_ptr); |
| 939 | PathSegmentType[] result = new PathSegmentType[Integer.bitCount(mask)]; |
| 940 | int idx = 0; |
| 941 | for (PathSegmentType type: PathSegmentType._values) { |
| 942 | if ((mask & type._value) != 0) { |
| 943 | result[idx] = type; |
| 944 | ++idx; |
| 945 | } |
| 946 | } |
| 947 | return result; |
| 948 | } finally { |
| 949 | ReferenceUtil.reachabilityFence(this); |
| 950 | } |
| 951 | } |
| 952 | |
| 953 | /** |
| 954 | * <p>Specifies whether Path is volatile; whether it will be altered or discarded |