implement Drawable.invalidateSelf()

This commit is contained in:
Julian Winkler
2024-04-01 01:25:20 +02:00
parent ae58d2b319
commit 74bedcc93c
2 changed files with 7 additions and 0 deletions

View File

@@ -85,3 +85,7 @@ JNIEXPORT jlong JNICALL Java_android_graphics_drawable_Drawable_native_1construc
}
return _INTPTR(paintable);
}
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)));
}

View File

@@ -89,6 +89,8 @@ public class Drawable {
}
public void invalidateSelf() {
native_invalidate(paintable);
/* this shouldn't ever be needed with Gtk, but let's play it safe for now */
if (this.callback != null) {
callback.invalidateDrawable(this);
@@ -213,4 +215,5 @@ public class Drawable {
protected static native long native_paintable_from_path(String path);
protected native long native_constructor();
protected native void native_invalidate(long paintable);
}