implement some Canvas methods needed for composeUI

This commit is contained in:
Julian Winkler
2024-11-30 17:58:31 +01:00
committed by Mis012
parent cb7805bb45
commit d0952101a6
17 changed files with 143 additions and 18 deletions

View File

@@ -54,3 +54,12 @@ JNIEXPORT void JNICALL Java_android_view_ViewGroup_native_1drawChildren(JNIEnv *
GdkSnapshot *snapshot = GDK_SNAPSHOT(_PTR(snapshot_ptr));
gtk_widget_snapshot_child(&wrapper->parent_instance, wrapper->child, snapshot);
}
JNIEXPORT void JNICALL Java_android_view_ViewGroup_native_1drawChild(JNIEnv *env, jobject this, jlong widget_ptr, jlong child_ptr, jlong snapshot_ptr)
{
GtkWidget *widget = GTK_WIDGET(_PTR(widget_ptr));
GtkWidget *child = gtk_widget_get_parent(GTK_WIDGET(_PTR(child_ptr)));
GdkSnapshot *snapshot = GDK_SNAPSHOT(_PTR(snapshot_ptr));
gtk_widget_queue_draw(child); // FIXME: why didn't compose UI invalidate the child?
gtk_widget_snapshot_child(widget, child, snapshot);
}