changeset 11951:13b1ca669311

8078654: CloseTTFontFileFunc callback should be removed Reviewed-by: prr, martin
author adinn
date Wed, 29 Apr 2015 16:02:57 -0700
parents 90e539af6a64
children c7233c2411a3
files src/java.desktop/share/native/libfontmanager/freetypeScaler.c
diffstat 1 files changed, 1 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c	Wed Apr 29 12:57:24 2015 -0700
+++ b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c	Wed Apr 29 16:02:57 2015 -0700
@@ -147,20 +147,6 @@
 
 #define FILEDATACACHESIZE 1024
 
-/* NB: is it ever called? */
-static void CloseTTFontFileFunc(FT_Stream stream) {
-    FTScalerInfo *scalerInfo = (FTScalerInfo *) stream->pathname.pointer;
-    JNIEnv* env = scalerInfo->env;
-    jclass tmpClass = (*env)->FindClass(env, "sun/font/TrueTypeFont");
-    jfieldID platNameField =
-         (*env)->GetFieldID(env, tmpClass, "platName", "Ljava/lang/String;");
-    jstring platName = (*env)->GetObjectField(env,
-                                              scalerInfo->font2D,
-                                              platNameField);
-    const char *name = JNU_GetStringPlatformChars(env, platName, NULL);
-    JNU_ReleaseStringPlatformChars(env, platName, name);
-}
-
 static unsigned long ReadTTFontFileFunc(FT_Stream stream,
                                         unsigned long offset,
                                         unsigned char* destBuffer,
@@ -305,7 +291,7 @@
                     ftstream->size = filesize;
                     ftstream->pos = 0;
                     ftstream->read = (FT_Stream_IoFunc) ReadTTFontFileFunc;
-                    ftstream->close = (FT_Stream_CloseFunc) CloseTTFontFileFunc;
+                    ftstream->close = NULL;
                     ftstream->pathname.pointer = (void *) scalerInfo;
 
                     memset(&ft_open_args, 0, sizeof(FT_Open_Args));