Skip to content

Commit d5b12c8

Browse files
author
Daniel Gredler
committedMar 28, 2025
8352890: Remove unnecessary Windows version check in FileFontStrike
Reviewed-by: serb, prr
1 parent 58ef401 commit d5b12c8

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed
 

‎src/java.desktop/share/classes/sun/font/FileFontStrike.java

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -109,19 +109,10 @@ public class FileFontStrike extends PhysicalStrike {
109109
NativeStrike[] nativeStrikes;
110110

111111
static final int MAX_IMAGE_SIZE = OutlineTextRenderer.THRESHHOLD;
112+
112113
/* Used only for communication to native layer */
113114
private int intPtSize;
114115

115-
/* Perform global initialisation needed for Windows native rasterizer */
116-
private static native boolean initNative();
117-
private static boolean isXPorLater = false;
118-
static {
119-
if (FontUtilities.isWindows && !FontUtilities.useJDKScaler &&
120-
!GraphicsEnvironment.isHeadless()) {
121-
isXPorLater = initNative();
122-
}
123-
}
124-
125116
FileFontStrike(FileFont fileFont, FontStrikeDesc desc) {
126117
super(fileFont, desc);
127118
this.fileFont = fileFont;
@@ -212,7 +203,7 @@ public class FileFontStrike extends PhysicalStrike {
212203
* except that the advance returned by GDI is always overwritten by
213204
* the JDK rasteriser supplied one (see getGlyphImageFromWindows()).
214205
*/
215-
if (FontUtilities.isWindows && isXPorLater &&
206+
if (FontUtilities.isWindows &&
216207
!FontUtilities.useJDKScaler &&
217208
!GraphicsEnvironment.isHeadless() &&
218209
!fileFont.useJavaRasterizer &&

‎src/java.desktop/windows/native/libfontmanager/lcdglyph.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -89,7 +89,7 @@
8989
#define MAX_GAMMA 220
9090
#define LCDLUTCOUNT (MAX_GAMMA-MIN_GAMMA+1)
9191

92-
static unsigned char* igLUTable[LCDLUTCOUNT];
92+
static unsigned char* igLUTable[LCDLUTCOUNT] = { 0 };
9393

9494
static unsigned char* getIGTable(int gamma) {
9595
int i, index;
@@ -122,15 +122,6 @@ static unsigned char* getIGTable(int gamma) {
122122
return igTable;
123123
}
124124

125-
126-
JNIEXPORT jboolean JNICALL
127-
Java_sun_font_FileFontStrike_initNative(JNIEnv *env, jclass unused) {
128-
129-
memset(igLUTable, 0, sizeof igLUTable);
130-
131-
return JNI_TRUE;
132-
}
133-
134125
#ifndef CLEARTYPE_QUALITY
135126
#define CLEARTYPE_QUALITY 5
136127
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.