aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2008-11-05 14:19:06 +0000
committerAndrew Haley <aph@gcc.gnu.org>2008-11-05 14:19:06 +0000
commit57d891b40a8e827735b555d6c178ba7e1e409554 (patch)
treeeb0bac86065f33d2904121ba06374dc762ee7752 /libjava/classpath
parentf158188388fb801ce7c328daf1eecd693e27e5e8 (diff)
downloadgcc-57d891b40a8e827735b555d6c178ba7e1e409554.zip
gcc-57d891b40a8e827735b555d6c178ba7e1e409554.tar.gz
gcc-57d891b40a8e827735b555d6c178ba7e1e409554.tar.bz2
FreetypeGlyphVector.java (getKerning): Return result in a float[], not a Point2D.
2008-11-05 Andrew Haley <aph@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. From-SVN: r141610
Diffstat (limited to 'libjava/classpath')
-rw-r--r--libjava/classpath/ChangeLog8
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java10
-rw-r--r--libjava/classpath/include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h2
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/FreetypeGlyphVector.classbin10110 -> 10101 bytes
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c15
5 files changed, 22 insertions, 13 deletions
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog
index 8f56d5b..7886326 100644
--- a/libjava/classpath/ChangeLog
+++ b/libjava/classpath/ChangeLog
@@ -1,5 +1,13 @@
2008-11-05 Andrew Haley <aph@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.
+
+2008-11-05 Andrew Haley <aph@redhat.com>
+
* tools/Makefile.am (UPDATE_TOOLS_ZIP, CREATE_TOOLS_ZIP): Exclude
.svn directories.
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java b/libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
index 8d6d01a..af975f3 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
@@ -247,7 +247,8 @@ public class FreetypeGlyphVector extends GlyphVector
/**
* Returns the kerning of a glyph pair
*/
- private native Point2D getKerning(int leftGlyph, int rightGlyph, long font);
+ private native void getKerning(int leftGlyph, int rightGlyph, long font,
+ float[] p);
private native double[] getMetricsNative(int glyphCode, long font);
@@ -301,6 +302,7 @@ public class FreetypeGlyphVector extends GlyphVector
GlyphMetrics gm = null;
float x = 0;
float y = 0;
+ float[] p = {0.0f, 0.0f};
for(int i = 0; i < nGlyphs; i++)
{
gm = getGlyphMetrics( i );
@@ -314,9 +316,9 @@ public class FreetypeGlyphVector extends GlyphVector
// using the same font
if (i != nGlyphs-1 && fontSet[i] == fontSet[i+1])
{
- Point2D p = getKerning(glyphCodes[i], glyphCodes[i + 1], fontSet[i]);
- x += p.getX();
- y += p.getY();
+ getKerning(glyphCodes[i], glyphCodes[i + 1], fontSet[i], p);
+ x += p[0];
+ y += p[1];
}
}
glyphPositions[nGlyphs * 2] = x;
diff --git a/libjava/classpath/include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h b/libjava/classpath/include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h
index ac3cda3..cb424f4 100644
--- a/libjava/classpath/include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h
+++ b/libjava/classpath/include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h
@@ -13,7 +13,7 @@ extern "C"
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_dispose (JNIEnv *env, jobject, jlongArray);
JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getNativeFontPointer (JNIEnv *env, jobject, jint);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphs (JNIEnv *env, jobject, jintArray, jintArray, jlongArray);
-JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getKerning (JNIEnv *env, jobject, jint, jint, jlong);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getKerning (JNIEnv *env, jobject, jint, jint, jlong, jfloatArray);
JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getMetricsNative (JNIEnv *env, jobject, jint, jlong);
JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphOutlineNative (JNIEnv *env, jobject, jint, jlong);
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/FreetypeGlyphVector.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/FreetypeGlyphVector.class
index e1b6463..3ca9642 100644
--- a/libjava/classpath/lib/gnu/java/awt/peer/gtk/FreetypeGlyphVector.class
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/FreetypeGlyphVector.class
Binary files differ
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
index cea06f5..951b745 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
@@ -169,9 +169,10 @@ Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphs
(*env)->ReleaseLongArrayElements (env, fonts, fontArray, 0);
}
-JNIEXPORT jobject JNICALL
+JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getKerning
-(JNIEnv *env, jobject obj __attribute__((unused)), jint rightGlyph, jint leftGlyph, jlong fnt)
+ (JNIEnv *env, jobject obj __attribute__((unused)), jint rightGlyph,
+ jint leftGlyph, jlong fnt, jfloatArray p)
{
FT_Face ft_face;
FT_Vector kern;
@@ -187,12 +188,10 @@ Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getKerning
pango_fc_font_unlock_face( font );
- values[0].d = (jdouble)kern.x/64.0;
- values[1].d = (jdouble)kern.y/64.0;
-
- cls = (*env)->FindClass (env, "java/awt/geom/Point2D$Double");
- method = (*env)->GetMethodID (env, cls, "<init>", "(DD)V");
- return (*env)->NewObjectA(env, cls, method, values);
+ jfloat *pelements = (*env)->GetPrimitiveArrayCritical(env, p, NULL);
+ pelements[0] = (jfloat)kern.x/64.0;
+ pelements[1] = (jfloat)kern.y/64.0;
+ (*env)->ReleasePrimitiveArrayCritical (env, p, pelements, 0);
}
JNIEXPORT jdoubleArray JNICALL