MCPcopy Create free account
hub / github.com/HumbleUI/Skija / getSegmentTypes

Method getSegmentTypes

shared/java/Path.java:934–951  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Callers 1

storageMethod · 0.95

Calls 3

onNativeCallMethod · 0.95
_nGetSegmentMasksMethod · 0.95
reachabilityFenceMethod · 0.95

Tested by 1

storageMethod · 0.76