Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8260582: Clean up MacOSFlags implementation
  • Loading branch information
aghaisas committed Jan 28, 2021
1 parent 24f0d2a commit 2a9fcc5f3430cbd9d6fdd14e64d65841bbf1ff7d
Showing 3 changed files with 3 additions and 27 deletions.
@@ -37,7 +37,7 @@
import java.util.Objects;

import sun.java2d.SunGraphicsEnvironment;
import sun.java2d.macos.MacOSFlags;
import sun.java2d.MacOSFlags;
import sun.java2d.metal.MTLGraphicsConfig;
import sun.java2d.opengl.CGLGraphicsConfig;

@@ -23,7 +23,7 @@
* questions.
*/

package sun.java2d.macos;
package sun.java2d;

import java.security.PrivilegedAction;
import sun.java2d.metal.MTLGraphicsConfig;
@@ -47,11 +47,8 @@ private enum PropertyState {ENABLED, DISABLED, UNSPECIFIED};

static {
initJavaFlags();
initNativeFlags();
}

private static native boolean initNativeFlags();

private static PropertyState getBooleanProp(String p, PropertyState defaultVal) {
String propString = System.getProperty(p);
PropertyState returnVal = defaultVal;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2019, 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
@@ -39,7 +39,6 @@

// keyboard layout
static NSString *kbdLayout;
jboolean metalEnabled = JNI_FALSE;

@interface AWTView()
@property (retain) CDropTarget *_dropTarget;
@@ -56,9 +55,6 @@ -(NSMutableString *) parseString : (id) complexString;
//#define IM_DEBUG TRUE
//#define EXTRA_DEBUG

// Uncomment this line to see Metal specific fprintfs
//#define METAL_DEBUG

static BOOL shouldUsePressAndHold() {
return YES;
}
@@ -70,7 +66,6 @@ @implementation AWTView
@synthesize cglLayer;
@synthesize mouseIsOver;


// Note: Must be called on main (AppKit) thread only
- (id) initWithRect: (NSRect) rect
platformView: (jobject) cPlatformView
@@ -1536,19 +1531,3 @@ - (void)abandonInput

return underMouse;
}

jboolean GetStaticBoolean(JNIEnv *env, jclass fClass, const char *fieldName)
{
jfieldID fieldID = (*env)->GetStaticFieldID(env, fClass, fieldName, "Z");
return (*env)->GetStaticBooleanField(env, fClass, fieldID);
}

JNIEXPORT void JNICALL
Java_sun_java2d_macos_MacOSFlags_initNativeFlags(JNIEnv *env,
jclass flagsClass)
{
metalEnabled = GetStaticBoolean(env, flagsClass, "metalEnabled");
#ifdef METAL_DEBUG
fprintf(stderr, "metalEnabled=%d\n", metalEnabled);
#endif
}

0 comments on commit 2a9fcc5

Please sign in to comment.