[cp-patches] Performance improvement for FreetypeGlyphVector.java

Mark Wielaard mark at klomp.org
Thu Nov 6 11:33:44 UTC 2008

Hi Andrew,

On Wed, 2008-11-05 at 14:17 +0000, Andrew Haley wrote:
> 2008-11-05  Andrew Haley  <aph at redhat.com>
> 	* gnu/java/awt/peer/gtk/FreetypeGlyphVector.java (getKerning):
> 	Return result in a float[], not a Point2D.
> 	(performDefaultLayout): Call getKerning with a float[].
> 	* native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
> 	(getKerning): Return result in a float[], not a Point2D.

Thanks. This seems like a good speed improvement.
One nit. The default classpath build uses -Werror to keep the native
sources as clean as possible and with this it gave:

cc1: warnings being treated as errors
gnu_java_awt_peer_gtk_FreetypeGlyphVector.c: In function 'Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getKerning':
gnu_java_awt_peer_gtk_FreetypeGlyphVector.c:181: error: unused variable 'values'
gnu_java_awt_peer_gtk_FreetypeGlyphVector.c:180: error: unused variable 'method'
gnu_java_awt_peer_gtk_FreetypeGlyphVector.c:179: error: unused variable 'cls'
make[3]: *** [gnu_java_awt_peer_gtk_FreetypeGlyphVector.lo] Error 1

And indeed, those variables are not needed anymore in this function. So
fixed as follows:

2008-11-06  Mark Wielaard  <mark at klomp.org>

    * native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
    (getKerning): Removed unused cls, method, values.



diff -u -r1.9 gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c	5 Nov 2008 14:23:36 -0000	1.9
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c	6 Nov 2008 11:30:57 -0000
@@ -176,9 +176,6 @@
   FT_Face ft_face;
   FT_Vector kern;
-  jclass cls;
-  jmethodID method;
-  jvalue values[2];
   PangoFcFont *font;
   font = JLONG_TO_PTR(PangoFcFont, fnt);

More information about the Classpath-patches mailing list