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

Method allocPixelsFlags

shared/java/Bitmap.java:432–447  ·  view source on GitHub ↗

Sets ImageInfo to info following the rules in setImageInfo() and allocates pixel memory. Memory is zeroed. Returns false and calls reset() if ImageInfo could not be set, or memory could not be allocated, or memory could not optionally be zeroed. On most platforms, allocating pixel

(@NotNull ImageInfo imageInfo, boolean zeroPixels)

Source from the content-addressed store, hash-verified

430 * @return true if pixels allocation is successful
431 */
432 public boolean allocPixelsFlags(@NotNull ImageInfo imageInfo, boolean zeroPixels) {
433 try {
434 _imageInfo = null;
435 Stats.onNativeCall();
436 return _nAllocPixelsFlags(_ptr,
437 imageInfo._width,
438 imageInfo._height,
439 imageInfo._colorInfo._colorType.ordinal(),
440 imageInfo._colorInfo._alphaType.ordinal(),
441 Native.getPtr(imageInfo._colorInfo._colorSpace),
442 zeroPixels ? 1 : 0);
443 } finally {
444 ReferenceUtil.reachabilityFence(this);
445 ReferenceUtil.reachabilityFence(imageInfo._colorInfo._colorSpace);
446 }
447 }
448
449 /**
450 * <p>Sets ImageInfo to info following the rules in setImageInfo() and allocates pixel

Callers 1

drawPixelsMethod · 0.80

Calls 4

onNativeCallMethod · 0.95
_nAllocPixelsFlagsMethod · 0.95
getPtrMethod · 0.95
reachabilityFenceMethod · 0.95

Tested by

no test coverage detected