add support for custom Java Drawables

This is made possible, by adding a second Canvas implementation which
can be used to render directly to GdkSnapshot objects

For now the only implemented method is drawBitmap(), this is already
enough to make VectorDrawableCompat functional
This commit is contained in:
Julian Winkler
2024-03-24 21:01:47 +01:00
parent 0b78cbcc55
commit ad266c7821
15 changed files with 182 additions and 30 deletions

View File

@@ -0,0 +1,21 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_GskCanvas */
#ifndef _Included_android_graphics_GskCanvas
#define _Included_android_graphics_GskCanvas
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_graphics_GskCanvas
* Method: native_drawBitmap
* Signature: (JJIIII)V
*/
JNIEXPORT void JNICALL Java_android_graphics_GskCanvas_native_1drawBitmap
(JNIEnv *, jobject, jlong, jlong, jint, jint, jint, jint);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -15,6 +15,14 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_android_graphics_drawable_Drawable_native_1paintable_1from_1path
(JNIEnv *, jclass, jstring);
/*
* Class: android_graphics_drawable_Drawable
* Method: native_constructor
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_android_graphics_drawable_Drawable_native_1constructor
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif