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

Method allocPixels

shared/java/Bitmap.java:440–455  ·  view source on GitHub ↗

Sets ImageInfo to info following the rules in setImageInfo() and allocates pixel memory. rowBytes must equal or exceed info.width() times info.bytesPerPixel(), or equal zero. Returns false and calls reset() if ImageInfo could not be set, or memory could not be allocated. On most p

(@NotNull ImageInfo info, long rowBytes)

Source from the content-addressed store, hash-verified

438 * @return true if pixel storage is allocated
439 */
440 public boolean allocPixels(@NotNull ImageInfo info, long rowBytes) {
441 try {
442 _imageInfo = null;
443 Stats.onNativeCall();
444 return _nAllocPixelsRowBytes(_ptr,
445 info._width,
446 info._height,
447 info._colorInfo._colorType.ordinal(),
448 info._colorInfo._alphaType.ordinal(),
449 Native.getPtr(info._colorInfo._colorSpace),
450 rowBytes);
451 } finally {
452 Reference.reachabilityFence(this);
453 Reference.reachabilityFence(info._colorInfo._colorSpace);
454 }
455 }
456
457 /**
458 * <p>Sets ImageInfo to info following the rules in {@link #setImageInfo(ImageInfo, long)} and allocates pixel

Callers 14

executeMethod · 0.95
readPixelsMethod · 0.95
makeFromImageMethod · 0.95
allocN32PixelsMethod · 0.95
executeMethod · 0.80
drawGrayMethod · 0.80
drawBlurMethod · 0.80
drawBitmapCanvasMethod · 0.80
drawSubsetMethod · 0.80
drawPixelRefMethod · 0.80
drawAlphaMethod · 0.80
CodecSceneMethod · 0.80

Calls 5

onNativeCallMethod · 0.95
_nAllocPixelsRowBytesMethod · 0.95
getPtrMethod · 0.95
_nAllocPixelsMethod · 0.95
getMinRowBytesMethod · 0.80

Tested by 2

executeMethod · 0.76
executeMethod · 0.64