예제 #1
0
파일: CFBundle.java 프로젝트: wynney/robovm
 @MarshalsPointer
 public static long toNative(List<? extends CFType> l, long flags) {
   if (l == null) {
     return 0L;
   }
   CFArray o = null;
   if (l instanceof CFArray) {
     o = (CFArray) l;
   } else {
     o = CFArray.create((List<? extends CFType>) l);
   }
   return CFType.Marshaler.toNative(o, flags);
 }
예제 #2
0
 private static CGGradient create(CGColorSpace space, CGColor[] colors, Object locations) {
   if (colors == null) {
     throw new NullPointerException("colors");
   }
   try (CFArray colorsArray = CFArray.create(colors)) {
     return create(
         space,
         colorsArray,
         locations != null
             ? VM.getArrayValuesAddress(CoreGraphics.toMachineSizedFloatArray(locations))
             : 0);
   }
 }