Bitmap: implement pixel buffer access

For GPU textures, the GdkTextureDownloader will take care of format
conversions, so the application never sees the actual format.

If the application calls AndroidBitmap_unlockPixels(), the texture is
converted into a GdkMemoryTexture and can be accessed zero copy.
This commit is contained in:
Julian Winkler
2024-12-22 10:20:50 +01:00
parent 7695aadf91
commit 260821d68c
4 changed files with 130 additions and 21 deletions

View File

@@ -71,6 +71,14 @@ JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1ref_1texture
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_native_1get_1pixels
(JNIEnv *, jclass, jlong, jintArray, jint, jint, jint, jint, jint, jint);
/*
* Class: android_graphics_Bitmap
* Method: native_copy_to_buffer
* Signature: (JLjava/nio/Buffer;II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_native_1copy_1to_1buffer
(JNIEnv *, jclass, jlong, jobject, jint, jint);
#ifdef __cplusplus
}
#endif