GskCanavas: draw default content when custom View calls super.onDraw()

This commit is contained in:
Julian Winkler
2024-05-25 19:58:55 +02:00
committed by Mis012
parent 6575fef58e
commit 6f02565920
9 changed files with 54 additions and 8 deletions

View File

@@ -89,3 +89,9 @@ JNIEXPORT jlong JNICALL Java_android_graphics_drawable_Drawable_native_1construc
JNIEXPORT void JNICALL Java_android_graphics_drawable_Drawable_native_1invalidate(JNIEnv *env, jobject this, jlong paintable_ptr) {
gdk_paintable_invalidate_contents(GDK_PAINTABLE(_PTR(paintable_ptr)));
}
JNIEXPORT void JNICALL Java_android_graphics_drawable_Drawable_native_1draw(JNIEnv *env, jobject this, jlong paintable_ptr, jlong snapshot_ptr, jint width, jint height) {
GdkSnapshot *snapshot = (GdkSnapshot *)_PTR(snapshot_ptr);
GdkPaintable *paintable = GDK_PAINTABLE(_PTR(paintable_ptr));
gdk_paintable_snapshot(paintable, snapshot, width, height);
}