Print this page
Added gradle and cmake project

@@ -35,10 +35,12 @@
 #import "ThreadUtilities.h"
 
 #import <Carbon/Carbon.h>
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 
+jboolean metalEnabled = JNI_FALSE;
+
 @interface AWTView()
 @property (retain) CDropTarget *_dropTarget;
 @property (retain) CDragSource *_dragSource;
 
 -(void) deliverResize: (NSRect) rect;

@@ -50,10 +52,12 @@
 
 // Uncomment this line to see fprintfs of each InputMethod API being called on this View
 //#define IM_DEBUG TRUE
 //#define EXTRA_DEBUG
 
+#define METAL_DEBUG
+
 static BOOL shouldUsePressAndHold() {
     static int shouldUsePressAndHold = -1;
     if (shouldUsePressAndHold != -1) return shouldUsePressAndHold;
     shouldUsePressAndHold = !isSnowLeopardOrLower();
     return shouldUsePressAndHold;

@@ -1496,5 +1500,21 @@
 
     JNF_COCOA_EXIT(env);
 
     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
+}