diff options
author | Robert Schuster <thebohemian@gmx.net> | 2008-11-25 14:12:29 +0100 |
---|---|---|
committer | Robert Schuster <thebohemian@gmx.net> | 2008-11-25 14:12:58 +0100 |
commit | 46a903ec1351e751fff49c64017fdff08a5fba83 (patch) | |
tree | 5d993558428390914b9c782db724aef69ea41d1e /packages | |
parent | a49777cf047b98b62ca8bf037009bc630f4890b0 (diff) |
classpath 0.97.2: Added gtk performance fix.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/classpath/classpath-0.97.2/gtk-fix.patch | 88 | ||||
-rw-r--r-- | packages/classpath/classpath_0.97.2.bb | 3 |
2 files changed, 90 insertions, 1 deletions
diff --git a/packages/classpath/classpath-0.97.2/gtk-fix.patch b/packages/classpath/classpath-0.97.2/gtk-fix.patch new file mode 100644 index 0000000000..94c4c1f59d --- /dev/null +++ b/packages/classpath/classpath-0.97.2/gtk-fix.patch @@ -0,0 +1,88 @@ +Index: gnu/java/awt/peer/gtk/FreetypeGlyphVector.java +=================================================================== +--- gnu/java/awt/peer/gtk/FreetypeGlyphVector.java.orig 2007-04-12 22:18:09.000000000 +0200 ++++ gnu/java/awt/peer/gtk/FreetypeGlyphVector.java 2008-11-21 16:45:33.000000000 +0100 +@@ -247,7 +247,8 @@ + /** + * 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 @@ + 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 @@ + // 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; +Index: include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h +=================================================================== +--- include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h.orig 2008-06-06 04:10:00.000000000 +0200 ++++ include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h 2008-11-21 16:45:33.000000000 +0100 +@@ -13,7 +13,7 @@ + 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); + +Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c +=================================================================== +--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c.orig 2007-04-25 16:53:03.000000000 +0200 ++++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c 2008-11-21 16:47:12.000000000 +0100 +@@ -169,15 +169,13 @@ + (*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; +- jclass cls; +- jmethodID method; +- jvalue values[2]; + PangoFcFont *font; + + font = JLONG_TO_PTR(PangoFcFont, fnt); +@@ -187,12 +185,10 @@ + + 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 diff --git a/packages/classpath/classpath_0.97.2.bb b/packages/classpath/classpath_0.97.2.bb index a6327d3710..4e146e1606 100644 --- a/packages/classpath/classpath_0.97.2.bb +++ b/packages/classpath/classpath_0.97.2.bb @@ -9,9 +9,10 @@ SRC_URI += "\ file://decimalformat.patch;patch=1 \ file://cp-byte-loophelper.patch;patch=1;pnum=0 \ file://drawpolyline.patch;patch=1;pnum=0 \ + file://gtk-fix.patch;patch=1;pnum=0 \ " -PR = "r5" +PR = "r6" DEPENDS += "gtk+ gconf libxtst" |