I speeded up the Cairo graphics impl significantly by changing the way
the native pointers are managed between Java and JNI code. Until now, we
used to lookup the class+fields of the native pointers and fetched the
value from the passed in jobject. I changed this so that the pointer is
passed to the JNI code directly as long. This avoids the overly costly
lookups. The speedup is impressive, where the FillRect demo needed
~250ms for one frame, it now dropped to ~130ms.

I hope you forgive me that I omit all those methods and fine-grained
description in the ChangeLog. I changed almost all method
signatures/impl in the same way.

2006-06-10  Roman Kennke  <[EMAIL PROTECTED]>

        * gnu/java/awt/peer/gtk/CairoGraphics2D.java
        * gnu/java/awt/peer/gtk/CairoSurface.java
        * gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java
        * gnu/java/awt/peer/gtk/ComponentGraphics.java
        * gnu/java/awt/peer/gtk/GtkVolatileImage.java
        * native/jni/gtk-peer/cairographics2d.h
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c:
        Changed method signatures and calls to pass native pointers
directly
        into the JNI code, in order to avoid costly lookups on each
        JNI call.
        * include/gnu_java_awt_peer_gtk_CairoGraphics2D.h,
        * include/gnu_java_awt_peer_gtk_CairoSurface.h,
        * include/gnu_java_awt_peer_gtk_ComponentGraphics.h,
        * include/gnu_java_awt_peer_gtk_GtkVolatileImage.h:
        Regenerated

/Roman

-- 
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake

Attachment: patch.diff.gz
Description: GNU Zip compressed data

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to