MCPcopy Create free account
hub / github.com/JetBrains/skija / allocPixelsFlags

Method allocPixelsFlags

shared/java/Bitmap.java:406–421  ·  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

404 * @return true if pixels allocation is successful
405 */
406 public boolean allocPixelsFlags(@NotNull ImageInfo imageInfo, boolean zeroPixels) {
407 try {
408 _imageInfo = null;
409 Stats.onNativeCall();
410 return _nAllocPixelsFlags(_ptr,
411 imageInfo._width,
412 imageInfo._height,
413 imageInfo._colorInfo._colorType.ordinal(),
414 imageInfo._colorInfo._alphaType.ordinal(),
415 Native.getPtr(imageInfo._colorInfo._colorSpace),
416 zeroPixels ? 1 : 0);
417 } finally {
418 Reference.reachabilityFence(this);
419 Reference.reachabilityFence(imageInfo._colorInfo._colorSpace);
420 }
421 }
422
423 /**
424 * <p>Sets ImageInfo to info following the rules in setImageInfo() and allocates pixel

Callers 1

drawPixelsMethod · 0.80

Calls 3

onNativeCallMethod · 0.95
_nAllocPixelsFlagsMethod · 0.95
getPtrMethod · 0.95

Tested by

no test coverage detected