Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8269223: -Xcheck:jni WARNINGs working with fonts on Linux #4572

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -866,8 +866,11 @@ void D3DRQ_FlushBuffer(void *pParam)

if (!JNU_IsNull(env, pFlush->runnable)) {
J2dTraceLn(J2D_TRACE_VERBOSE, " executing runnable");
jboolean ignoreException;
JNU_CallMethodByName(env, &ignoreException, pFlush->runnable, "run", "()V");
jboolean hasException;
JNU_CallMethodByName(env, &hasException, pFlush->runnable, "run", "()V");
if (hasException) {
J2dTraceLn(J2D_TRACE_ERROR, " exception occurred while executing runnable");
}
}
}

@@ -26,7 +26,6 @@
* @bug 8269223
* @summary Verifies that -Xcheck:jni issues no warnings from freetypeScaler.c
* @library /test/lib
* @key headful
* @run main FreeTypeScalerJNICheck
*/
import java.awt.Font;
@@ -52,15 +51,15 @@ public static void main(String[] args) throws Exception {

public static void runTest() {
String families[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
JFrame frame = new JFrame("test");
BufferedImage bi = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = bi.createGraphics();

for (String ff : families)
{
Font font = new Font(ff, Font.PLAIN, 12);
Rectangle2D bounds = font.getStringBounds("test", g2d.getFontRenderContext());
FontMetrics metrics = frame.getFontMetrics(font);
g2d.setFont(font);
FontMetrics metrics = g2d.getFontMetrics(font);
System.out.println(bounds.getHeight() + metrics.getHeight()); // use bounds and metrics
}