8035756: [parfait] JNI exception pending in windows/native/sun/java2d/windows/WindowsFlags.cpp
Reviewed-by: serb, pchelko
This commit is contained in:
parent
6f8d82a5a7
commit
668a4a1ed8
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -47,12 +47,15 @@ void SetIDs(JNIEnv *env, jclass wFlagsClass)
|
||||
{
|
||||
wFlagsClassID = (jclass)env->NewGlobalRef(wFlagsClass);
|
||||
d3dEnabledID = env->GetStaticFieldID(wFlagsClass, "d3dEnabled", "Z");
|
||||
CHECK_NULL(d3dEnabledID);
|
||||
d3dSetID = env->GetStaticFieldID(wFlagsClass, "d3dSet", "Z");
|
||||
CHECK_NULL(d3dSetID);
|
||||
}
|
||||
|
||||
BOOL GetStaticBoolean(JNIEnv *env, jclass wfClass, const char *fieldName)
|
||||
{
|
||||
jfieldID fieldID = env->GetStaticFieldID(wfClass, fieldName, "Z");
|
||||
CHECK_NULL_RETURN(fieldID, FALSE);
|
||||
return env->GetStaticBooleanField(wfClass, fieldID);
|
||||
}
|
||||
|
||||
@ -60,6 +63,7 @@ jobject GetStaticObject(JNIEnv *env, jclass wfClass, const char *fieldName,
|
||||
const char *signature)
|
||||
{
|
||||
jfieldID fieldID = env->GetStaticFieldID(wfClass, fieldName, signature);
|
||||
CHECK_NULL_RETURN(fieldID, NULL);
|
||||
return env->GetStaticObjectField(wfClass, fieldID);
|
||||
}
|
||||
|
||||
@ -90,15 +94,17 @@ void GetFlagValues(JNIEnv *env, jclass wFlagsClass)
|
||||
forceD3DUsage = d3dSet;
|
||||
g_offscreenSharing = GetStaticBoolean(env, wFlagsClass,
|
||||
"offscreenSharingEnabled");
|
||||
JNU_CHECK_EXCEPTION(env);
|
||||
accelReset = GetStaticBoolean(env, wFlagsClass, "accelReset");
|
||||
JNU_CHECK_EXCEPTION(env);
|
||||
checkRegistry = GetStaticBoolean(env, wFlagsClass, "checkRegistry");
|
||||
JNU_CHECK_EXCEPTION(env);
|
||||
disableRegistry = GetStaticBoolean(env, wFlagsClass, "disableRegistry");
|
||||
jstring javaVersionString = (jstring)GetStaticObject(env, wFlagsClass,
|
||||
"javaVersion",
|
||||
"Ljava/lang/String;");
|
||||
JNU_CHECK_EXCEPTION(env);
|
||||
|
||||
setHighDPIAware =
|
||||
(IS_WINVISTA && GetStaticBoolean(env, wFlagsClass, "setHighDPIAware"));
|
||||
JNU_CHECK_EXCEPTION(env);
|
||||
|
||||
J2dTraceLn(J2D_TRACE_INFO, "WindowsFlags (native):");
|
||||
J2dTraceLn1(J2D_TRACE_INFO, " d3dEnabled = %s",
|
||||
@ -166,6 +172,7 @@ Java_sun_java2d_windows_WindowsFlags_initNativeFlags(JNIEnv *env,
|
||||
jclass wFlagsClass)
|
||||
{
|
||||
SetIDs(env, wFlagsClass);
|
||||
JNU_CHECK_EXCEPTION(env);
|
||||
GetFlagValues(env, wFlagsClass);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user