implement drawing into Bitmaps with Canvas, make BitmapDrawable use use paintable, misc Bitmap improvements

This commit is contained in:
Mis012
2024-03-16 15:00:22 +01:00
parent fa1aa36f6b
commit 2e864adc0f
10 changed files with 201 additions and 85 deletions

View File

@@ -11,6 +11,22 @@ extern "C" {
#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
@@ -29,19 +45,19 @@ JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1copy
/*
* Class: android_graphics_Bitmap
* Method: getWidth
* Signature: ()I
* Method: native_subpixbuf
* Signature: (JIIII)J
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getWidth
(JNIEnv *, jobject);
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1subpixbuf
(JNIEnv *, jclass, jlong, jint, jint, jint, jint);
/*
* Class: android_graphics_Bitmap
* Method: getHeight
* Signature: ()I
* Method: native_create
* Signature: (II)J
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getHeight
(JNIEnv *, jobject);
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1create
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Bitmap

View File

@@ -7,6 +7,14 @@
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_graphics_Canvas
* Method: native_canvas_from_bitmap
* Signature: (J)J
*/
JNIEXPORT jlong JNICALL Java_android_graphics_Canvas_native_1canvas_1from_1bitmap
(JNIEnv *, jclass, jlong);
/*
* Class: android_graphics_Canvas
* Method: native_save
@@ -50,10 +58,10 @@ JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1drawLine
/*
* Class: android_graphics_Canvas
* Method: native_drawBitmap
* Signature: (JJJFFFFFFJ)V
* Signature: (JJJFFFFFFFFJ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1drawBitmap
(JNIEnv *, jclass, jlong, jlong, jlong, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jlong);
(JNIEnv *, jclass, jlong, jlong, jlong, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jlong);
/*
* Class: android_graphics_Canvas

View File

@@ -0,0 +1,21 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_drawable_BitmapDrawable */
#ifndef _Included_android_graphics_drawable_BitmapDrawable
#define _Included_android_graphics_drawable_BitmapDrawable
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_graphics_drawable_BitmapDrawable
* Method: native_paintable_from_pixbuf
* Signature: (J)J
*/
JNIEXPORT jlong JNICALL Java_android_graphics_drawable_BitmapDrawable_native_1paintable_1from_1pixbuf
(JNIEnv *, jclass, jlong);
#ifdef __cplusplus
}
#endif
#endif