Package org.robolectric.nativeruntime
Class BitmapNatives
java.lang.Object
org.robolectric.nativeruntime.BitmapNatives
Native methods for Bitmap JNI registration.
 
Native method signatures are derived from https://cs.android.com/android/platform/superproject/+/android-12.0.0_r1:frameworks/base/graphics/java/android/graphics/Bitmap.java
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleannativeCompress(long nativeBitmap, int format, int quality, OutputStream stream, byte[] tempStorage) static ColorSpacenativeComputeColorSpace(long nativePtr) static intnativeConfig(long nativeBitmap) static BitmapnativeCopy(long nativeSrcBitmap, int nativeConfig, boolean isMutable) static BitmapnativeCopyAshmem(long nativeSrcBitmap) static BitmapnativeCopyAshmemConfig(long nativeSrcBitmap, int nativeConfig) static voidnativeCopyColorSpaceP(long srcBitmap, long dstBitmap) static voidnativeCopyPixelsFromBuffer(long nativeBitmap, Buffer src) static voidnativeCopyPixelsToBuffer(long nativeBitmap, Buffer dst) static BitmapnativeCopyPreserveInternalConfig(long nativeBitmap) static BitmapnativeCreate(int[] colors, int offset, int stride, int width, int height, int nativeConfig, boolean mutable, long nativeColorSpace) static Bitmapstatic voidnativeErase(long nativeBitmap, int color) static voidnativeErase(long nativeBitmap, long colorSpacePtr, long color) static BitmapnativeExtractAlpha(long nativeBitmap, long nativePaint, int[] offsetXY) static intnativeGenerationId(long nativeBitmap) static intnativeGetAllocationByteCount(long nativeBitmap) static longnativeGetColor(long nativeBitmap, int x, int y) static HardwareBuffernativeGetHardwareBuffer(long nativeBitmap) static longstatic intnativeGetPixel(long nativeBitmap, int x, int y) static voidnativeGetPixels(long nativeBitmap, int[] pixels, int offset, int stride, int x, int y, int width, int height) static booleannativeHasAlpha(long nativeBitmap) static booleannativeHasMipMap(long nativeBitmap) static booleannativeIsBackedByAshmem(long nativePtr) static booleannativeIsImmutable(long nativePtr) static booleannativeIsPremultiplied(long nativeBitmap) static booleannativeIsSRGB(long nativePtr) static booleannativeIsSRGBLinear(long nativePtr) static voidnativePrepareToDraw(long nativeBitmap) static voidnativeReconfigure(long nativeBitmap, int width, int height, int config, boolean isPremultiplied) static voidnativeRecycle(long nativeBitmap) static intnativeRowBytes(long nativeBitmap) static booleannativeSameAs(long nativeBitmap0, long nativeBitmap1) static voidnativeSetColorSpace(long nativePtr, long nativeColorSpace) static voidnativeSetHasAlpha(long nativeBitmap, boolean hasAlpha, boolean requestPremul) static voidnativeSetHasMipMap(long nativeBitmap, boolean hasMipMap) static voidnativeSetImmutable(long nativePtr) static voidnativeSetPixel(long nativeBitmap, int x, int y, int color) static voidnativeSetPixels(long nativeBitmap, int[] colors, int offset, int stride, int x, int y, int width, int height) static voidnativeSetPremultiplied(long nativeBitmap, boolean isPremul) static BitmapnativeWrapHardwareBufferBitmap(HardwareBuffer buffer, long nativeColorSpace) static booleannativeWriteToParcel(long nativeBitmap, int density, Parcel p) 
- 
Method Details- 
nativeCreatepublic static Bitmap nativeCreate(int[] colors, int offset, int stride, int width, int height, int nativeConfig, boolean mutable, long nativeColorSpace) 
- 
nativeCopy
- 
nativeCopyAshmem
- 
nativeCopyAshmemConfig
- 
nativeGetNativeFinalizerpublic static long nativeGetNativeFinalizer()
- 
nativeRecyclepublic static void nativeRecycle(long nativeBitmap) 
- 
nativeReconfigurepublic static void nativeReconfigure(long nativeBitmap, int width, int height, int config, boolean isPremultiplied) 
- 
nativeCompresspublic static boolean nativeCompress(long nativeBitmap, int format, int quality, OutputStream stream, byte[] tempStorage) 
- 
nativeErasepublic static void nativeErase(long nativeBitmap, int color) 
- 
nativeErasepublic static void nativeErase(long nativeBitmap, long colorSpacePtr, long color) 
- 
nativeRowBytespublic static int nativeRowBytes(long nativeBitmap) 
- 
nativeConfigpublic static int nativeConfig(long nativeBitmap) 
- 
nativeGetPixelpublic static int nativeGetPixel(long nativeBitmap, int x, int y) 
- 
nativeGetColorpublic static long nativeGetColor(long nativeBitmap, int x, int y) 
- 
nativeGetPixelspublic static void nativeGetPixels(long nativeBitmap, int[] pixels, int offset, int stride, int x, int y, int width, int height) 
- 
nativeSetPixelpublic static void nativeSetPixel(long nativeBitmap, int x, int y, int color) 
- 
nativeSetPixelspublic static void nativeSetPixels(long nativeBitmap, int[] colors, int offset, int stride, int x, int y, int width, int height) 
- 
nativeCopyPixelsToBuffer
- 
nativeCopyPixelsFromBuffer
- 
nativeGenerationIdpublic static int nativeGenerationId(long nativeBitmap) 
- 
nativeCreateFromParcel
- 
nativeWriteToParcel
- 
nativeExtractAlpha
- 
nativeHasAlphapublic static boolean nativeHasAlpha(long nativeBitmap) 
- 
nativeIsPremultipliedpublic static boolean nativeIsPremultiplied(long nativeBitmap) 
- 
nativeSetPremultipliedpublic static void nativeSetPremultiplied(long nativeBitmap, boolean isPremul) 
- 
nativeSetHasAlphapublic static void nativeSetHasAlpha(long nativeBitmap, boolean hasAlpha, boolean requestPremul) 
- 
nativeHasMipMappublic static boolean nativeHasMipMap(long nativeBitmap) 
- 
nativeSetHasMipMappublic static void nativeSetHasMipMap(long nativeBitmap, boolean hasMipMap) 
- 
nativeSameAspublic static boolean nativeSameAs(long nativeBitmap0, long nativeBitmap1) 
- 
nativePrepareToDrawpublic static void nativePrepareToDraw(long nativeBitmap) 
- 
nativeGetAllocationByteCountpublic static int nativeGetAllocationByteCount(long nativeBitmap) 
- 
nativeCopyPreserveInternalConfig
- 
nativeWrapHardwareBufferBitmap
- 
nativeGetHardwareBuffer
- 
nativeComputeColorSpace
- 
nativeSetColorSpacepublic static void nativeSetColorSpace(long nativePtr, long nativeColorSpace) 
- 
nativeIsSRGBpublic static boolean nativeIsSRGB(long nativePtr) 
- 
nativeIsSRGBLinearpublic static boolean nativeIsSRGBLinear(long nativePtr) 
- 
nativeSetImmutablepublic static void nativeSetImmutable(long nativePtr) 
- 
nativeIsImmutablepublic static boolean nativeIsImmutable(long nativePtr) 
- 
nativeIsBackedByAshmempublic static boolean nativeIsBackedByAshmem(long nativePtr) 
- 
nativeCopyColorSpacePpublic static void nativeCopyColorSpaceP(long srcBitmap, long dstBitmap) 
 
-