reimplement Bitmap and Path using GdkTexture and GskPath

This allows us to use GskCanvas for Bitmap rendering

This increases the required GTK version to >= 4.14.
This commit is contained in:
Julian Winkler
2024-12-19 20:20:40 +01:00
parent c076c1e545
commit cd2c69cf73
26 changed files with 498 additions and 3559 deletions

View File

@@ -7,241 +7,53 @@
#ifdef __cplusplus
extern "C" {
#endif
#undef android_graphics_Bitmap_DENSITY_NONE
#define android_graphics_Bitmap_DENSITY_NONE 0L
#undef android_graphics_Bitmap_WORKING_COMPRESS_STORAGE
#define android_graphics_Bitmap_WORKING_COMPRESS_STORAGE 4096L
/*
* Class: android_graphics_Bitmap
* Method: getWidth
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getWidth
(JNIEnv *, jobject);
/*
* Class: android_graphics_Bitmap
* Method: getHeight
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getHeight
(JNIEnv *, jobject);
/*
* Class: android_graphics_Bitmap
* Method: native_bitmap_from_path
* Signature: (Ljava/lang/CharSequence;)J
*/
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1bitmap_1from_1path
(JNIEnv *, jobject, jobject);
/*
* Class: android_graphics_Bitmap
* Method: native_copy
* Method: native_create_snapshot
* Signature: (J)J
*/
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1copy
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1create_1snapshot
(JNIEnv *, jclass, jlong);
/*
* Class: android_graphics_Bitmap
* Method: native_subpixbuf
* Signature: (JIIII)J
* Method: native_create_texture
* Signature: (JII)J
*/
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1subpixbuf
(JNIEnv *, jclass, jlong, jint, jint, jint, jint);
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1create_1texture
(JNIEnv *, jclass, jlong, jint, jint);
/*
* Class: android_graphics_Bitmap
* Method: native_create
* Signature: (II)J
*/
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1create
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Bitmap
* Method: native_paintable_from_pixbuf
* Signature: (J)J
*/
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1paintable_1from_1pixbuf
(JNIEnv *, jclass, jlong);
/*
* Class: android_graphics_Bitmap
* Method: native_unref_texture
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_native_1unref_1texture
(JNIEnv *, jclass, jlong);
/*
* Class: android_graphics_Bitmap
* Method: nativeCopy
* Signature: (IIZ)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_Bitmap_nativeCopy
(JNIEnv *, jclass, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeDestructor
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeDestructor
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeRecycle
* Signature: (JJ)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeRecycle
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: android_graphics_Bitmap
* Method: nativeReconfigure
* Signature: (IIIII)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeReconfigure
(JNIEnv *, jclass, jint, jint, jint, jint, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeCompress
* Signature: (IIILjava/io/OutputStream;[B)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeCompress
(JNIEnv *, jclass, jint, jint, jint, jobject, jbyteArray);
/*
* Class: android_graphics_Bitmap
* Method: nativeErase
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeErase
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeRowBytes
* Method: native_get_width
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeRowBytes
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_native_1get_1width
(JNIEnv *, jclass, jlong);
/*
* Class: android_graphics_Bitmap
* Method: nativeConfig
* Signature: (I)I
* Method: native_get_height
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeConfig
(JNIEnv *, jclass, jint);
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_native_1get_1height
(JNIEnv *, jclass, jlong);
/*
* Class: android_graphics_Bitmap
* Method: nativeGetPixel
* Signature: (IIIZ)I
* Method: native_erase_color
* Signature: (III)J
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeGetPixel
(JNIEnv *, jclass, jint, jint, jint, jboolean);
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1erase_1color
(JNIEnv *, jclass, jint, jint, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeGetPixels
* Signature: (J[IIIIIIIZ)V
* Method: native_recycle
* Signature: (JJ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeGetPixels
(JNIEnv *, jclass, jlong, jintArray, jint, jint, jint, jint, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetPixel
* Signature: (IIIIZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetPixel
(JNIEnv *, jclass, jint, jint, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetPixels
* Signature: (I[IIIIIIIZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetPixels
(JNIEnv *, jclass, jint, jintArray, jint, jint, jint, jint, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeCopyPixelsToBuffer
* Signature: (JLjava/nio/Buffer;)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeCopyPixelsToBuffer
(JNIEnv *, jclass, jlong, jobject);
/*
* Class: android_graphics_Bitmap
* Method: nativeCopyPixelsFromBuffer
* Signature: (JLjava/nio/Buffer;)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeCopyPixelsFromBuffer
(JNIEnv *, jclass, jlong, jobject);
/*
* Class: android_graphics_Bitmap
* Method: nativeGenerationId
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeGenerationId
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeExtractAlpha
* Signature: (II[I)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_Bitmap_nativeExtractAlpha
(JNIEnv *, jclass, jint, jint, jintArray);
/*
* Class: android_graphics_Bitmap
* Method: nativePrepareToDraw
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativePrepareToDraw
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetAlphaAndPremultiplied
* Signature: (IZZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetAlphaAndPremultiplied
(JNIEnv *, jclass, jint, jboolean, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeHasMipMap
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeHasMipMap
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetHasMipMap
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetHasMipMap
(JNIEnv *, jclass, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeSameAs
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeSameAs
(JNIEnv *, jclass, jint, jint);
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_native_1recycle
(JNIEnv *, jclass, jlong, jlong);
#ifdef __cplusplus
}