MCPcopy Index your code
hub / github.com/HumbleUI/Skija / makeRasterFromBitmap

Method makeRasterFromBitmap

shared/java/Image.java:196–208  ·  view source on GitHub ↗

Creates Image from bitmap, sharing or copying bitmap pixels. If the bitmap is marked immutable, and its pixel memory is shareable, it may be shared instead of copied. Image is returned if bitmap is valid. Valid Bitmap parameters include: dimensions are greater than zero;

(@NotNull Bitmap bitmap)

Source from the content-addressed store, hash-verified

194 * @see <a href="https://fiddle.skia.org/c/@Image_MakeFromBitmap">https://fiddle.skia.org/c/@Image_MakeFromBitmap</a>
195 */
196 @NotNull @Contract("_ -> new")
197 public static Image makeRasterFromBitmap(@NotNull Bitmap bitmap) {
198 try {
199 assert bitmap != null : "Can’t makeFromBitmap with bitmap == null";
200 Stats.onNativeCall();
201 long ptr = _nMakeRasterFromBitmap(Native.getPtr(bitmap));
202 if (ptr == 0)
203 throw new RuntimeException("Failed to Image::makeFromBitmap " + bitmap);
204 return new Image(ptr);
205 } finally {
206 ReferenceUtil.reachabilityFence(bitmap);
207 }
208 }
209
210 /**
211 * @deprecated - use {@link #makeRasterFromPixmap(Pixmap)}

Callers 12

makeFromBitmapMethod · 0.95
drawGrayMethod · 0.95
drawBitmapCanvasMethod · 0.95
drawPixelsMethod · 0.95
drawSubsetMethod · 0.95
drawPixelRefMethod · 0.95
drawAlphaMethod · 0.95
drawEraseMethod · 0.95
drawMethod · 0.95
drawMethod · 0.95
skImageMethod · 0.95

Calls 4

onNativeCallMethod · 0.95
getPtrMethod · 0.95
reachabilityFenceMethod · 0.95

Tested by 1