diff options
59 files changed, 307 insertions, 186 deletions
diff --git a/.classpath b/.classpath index 143dde5b6..a6becb458 100644 --- a/.classpath +++ b/.classpath @@ -34,11 +34,15 @@ <classpathentry kind="src" path="src/oculusvr/classes"/> <classpathentry kind="src" path="oculusvr-sdk/jogl/src/classes"/> <classpathentry kind="src" path="src/demos"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> + <attributes> + <attribute name="module" value="true"/> + </attributes> + </classpathentry> <classpathentry combineaccessrules="false" kind="src" path="/gluegen"/> + <classpathentry combineaccessrules="false" kind="src" path="/joal"/> <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Ant"/> <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/SWT"/> - <classpathentry combineaccessrules="false" kind="src" path="/joal"/> <classpathentry kind="lib" path="/gluegen/make/lib/junit.jar" sourcepath="/gluegen/make/lib/junit-sources.jar"/> <classpathentry kind="lib" path="make/lib/plugin3/plugin3-public.jar" sourcepath="make/lib/plugin3/plugin3-public-src.zip"/> <classpathentry kind="lib" path="/gluegen/make/lib/semantic-versioning/semver.jar" sourcepath="/gluegen/make/lib/semantic-versioning/semver-src.zip"/> diff --git a/.gitignore b/.gitignore index 68ebb470a..b63ce4f99 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ temp/* **~ build*/ make/lib/external/* +*.log @@ -27,5 +27,7 @@ </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.cdt.core.ccnature</nature> + <nature>org.eclipse.cdt.core.cnature</nature> </natures> </projectDescription> diff --git a/doc/HowToBuild.html b/doc/HowToBuild.html index 7cee17178..6cf4cdc11 100644 --- a/doc/HowToBuild.html +++ b/doc/HowToBuild.html @@ -38,10 +38,10 @@ <ul> <li> <b>Java</b><br/> <ul> - <li>Build & Runtime: An <a href="http://openjdk.java.net/">OpenJDK</a> 11 compliant SDK.</li> + <li>Build & Runtime: An <a href="http://openjdk.java.net/">OpenJDK</a> 17 compliant SDK.</li> <li>Runtime: An OpenJDK 8 compliant JRE.</li> </ul> - You may find an appropriate <a href="http://openjdk.java.net/">OpenJDK</a> build @ <a href="https://adoptopenjdk.net/">AdoptOpenJDK</a>.<br/> + You may find an appropriate <a href="http://openjdk.java.net/">OpenJDK</a> build @ <a href="https://adoptium.net/temurin/releases/">Adoptium</a>.<br/> <br/> Or you may try one of the following SDK's and/or Runtimes: <ul> @@ -55,7 +55,7 @@ <li> Use your Unix distribution's version, if available, or</li> <li> <a href="http://www.kernel.org/pub/software/scm/git/">Source Code for GNU/Linux, MacOS, ..</a>, or</li> <li> Git on Windows is provided by <a href="https://cygwin.com">cygwin</a></li> - <li> Git ≥ 2.11 on MacOS is provided by Xcode ≥ 8.3.3</li> + <li> Git ≥ 2.37 provided by Xcode ≥ 14</li> </ul> </li> <li> Optional <b>NVidia Cg 2.2</b> <br/> @@ -68,7 +68,7 @@ <ul> <li> <b><a href="https://www.freebsd.org/releases/">FreeBSD</a></b> 12 or later <i>(todo: test)</i> <ul> - <li>openjdk11</li> + <li>openjdk17</li> <li>ant</li> <li>git</li> <li>awk</li> @@ -83,8 +83,8 @@ <ul> <li> <b>Debian</b> 10 or later <ul> - <li>openjdk-11-jre</li> - <li>openjdk-11-jdk</li> + <li>openjdk-17-jre</li> + <li>openjdk-17-jdk</li> <li>openjfx</li> <li>ant</li> <li>git</li> @@ -118,7 +118,7 @@ <ul> <li><b>Debian</b> 10 Buster <pre> -apt-get install openjdk-11-jre openjdk-11-jdk openjfx ant git-all p7zip-full gcc cmake libdrm-dev libgbm-dev libgles2-mesa-dev libegl1-mesa-dev libgl1-mesa-dev libglu1-mesa-dev xorg-dev libice-dev libsm-dev libx11-dev libxext-dev libxxf86vm-dev libxinerama-dev libxrandr-dev libxrender-dev libxcursor-dev libxi-dev libudev-dev libc6-dev g++ libstdc++6 libstdc++-8-dev +apt-get install openjdk-17-jre openjdk-17-jdk openjfx ant git-all p7zip-full gcc cmake libdrm-dev libgbm-dev libgles2-mesa-dev libegl1-mesa-dev libgl1-mesa-dev libglu1-mesa-dev xorg-dev libice-dev libsm-dev libx11-dev libxext-dev libxxf86vm-dev libxinerama-dev libxrandr-dev libxrender-dev libxcursor-dev libxi-dev libudev-dev libc6-dev g++ libstdc++6 libstdc++-8-dev </pre></li> </ul> Optional: Add <i>kernel</i> build utilities: @@ -131,7 +131,7 @@ apt-get install kernel-package build-essential <pre> dpkg --add-architecture i386 apt-get update -apt-get install lib32z1 lib32ncurses5 gcc-multilib lib32gcc1 lib32gomp1 lib32itm1 lib32quadmath0 libdrm2:i386 libdrm-dev:i386 libgbm1:i386 libgbm-dev:i386 libudev1:i386 libc6-i386 libc6-dev-i386 g++-multilib lib32stdc++6 openjdk-11-jre:i386 openjdk-11-jdk:i386 +apt-get install lib32z1 lib32ncurses5 gcc-multilib lib32gcc1 lib32gomp1 lib32itm1 lib32quadmath0 libdrm2:i386 libdrm-dev:i386 libgbm1:i386 libgbm-dev:i386 libudev1:i386 libc6-i386 libc6-dev-i386 g++-multilib lib32stdc++6 openjdk-17-jre:i386 openjdk-17-jdk:i386 cd /usr/lib/i386-linux-gnu/ ln -s libXrender.so.1 libXrender.so @@ -146,7 +146,7 @@ ln -s libudev.so.1 libudev.so </li> <li> <b>OpenSuSE</b> 15.0 or later <ul> - <li>java-11-openjdk</li> + <li>java-17-openjdk</li> <li>ant</li> <li>git</li> <li>gawk</li> @@ -161,7 +161,7 @@ ln -s libudev.so.1 libudev.so </li> <li> <b>CentOS 7 / Red Hat Enterprise Linux 7.6</b> or later<br/> <ul> - <li>java-11-openjdk</li> + <li>java-17-openjdk</li> <li>ant</li> <li>git</li> <li>gawk</li> @@ -202,14 +202,29 @@ ln -s libudev.so.1 libudev.so <li><a href="https://www.openindiana.org/">OpenIndiana</a> using illumus's OpenSolaris continuation <i>(todo: test)</i></li> </ul> </li> - <li> <b>MacOS and iOS</b> Intel and Arm64 + <li> <b>MacOS and iOS</b> x86_64 and aarch64 <ul> - <li>git ≥ 2.11 provided by Xcode ≥ 8.3.3</li> + <li>git ≥ 2.37 provided by Xcode ≥ 14</li> <li>awk is provided by MacOS</li> <li><a href="https://cmake.org/">CMake 3.15.2</a>, and install the <a href="https://stackoverflow.com/questions/30668601/installing-cmake-command-line-tools-on-a-mac">command line tools</a></li> - <li><a href="http://www.apple.com/macosx/">Mac OS</a> 10.13 or later (note: may not work with earlier releases) </li> - <li><a href="http://developer.apple.com/technologies/xcode.html">Xcode</a> 8.3.3 or later for gcc, etc (included in MacOS)</li> + <li><a href="http://www.apple.com/macosx/">Mac OS</a> 11 or later (note: may not work with earlier releases) </li> + <li><a href="http://developer.apple.com/technologies/xcode.html">Xcode</a> 14 or later for clang, etc (included in MacOS)</li> </ul> + Prepare fat universal OpenJDK libraries + <ul> + <li>Open a terminal in your home folder, e.g. <i>/Users/jogamp</i></li> + <li>The OpenJDK library folder of each target platform, x86_64 or aarch64, is <i>/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/lib</i></li> + <li>Transfer the x86_64 OpenJDK library folder to <i>temurin-17.jdk.amd64.lib</i><li> + <li>Transfer the aarch64 OpenJDK library folder to <i> temurin-17.jdk.arm64.lib</i></li> + <li>Run the script <i>gluegen/make/scripts/make.macosx.jdk_lipo_libs.sh</i></li> + <li>Fat universal OpenJDK libraries are produced into <i>temurin-17.jdk.fat.lib</i></li> + </ul> + Now we have to tell the <i>gluegen</i> build framework to use <i>temurin-17.jdk.fat.lib</i>, + by adding an <i>ant</i> macro in <i>$HOME/gluegen.properties</i> + <pre> + java.lib.dir.platform=/Users/jogamp/temurin-17.jdk.fat.lib + </pre> + Replace <i>jogamp</i> with your user name. </li> <li> <b>Windows</b>/x86 (32 bit) <ul> diff --git a/make/config/jogl/cg-common-CustomJavaCode.java b/make/config/jogl/cg-common-CustomJavaCode.java index cc1fefd1a..f8238d7dd 100644 --- a/make/config/jogl/cg-common-CustomJavaCode.java +++ b/make/config/jogl/cg-common-CustomJavaCode.java @@ -7,7 +7,7 @@ static { throw new RuntimeException("Couldn't instantiate CgProcAddressTable"); } - cgDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() { + cgDynamicLookupHelper = SecurityUtil.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() { public DynamicLibraryBundle run() { return new DynamicLibraryBundle(new CgDynamicLibraryBundleInfo()); } } ); diff --git a/make/config/jogl/cg-common.cfg b/make/config/jogl/cg-common.cfg index d6a5367a6..aba9a87d1 100644 --- a/make/config/jogl/cg-common.cfg +++ b/make/config/jogl/cg-common.cfg @@ -104,9 +104,9 @@ Ignore cgGetProgramOptions Import jogamp.opengl.* Import com.jogamp.common.os.DynamicLookupHelper Import com.jogamp.common.os.DynamicLibraryBundle +Import com.jogamp.common.util.SecurityUtil Import com.jogamp.opengl.cg.CgDynamicLibraryBundleInfo Import java.security.PrivilegedAction -Import java.security.AccessController # # NIODirectOnly directives for routines requiring them for semantic reasons diff --git a/make/config/jogl/glu-CustomJavaCode-gl2.java b/make/config/jogl/glu-CustomJavaCode-gl2.java index 2ade45c0e..f64a1f0bf 100644 --- a/make/config/jogl/glu-CustomJavaCode-gl2.java +++ b/make/config/jogl/glu-CustomJavaCode-gl2.java @@ -1,7 +1,7 @@ private static boolean useJavaMipmapCode = true; static { - AccessController.doPrivileged(new PrivilegedAction() { + SecurityUtil.doPrivileged(new PrivilegedAction() { public Object run() { String val = System.getProperty("jogl.glu.nojava"); if (val != null && !val.toLowerCase().equals("false")) { diff --git a/make/config/jogl/glu-CustomJavaCode-gl2es1.java b/make/config/jogl/glu-CustomJavaCode-gl2es1.java index 41a7e5b9b..b8d40e1f8 100644 --- a/make/config/jogl/glu-CustomJavaCode-gl2es1.java +++ b/make/config/jogl/glu-CustomJavaCode-gl2es1.java @@ -2,7 +2,7 @@ private static boolean useJavaMipmapCode = true; static { - AccessController.doPrivileged(new PrivilegedAction() { + SecurityUtil.doPrivileged(new PrivilegedAction() { public Object run() { String val = System.getProperty("jogl.glu.nojava"); if (val != null && !val.toLowerCase().equals("false")) { diff --git a/make/config/jogl/glu-gl2.cfg b/make/config/jogl/glu-gl2.cfg index 7c8735ff1..c38f6a6b4 100644 --- a/make/config/jogl/glu-gl2.cfg +++ b/make/config/jogl/glu-gl2.cfg @@ -38,6 +38,7 @@ ManualStaticInitCall GLUgl2 # GLU needs access to the GLUtesselatorImpl class for GLUtesselator, # to the Mipmap class for scaling and mipmap generation, # and to the nurbs.* package for the NURBS functionality +Import com.jogamp.common.util.SecurityUtil Import jogamp.opengl.glu.nurbs.* Import java.security.* Import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver diff --git a/make/config/nativewindow/jawt-CustomJavaCode.java b/make/config/nativewindow/jawt-CustomJavaCode.java index 6ea57dca2..16bce36e3 100644 --- a/make/config/nativewindow/jawt-CustomJavaCode.java +++ b/make/config/nativewindow/jawt-CustomJavaCode.java @@ -9,7 +9,7 @@ protected static boolean getJAWT(final JAWT jawt, final int jawt_version_flags) // Workaround for 4845371. // Make sure the first reference to the JNI GetDirectBufferAddress is done // from a privileged context so the VM's internal class lookups will succeed. - return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Boolean>() { public Boolean run() { jawt.setVersion(jawt_version_flags); if (JAWTFactory.JAWT_GetAWT(jawt)) { diff --git a/make/config/nativewindow/jawt-common.cfg b/make/config/nativewindow/jawt-common.cfg index 41129e630..adb6ce49b 100644 --- a/make/config/nativewindow/jawt-common.cfg +++ b/make/config/nativewindow/jawt-common.cfg @@ -25,5 +25,6 @@ import java.security.* import jogamp.nativewindow.jawt.* import com.jogamp.common.os.Platform import com.jogamp.common.util.VersionNumber +Import com.jogamp.common.util.SecurityUtil IncludeAs CustomJavaCode JAWT_DrawingSurfaceInfo jawt-DrawingSurfaceInfo-CustomJavaCode.java diff --git a/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java b/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java index 691a93a16..816974191 100644 --- a/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java +++ b/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java @@ -2,7 +2,7 @@ static final DynamicLibraryBundle dynamicLookupHelper; static { - dynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() { + dynamicLookupHelper = SecurityUtil.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() { public DynamicLibraryBundle run() { final DynamicLibraryBundle bundle = new DynamicLibraryBundle(new OVRDynamicLibraryBundleInfo()); if(null==bundle) { diff --git a/make/config/oculusvr/oculusvr.cfg b/make/config/oculusvr/oculusvr.cfg index d2d446f21..b2870e59a 100644 --- a/make/config/oculusvr/oculusvr.cfg +++ b/make/config/oculusvr/oculusvr.cfg @@ -5,7 +5,7 @@ Style AllStatic JavaClass OVR Import com.jogamp.oculusvr.* -Import java.security.AccessController +Import com.jogamp.common.util.SecurityUtil Import java.security.PrivilegedAction IncludeAs CustomJavaCode OVR oculusvr-ovr-CustomJavaCode.java diff --git a/make/scripts/make.jogl.all.ios.amd64.sh b/make/scripts/make.jogl.all.ios.amd64.sh index 9ebb655e2..8e48335fa 100755 --- a/make/scripts/make.jogl.all.ios.amd64.sh +++ b/make/scripts/make.jogl.all.ios.amd64.sh @@ -12,7 +12,7 @@ fi export SDKROOT=iphonesimulator13.2 xcrun --show-sdk-path -JAVA_HOME=`/usr/libexec/java_home -version 11` +JAVA_HOME=`/usr/libexec/java_home -version 17` PATH=$JAVA_HOME/bin:$PATH export JAVA_HOME PATH which java diff --git a/make/scripts/make.jogl.all.ios.arm64.sh b/make/scripts/make.jogl.all.ios.arm64.sh index 1edae79d8..2dbf89fd0 100755 --- a/make/scripts/make.jogl.all.ios.arm64.sh +++ b/make/scripts/make.jogl.all.ios.arm64.sh @@ -12,7 +12,7 @@ fi export SDKROOT=iphoneos13.2 xcrun --show-sdk-path -JAVA_HOME=`/usr/libexec/java_home -version 11` +JAVA_HOME=`/usr/libexec/java_home -version 17` PATH=$JAVA_HOME/bin:$PATH export JAVA_HOME PATH which java diff --git a/make/scripts/make.jogl.all.linux-x86_64.sh b/make/scripts/make.jogl.all.linux-x86_64.sh index f4f9e97cc..0b809aa18 100755 --- a/make/scripts/make.jogl.all.linux-x86_64.sh +++ b/make/scripts/make.jogl.all.linux-x86_64.sh @@ -2,6 +2,9 @@ SDIR=`dirname $0` +# export J2RE_HOME=/usr/lib/jvm/java-11-openjdk-amd64 +# export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 + if [ -e $SDIR/../../../gluegen/make/scripts/setenv-build-jogamp-x86_64.sh ] ; then . $SDIR/../../../gluegen/make/scripts/setenv-build-jogamp-x86_64.sh fi diff --git a/make/scripts/make.jogl.all.macosx.sh b/make/scripts/make.jogl.all.macosx.sh index d10652485..730be7028 100755 --- a/make/scripts/make.jogl.all.macosx.sh +++ b/make/scripts/make.jogl.all.macosx.sh @@ -4,17 +4,12 @@ if [ -e /usr/local/etc/profile.ant ] ; then . /usr/local/etc/profile.ant fi -# Force OSX SDK 10.6, if desired -# export SDKROOT=macosx10.6 - -#JAVA_HOME=`/usr/libexec/java_home` -JAVA_HOME=`/usr/libexec/java_home -version 11` -#JAVA_HOME=`/usr/libexec/java_home -version 1.8` +JAVA_HOME=`/usr/libexec/java_home -version 17` PATH=$JAVA_HOME/bin:$PATH export JAVA_HOME PATH - # -Dc.compiler.debug=true \ +# -Dc.compiler.optimise=none \ # -Djavacdebug="true" \ # -Djavacdebuglevel="source,lines,vars" \ # diff --git a/make/scripts/make.jogl.all.win32.bat b/make/scripts/make.jogl.all.win32.bat index cd885accb..87cbab76f 100755 --- a/make/scripts/make.jogl.all.win32.bat +++ b/make/scripts/make.jogl.all.win32.bat @@ -1,7 +1,7 @@ set THISDIR="C:\JogAmp"
-set J2RE_HOME=c:\jre-11.0.4+11_x32
-set JAVA_HOME=c:\jdk-11.0.4+11_x32
+set J2RE_HOME=c:\jre-17
+set JAVA_HOME=c:\jdk-17
set ANT_PATH=C:\apache-ant-1.10.5
set GIT_PATH=C:\cygwin64\bin
set SEVENZIP=C:\Program Files\7-Zip
diff --git a/make/scripts/make.jogl.all.win64.bat b/make/scripts/make.jogl.all.win64.bat index 0d40a859d..d9e404370 100755 --- a/make/scripts/make.jogl.all.win64.bat +++ b/make/scripts/make.jogl.all.win64.bat @@ -1,7 +1,7 @@ set THISDIR="C:\JOGL"
-set J2RE_HOME=c:\jre-11.0.4+11_x64
-set JAVA_HOME=c:\jdk-11.0.4+11_x64
+set J2RE_HOME=c:\jre-17
+set JAVA_HOME=c:\jdk-17
set ANT_PATH=C:\apache-ant-1.10.5
set GIT_PATH=C:\cygwin64\bin
set SEVENZIP=C:\Program Files\7-Zip
diff --git a/make/scripts/tests-osx-x64.sh b/make/scripts/tests-osx-x64.sh index 67f3aaa50..4f225b7c0 100755 --- a/make/scripts/tests-osx-x64.sh +++ b/make/scripts/tests-osx-x64.sh @@ -2,17 +2,20 @@ #export DYLD_LIBRARY_PATH=$HOME/ffmpeg-0.8_0.9/lib:$DYLD_LIBRARY_PATH #export DYLD_LIBRARY_PATH=$HOME/ffmpeg-2.2.3/lib:$DYLD_LIBRARY_PATH -export DYLD_LIBRARY_PATH=/usr/local/Cellar/ffmpeg/2.8/lib:$DYLD_LIBRARY_PATH +#export DYLD_LIBRARY_PATH=/usr/local/Cellar/ffmpeg/2.8/lib:$DYLD_LIBRARY_PATH #JAVA_HOME=`/usr/libexec/java_home` #JAVA_HOME=`/usr/libexec/java_home -version 1.8` -JAVA_HOME=`/usr/libexec/java_home -version 11` +#JAVA_HOME=`/usr/libexec/java_home -version 11` +JAVA_HOME=`/usr/libexec/java_home -version 17` PATH=$JAVA_HOME/bin:$PATH export JAVA_HOME PATH -export SWT_CLASSPATH=`pwd`/lib/swt/cocoa-macosx-x86_64/swt.jar +# export SWT_CLASSPATH=`pwd`/lib/swt/cocoa-macosx-x86_64/swt.jar spath=`dirname $0` +ulimit -c unlimited + . $spath/tests.sh $JAVA_HOME/bin/java --illegal-access=warn ../build-macosx $* diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index f503de734..eb602e6aa 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -122,7 +122,7 @@ function jrun() { #D_ARGS="-Djogl.quirks.force=NoDoubleBufferedPBuffer" #D_ARGS="-Dnativewindow.debug.GraphicsConfiguration" #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000" - D_ARGS="-Djogl.debug.Bug1398" + #D_ARGS="-Djogl.debug.Bug1398" #D_ARGS="-Djogamp.debug=all" #D_ARGS="-Dnativewindow.debug=all" @@ -495,10 +495,10 @@ function testawtswt() { #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* +testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* +#testnoawtatomics com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT $* -#testnoawtatomics com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* -#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestRedSquareES2NEWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWTAnalyzeBug455 $* @@ -948,7 +948,7 @@ function testawtswt() { # OSX Bug 1398 #testswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLShaderState02NEWT $* -testawt com.jogamp.opengl.test.junit.jogl.acore.TestBug1398Deadlock02AWT $* +#testawt com.jogamp.opengl.test.junit.jogl.acore.TestBug1398Deadlock02AWT $* # # to re-test: diff --git a/make/stub_includes/opengl/macosx-window-system.h b/make/stub_includes/opengl/macosx-window-system.h index d8147a000..b48add0a6 100644 --- a/make/stub_includes/opengl/macosx-window-system.h +++ b/make/stub_includes/opengl/macosx-window-system.h @@ -40,10 +40,10 @@ Bool clearCurrentContext(NSOpenGLContext *ctx); Bool deleteContext(NSOpenGLContext* ctx, Bool releaseOnMainThread); Bool flushBuffer(NSOpenGLContext* ctx); void setContextOpacity(NSOpenGLContext* ctx, int opacity); -void updateContext(NSOpenGLContext* ctx); +void updateContext(NSOpenGLContext* ctx, Bool onMainThread); void copyContext(NSOpenGLContext* dest, NSOpenGLContext* src, int mask); -void* updateContextRegister(NSOpenGLContext* ctx, NSView* view); +void* updateContextRegister(NSOpenGLContext* ctx, NSView* view, Bool onMainThread); Bool updateContextNeedsUpdate(void* updater); void updateContextUnregister(void* updater); diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java index a68fc6b2a..ddf5a91f6 100644 --- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java +++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java @@ -504,7 +504,7 @@ public class GLEmitter extends ProcAddressEmitter { w.println(" final String functionNameBase = "+GLNameResolver.class.getName()+".normalizeVEN(com.jogamp.gluegen.runtime.opengl.GLNameResolver.normalizeARB(functionNameUsr, true), true);"); w.println(" final String addressFieldNameBase = \"" + PROCADDRESS_VAR_PREFIX + "\" + functionNameBase;"); w.println(" final int funcNamePermNum = "+GLNameResolver.class.getName()+".getFuncNamePermutationNumber(functionNameBase);"); - w.println(" final java.lang.reflect.Field addressField = java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<java.lang.reflect.Field>() {"); + w.println(" final java.lang.reflect.Field addressField = com.jogamp.common.util.SecurityUtil.doPrivileged(new java.security.PrivilegedAction<java.lang.reflect.Field>() {"); w.println(" public final java.lang.reflect.Field run() {"); w.println(" java.lang.reflect.Field addressField = null;"); w.println(" for(int i = 0; i < funcNamePermNum; i++) {"); @@ -542,7 +542,7 @@ public class GLEmitter extends ProcAddressEmitter { w.println(" final String functionNameBase = "+GLNameResolver.class.getName()+".normalizeVEN(com.jogamp.gluegen.runtime.opengl.GLNameResolver.normalizeARB(functionNameUsr, true), true);"); w.println(" final String addressFieldNameBase = \"" + PROCADDRESS_VAR_PREFIX + "\" + functionNameBase;"); w.println(" final int funcNamePermNum = "+GLNameResolver.class.getName()+".getFuncNamePermutationNumber(functionNameBase);"); - w.println(" final java.lang.reflect.Field addressField = java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<java.lang.reflect.Field>() {"); + w.println(" final java.lang.reflect.Field addressField = com.jogamp.common.util.SecurityUtil.doPrivileged(new java.security.PrivilegedAction<java.lang.reflect.Field>() {"); w.println(" public final java.lang.reflect.Field run() {"); w.println(" java.lang.reflect.Field addressField = null;"); w.println(" for(int i = 0; i < funcNamePermNum; i++) {"); diff --git a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java index 76badcda8..5c317bd2b 100644 --- a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java +++ b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java @@ -32,13 +32,13 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.net.Uri; import com.jogamp.common.util.IOUtil; import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.cache.TempJarCache; import jogamp.graph.font.FontConstructor; @@ -141,7 +141,7 @@ public class FontFactory { final int[] streamLen = { 0 }; final File tempFile[] = { null }; - final InputStream bis = AccessController.doPrivileged(new PrivilegedAction<InputStream>() { + final InputStream bis = SecurityUtil.doPrivileged(new PrivilegedAction<InputStream>() { @Override public InputStream run() { InputStream bis = null; @@ -179,7 +179,7 @@ public class FontFactory { bis.close(); } if( null != tempFile[0] ) { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { tempFile[0].delete(); diff --git a/src/jogl/classes/com/jogamp/opengl/GLProfile.java b/src/jogl/classes/com/jogamp/opengl/GLProfile.java index 8612fc73f..d86c15772 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLProfile.java +++ b/src/jogl/classes/com/jogamp/opengl/GLProfile.java @@ -48,6 +48,7 @@ import com.jogamp.common.jvm.JNILibLoaderBase; import com.jogamp.common.os.Platform; import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionUtil; import com.jogamp.common.util.cache.TempJarCache; import com.jogamp.common.util.locks.LockFactory; @@ -62,7 +63,6 @@ import com.jogamp.nativewindow.NativeWindowFactory; import com.jogamp.opengl.fixedfunc.GLPointerFunc; import java.lang.reflect.Constructor; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.HashMap; import java.util.List; @@ -222,7 +222,7 @@ public class GLProfile { // run the whole static initialization privileged to speed up, // since this skips checking further access - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { Platform.initSingleton(); @@ -2293,7 +2293,17 @@ public class GLProfile { } else if(GL3 == profile && hasAnyGL234Impl && ( desktopCtxUndef || GLContext.isGL3Available(device, isHardwareRasterizer))) { return desktopCtxUndef ? GL3 : GLContext.getAvailableGLProfileName(device, 3, GLContext.CTX_PROFILE_CORE); } else if(GL2 == profile && hasAnyGL234Impl && ( desktopCtxUndef || GLContext.isGL2Available(device, isHardwareRasterizer))) { - return desktopCtxUndef ? GL2 : GLContext.getAvailableGLProfileName(device, 2, GLContext.CTX_PROFILE_COMPAT); + // return desktopCtxUndef ? GL2 : GLContext.getAvailableGLProfileName(device, 2, GLContext.CTX_PROFILE_COMPAT); + if( desktopCtxUndef ) { + return GL2; + } else { + final String gl2_impl = GLContext.getAvailableGLProfileName(device, 2, GLContext.CTX_PROFILE_COMPAT); + if( GL3bc == gl2_impl && !GLContext.isGL3bcAvailable(device, isHardwareRasterizer) ) { + return GL2; + } else { + return gl2_impl; + } + } } else if(GLES3 == profile && hasGLES3Impl && ( esCtxUndef || GLContext.isGLES3Available(device, isHardwareRasterizer))) { return esCtxUndef ? GLES3 : GLContext.getAvailableGLProfileName(device, 3, GLContext.CTX_PROFILE_ES); } else if(GLES2 == profile && hasGLES3Impl && ( esCtxUndef || GLContext.isGLES2Available(device, isHardwareRasterizer))) { diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java index 5e6338b5c..52b207b0c 100644 --- a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java @@ -33,16 +33,16 @@ import com.jogamp.common.os.DynamicLibraryBundle; import com.jogamp.common.os.DynamicLibraryBundleInfo; import com.jogamp.common.os.Platform; import com.jogamp.common.util.RunnableExecutor; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.cache.TempJarCache; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.*; public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { private static final List<String> glueLibNames; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { Platform.initSingleton(); diff --git a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java index 68586dfc5..36d35cde9 100644 --- a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java +++ b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java @@ -32,12 +32,12 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.opengl.GLException; import com.jogamp.common.util.IntObjectHashMap; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.graph.font.Font; import com.jogamp.graph.font.FontSet; import com.jogamp.graph.font.FontFactory; @@ -68,7 +68,7 @@ public class JavaFontLoader implements FontSet { final String javaFontPath; private JavaFontLoader() { - final String javaHome = AccessController.doPrivileged(new PrivilegedAction<String>() { + final String javaHome = SecurityUtil.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return System.getProperty("java.home"); @@ -158,7 +158,7 @@ public class JavaFontLoader implements FontSet { private Font abspathImpl(final String fname, final int family, final int style) throws IOException { final Exception[] privErr = { null }; final int[] streamLen = { 0 }; - final InputStream stream = AccessController.doPrivileged(new PrivilegedAction<InputStream>() { + final InputStream stream = SecurityUtil.doPrivileged(new PrivilegedAction<InputStream>() { @Override public InputStream run() { try { diff --git a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java index 78140df6f..71d18b17e 100644 --- a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java +++ b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java @@ -36,12 +36,12 @@ import com.jogamp.common.os.Platform; import com.jogamp.common.util.IOUtil; import com.jogamp.common.util.IntObjectHashMap; import com.jogamp.common.util.JarUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.cache.TempJarCache; import com.jogamp.graph.font.Font; import com.jogamp.graph.font.FontSet; import com.jogamp.graph.font.FontFactory; -import java.security.AccessController; import java.security.PrivilegedAction; public class UbuntuFontLoader implements FontSet { @@ -139,7 +139,7 @@ public class UbuntuFontLoader implements FontSet { if( TempJarCache.isInitialized(false) ) { try { final Uri uri = JarUtil.getRelativeOf(UbuntuFontLoader.class, jarSubDir, jarName); - final Exception e0 = AccessController.doPrivileged(new PrivilegedAction<Exception>() { + final Exception e0 = SecurityUtil.doPrivileged(new PrivilegedAction<Exception>() { @Override public Exception run() { try { @@ -173,7 +173,7 @@ public class UbuntuFontLoader implements FontSet { final InputStream stream; if( useTempJARCache ) { final Exception[] privErr = { null }; - stream = AccessController.doPrivileged(new PrivilegedAction<InputStream>() { + stream = SecurityUtil.doPrivileged(new PrivilegedAction<InputStream>() { @Override public InputStream run() { try { diff --git a/src/jogl/classes/jogamp/opengl/Debug.java b/src/jogl/classes/jogamp/opengl/Debug.java index 5273eead7..cc239fefc 100644 --- a/src/jogl/classes/jogamp/opengl/Debug.java +++ b/src/jogl/classes/jogamp/opengl/Debug.java @@ -28,10 +28,10 @@ package jogamp.opengl; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; /** Helper routines for logging and debugging. */ @@ -41,7 +41,7 @@ public class Debug extends PropertyAccess { private static final boolean debugAll; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { PropertyAccess.addTrustedPrefix("jogl."); diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 68c21b84c..d97e0e201 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -42,7 +42,6 @@ package jogamp.opengl; import java.lang.reflect.Method; import java.nio.IntBuffer; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.HashMap; import java.util.IdentityHashMap; @@ -55,6 +54,7 @@ import com.jogamp.common.os.DynamicLookupHelper; import com.jogamp.common.os.Platform; import com.jogamp.common.util.Bitfield; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionNumber; import com.jogamp.common.util.VersionNumberString; import com.jogamp.common.util.locks.RecursiveLock; @@ -86,6 +86,29 @@ import com.jogamp.opengl.GLPipelineFactory; import com.jogamp.opengl.GLProfile; public abstract class GLContextImpl extends GLContext { + + /** Selected {@link Platform.OSType#MACOS} or {@link Platform.OSType#IOS} {@link VersionNumber}s. */ + public static class MacOSVersion { + /** OSX Lion, i.e. 10.7.0 */ + public static final VersionNumber Lion; + /** OSX Mavericks, i.e. 10.9.0 */ + public static final VersionNumber Mavericks; + /** OSX Mojave, i.e. 10.14.0 */ + public static final VersionNumber Mojave; + + static { + if( Platform.getOSType() == Platform.OSType.MACOS ) { + Lion = new VersionNumber(10,7,0); + Mavericks = new VersionNumber(10,9,0); + Mojave = new VersionNumber(10,14,0); + } else { + Lion = null; + Mavericks = null; + Mojave = null; + } + } + } + /** * Context full qualified name: display_type + display_connection + major + minor + ctp. * This is the key for all cached GL ProcAddressTables, etc, to support multi display/device setups. @@ -1022,7 +1045,8 @@ public abstract class GLContextImpl extends GLContext { this.preCtxVersion = preCtxVersion; this.preCtxOptions = preCtxOptions; } - public final String toString() { + @Override + public final String toString() { return toString(new StringBuilder(), -1, -1, -1, -1).toString(); } public final StringBuilder toString(final StringBuilder sb, final int minMajor, final int minMinor, final int maxMajor, final int maxMinor) { @@ -1226,7 +1250,7 @@ public abstract class GLContextImpl extends GLContext { // ensuring proper user behavior across platforms due to different feature sets! // if( Platform.OSType.MACOS == Platform.getOSType() && - Platform.getOSVersionNumber().compareTo(Platform.OSXVersion.Mavericks) >= 0 ) { + Platform.getOSVersionNumber().compareTo(MacOSVersion.Mavericks) >= 0 ) { /** * OSX 10.9 GLRendererQuirks.GL4NeedsGL3Request, quirk is added as usual @ setRendererQuirks(..) */ @@ -1621,7 +1645,7 @@ public abstract class GLContextImpl extends GLContext { GLEmitter by looking up anew all of its function pointers using the given {@link GLDynamicLookupHelper}. */ protected final void resetProcAddressTable(final ProcAddressTable table, final GLDynamicLookupHelper dlh) { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { table.reset( dlh ); @@ -1777,7 +1801,7 @@ public abstract class GLContextImpl extends GLContext { final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice(); if( !glGetPtrInit ) { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { final GLDynamicLookupHelper glDynLookupHelper = getGLDynamicLookupHelper(reqMajor, reqCtxProfileBits); @@ -2323,7 +2347,7 @@ public abstract class GLContextImpl extends GLContext { } quirks.addQuirk( quirk ); } - if( Platform.getOSVersionNumber().compareTo(Platform.OSXVersion.Mavericks) >= 0 && 3==reqMajor && 4==hasMajor ) { + if( Platform.getOSVersionNumber().compareTo(MacOSVersion.Mavericks) >= 0 && 3==reqMajor && 4==hasMajor ) { final int quirk = GLRendererQuirks.GL4NeedsGL3Request; if(DEBUG) { System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS "+Platform.getOSType()+", OS Version "+Platform.getOSVersionNumber()+", req "+reqMajor+"."+reqMinor); @@ -2339,7 +2363,7 @@ public abstract class GLContextImpl extends GLContext { } quirks.addQuirk( quirk ); } - if( Platform.getOSVersionNumber().compareTo(Platform.OSXVersion.Lion) < 0 ) { // < OSX 10.7.0 w/ NV has unstable GLSL + if( Platform.getOSVersionNumber().compareTo(MacOSVersion.Lion) < 0 ) { // < OSX 10.7.0 w/ NV has unstable GLSL final int quirk = GLRendererQuirks.GLSLNonCompliant; if(DEBUG) { System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS "+Platform.getOSType()+", OS Version "+Platform.getOSVersionNumber()+", Renderer "+glRenderer); @@ -2665,7 +2689,7 @@ public abstract class GLContextImpl extends GLContext { throw new GLException("No GLDynamicLookupHelper for "+this); } final String tmpBase = GLNameResolver.normalizeVEN(GLNameResolver.normalizeARB(glFunctionName, true), true); - return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { boolean res = false; diff --git a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java index fb4529da4..410ad46e8 100644 --- a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java +++ b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java @@ -27,7 +27,6 @@ */ package jogamp.opengl; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; @@ -41,6 +40,7 @@ import jogamp.common.os.PlatformPropsImpl; import com.jogamp.common.ExceptionUtils; import com.jogamp.common.os.Platform; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.gluegen.runtime.ProcAddressTable; import com.jogamp.opengl.GLExtensions; @@ -114,7 +114,7 @@ public class GLDebugMessageHandler { } private final long getAddressFor(final ProcAddressTable table, final String functionName) { - return AccessController.doPrivileged(new PrivilegedAction<Long>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Long>() { @Override public Long run() { try { diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java index 8545f10bf..e65e79b63 100644 --- a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java +++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java @@ -35,7 +35,6 @@ package jogamp.opengl; import java.lang.reflect.InvocationTargetException; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.nativewindow.NativeWindowFactory; @@ -46,6 +45,7 @@ import com.jogamp.opengl.Threading.Mode; import com.jogamp.common.JogampRuntimeException; import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; /** Implementation of the {@link com.jogamp.opengl.Threading} class. */ @@ -63,7 +63,7 @@ public class ThreadingImpl { static { threadingPlugin = - AccessController.doPrivileged(new PrivilegedAction<ToolkitThreadingPlugin>() { + SecurityUtil.doPrivileged(new PrivilegedAction<ToolkitThreadingPlugin>() { @Override public ToolkitThreadingPlugin run() { final String singleThreadProp; diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2D.java b/src/jogl/classes/jogamp/opengl/awt/Java2D.java index 7f6c48ee2..8fb45a3a0 100644 --- a/src/jogl/classes/jogamp/opengl/awt/Java2D.java +++ b/src/jogl/classes/jogamp/opengl/awt/Java2D.java @@ -48,7 +48,6 @@ import java.awt.Rectangle; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.opengl.GL; @@ -58,6 +57,7 @@ import com.jogamp.opengl.GLException; import com.jogamp.opengl.GLProfile; import com.jogamp.common.os.Platform; +import com.jogamp.common.util.SecurityUtil; import jogamp.common.os.PlatformPropsImpl; import jogamp.opengl.Debug; @@ -118,7 +118,7 @@ public class Java2D { private static Method destroyOGLContextMethod; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { if (DEBUG) { diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index 38f5bb727..2c200b664 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -101,16 +101,30 @@ public class MacOSXCGLContext extends GLContextImpl boolean swapBuffers(); } - /* package */ static final boolean isTigerOrLater; - /* package */ static final boolean isLionOrLater; - /* package */ static final boolean isMavericksOrLater; + /* package */ static final boolean isLionOrLater; // >= 10.7.0 + /* package */ static final boolean isMavericksOrLater; // >= 10.9.0 + /* package */ static final boolean isMojaveOrLater; // >= 10.14.0 private static final boolean DEBUG1398; static { final VersionNumber osvn = Platform.getOSVersionNumber(); - isTigerOrLater = osvn.compareTo(Platform.OSXVersion.Tiger) >= 0; - isLionOrLater = osvn.compareTo(Platform.OSXVersion.Lion) >= 0; - isMavericksOrLater = osvn.compareTo(Platform.OSXVersion.Mavericks) >= 0; + if( osvn.compareTo(MacOSVersion.Mojave) >= 0 ) { + isLionOrLater = true; + isMavericksOrLater = true; + isMojaveOrLater = true; + } else if( osvn.compareTo(MacOSVersion.Mavericks) >= 0 ) { + isLionOrLater = true; + isMavericksOrLater = true; + isMojaveOrLater = false; + } else if( osvn.compareTo(MacOSVersion.Lion) >= 0 ) { + isLionOrLater = true; + isMavericksOrLater = false; + isMojaveOrLater = false; + } else { + isLionOrLater = false; + isMavericksOrLater = false; + isMojaveOrLater = false; + } DEBUG1398 = Debug.debug("Bug1398"); } @@ -369,16 +383,7 @@ public class MacOSXCGLContext extends GLContextImpl isIncompleteView = false; } if( !isIncompleteView ) { - if( useAppKit ) { - OSXUtil.RunOnMainThread(true, false, new Runnable() { - @Override - public void run() { - updateHandle = CGL.updateContextRegister(contextHandle, drawable.getHandle()); - } - }); - } else { - updateHandle = CGL.updateContextRegister(contextHandle, drawable.getHandle()); - } + updateHandle = CGL.updateContextRegister(contextHandle, drawable.getHandle(), false /* useAppKit .. onMain */); if(0 == updateHandle) { throw new InternalError("XXX2"); } @@ -395,7 +400,6 @@ public class MacOSXCGLContext extends GLContextImpl } } - private static boolean useAppKit = false; @Override protected void drawableUpdatedNotify() throws GLException { if( drawable.getChosenGLCapabilities().isOnscreen() ) { @@ -410,16 +414,7 @@ public class MacOSXCGLContext extends GLContextImpl if (contextHandle == 0) { throw new GLException("Context not created"); } - if( useAppKit ) { - OSXUtil.RunOnMainThread(true, false, new Runnable() { - @Override - public void run() { - CGL.updateContext(contextHandle); - } - }); - } else { - CGL.updateContext(contextHandle); - } + CGL.updateContext(contextHandle, true /* useAppKit .. onMain */); } } } @@ -1174,7 +1169,8 @@ public class MacOSXCGLContext extends GLContextImpl if( !drawableAssociated ) { lastNSViewDescr = null; lastSetNSViewCmd = null; - OSXUtil.RunOnMainThread(true /* wait */, true /* kickNSApp */, new Runnable() { + final boolean wait = !MacOSXCGLContext.isMojaveOrLater; // wait if < 10.14 + OSXUtil.RunOnMainThread(wait, true /* kickNSApp */, new Runnable() { @Override public void run() { CGL.setContextView(ctx, 0); diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java index e42cc7af9..f1049ce6e 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java @@ -28,7 +28,6 @@ package jogamp.opengl.util.av.impl; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Arrays; @@ -41,6 +40,7 @@ import com.jogamp.common.ExceptionUtils; import com.jogamp.common.os.DynamicLibraryBundle; import com.jogamp.common.os.DynamicLibraryBundleInfo; import com.jogamp.common.util.RunnableExecutor; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionNumber; /** @@ -217,7 +217,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { throw new InternalError("XXX0 "+symbolNames.length+" != "+symbolCount); } - final DynamicLibraryBundle dl = AccessController.doPrivileged(privInitSymbolsAction); + final DynamicLibraryBundle dl = SecurityUtil.doPrivileged(privInitSymbolsAction); if( null == dl ) { return false; } diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java index 74103fe31..6e44dcc37 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java @@ -30,7 +30,6 @@ package jogamp.opengl.util.av.impl; import java.io.IOException; import java.nio.ByteBuffer; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.opengl.GL; @@ -39,6 +38,7 @@ import com.jogamp.opengl.GLException; import com.jogamp.common.util.IOUtil; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionNumber; import com.jogamp.gluegen.runtime.ProcAddressTable; import com.jogamp.opengl.util.TimeFrameI; @@ -422,7 +422,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { final int audioQueueLimit; if( null != gl && STREAM_ID_NONE != getVID() ) { final GLContextImpl ctx = (GLContextImpl)gl.getContext(); - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { final ProcAddressTable pt = ctx.getGLProcAddressTable(); diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java index 652184e7e..d65027f0d 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java @@ -42,7 +42,6 @@ package jogamp.opengl.windows.wgl; import java.nio.Buffer; import java.nio.ShortBuffer; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.List; @@ -78,6 +77,7 @@ import jogamp.opengl.SharedResourceRunner; import com.jogamp.common.nio.PointerBuffer; import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.nativewindow.GenericUpstreamSurfacelessHook; import com.jogamp.nativewindow.windows.WindowsGraphicsDevice; import com.jogamp.opengl.GLExtensions; @@ -155,7 +155,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { synchronized(WindowsWGLDrawableFactory.class) { if( null == windowsWGLDynamicLookupHelper ) { - windowsWGLDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() { + windowsWGLDynamicLookupHelper = SecurityUtil.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() { @Override public DesktopGLDynamicLookupHelper run() { DesktopGLDynamicLookupHelper tmp; diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java index a03ce1641..85482679b 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java @@ -39,7 +39,6 @@ package jogamp.opengl.x11.glx; import java.nio.Buffer; import java.nio.ShortBuffer; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.List; @@ -72,6 +71,7 @@ import jogamp.opengl.SharedResourceRunner; import com.jogamp.common.ExceptionUtils; import com.jogamp.common.nio.Buffers; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionNumber; import com.jogamp.nativewindow.GenericUpstreamSurfacelessHook; import com.jogamp.nativewindow.x11.X11GraphicsDevice; @@ -96,7 +96,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { synchronized(X11GLXDrawableFactory.class) { if( null == x11GLXDynamicLookupHelper ) { - x11GLXDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() { + x11GLXDynamicLookupHelper = SecurityUtil.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() { @Override public DesktopGLDynamicLookupHelper run() { DesktopGLDynamicLookupHelper tmp; diff --git a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m index 16b85974e..78b0b1854 100644 --- a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m +++ b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m @@ -643,12 +643,17 @@ void setContextOpacity(NSOpenGLContext* ctx, int opacity) { [ctx setValues:&opacity forParameter:NSOpenGLCPSurfaceOpacity]; } -void updateContext(NSOpenGLContext* ctx) { +void updateContext(NSOpenGLContext* ctx, Bool onMainThread) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSView *nsView = [ctx view]; if(NULL != nsView) { - DBG_PRINT("updateContext.0: ctx %p, ctx.view %p\n", ctx, nsView); - [ctx update]; + Bool isMainThread = [NSThread isMainThread]; + DBG_PRINT("updateContext.0: ctx %p, ctx.view %p, onMain %d, isMain %d\n", ctx, nsView, onMainThread, isMainThread); + if(onMainThread && NO == isMainThread) { + [ctx performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO]; + } else { + [ctx update]; + } DBG_PRINT("updateContext.X\n"); } [pool release]; @@ -658,14 +663,25 @@ void copyContext(NSOpenGLContext* dest, NSOpenGLContext* src, int mask) { [dest copyAttributesFromContext: src withMask: mask]; } -void* updateContextRegister(NSOpenGLContext* ctx, NSView* view) { +void* updateContextRegister(NSOpenGLContext* ctx, NSView* view, Bool onMainThread) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - DBG_PRINT("updateContextRegister.0: ctx %p, view %p\n", ctx, view); - ContextUpdater *contextUpdater = [[ContextUpdater alloc] initWithContext: ctx view: view]; - DBG_PRINT("updateContextRegister.X: ctxupd %p\n", contextUpdater); - [pool release]; - return contextUpdater; + Bool isMainThread = [NSThread isMainThread]; + DBG_PRINT("updateContextRegister.0: ctx %p, view %p, onMain %d, isMain %d\n", ctx, view, onMainThread, isMainThread); + if(onMainThread && NO == isMainThread) { + __block ContextUpdater *contextUpdater = NULL; + dispatch_sync(dispatch_get_main_queue(), ^{ + contextUpdater = [[ContextUpdater alloc] initWithContext: ctx view: view]; + }); + DBG_PRINT("updateContextRegister.XM: ctxupd %p\n", contextUpdater); + [pool release]; + return contextUpdater; + } else { + ContextUpdater *contextUpdater = [[ContextUpdater alloc] initWithContext: ctx view: view]; + DBG_PRINT("updateContextRegister.X_: ctxupd %p\n", contextUpdater); + [pool release]; + return contextUpdater; + } } Bool updateContextNeedsUpdate(void* updater) { diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java index bedf15c7b..68ab36ed5 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java @@ -35,7 +35,6 @@ package com.jogamp.nativewindow; import java.io.File; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Collections; @@ -61,6 +60,7 @@ import com.jogamp.common.os.Platform; import com.jogamp.common.util.InterruptSource; import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.nativewindow.UpstreamWindowHookMutableSizePos; import com.jogamp.nativewindow.awt.AWTGraphicsDevice; import com.jogamp.nativewindow.awt.AWTGraphicsScreen; @@ -233,7 +233,7 @@ public abstract class NativeWindowFactory { final String[] _tmp = new String[] { null }; final String[] _nativeWindowingTypeNative = new String[] { null }; - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { Platform.initSingleton(); // last resort .. @@ -398,7 +398,7 @@ public abstract class NativeWindowFactory { if( Platform.AWT_AVAILABLE && ReflectionUtil.isClassAvailable("com.jogamp.nativewindow.awt.AWTGraphicsDevice", cl) ) { - final Method[] jawtUtilMethods = AccessController.doPrivileged(new PrivilegedAction<Method[]>() { + final Method[] jawtUtilMethods = SecurityUtil.doPrivileged(new PrivilegedAction<Method[]>() { @Override public Method[] run() { try { diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java index 8189f6262..4fe2d6cd8 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java @@ -2,11 +2,11 @@ package com.jogamp.nativewindow.awt; import java.lang.ref.WeakReference; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.ExceptionUtils; import com.jogamp.common.util.RunnableTask; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.UnsafeUtil; import jogamp.nativewindow.jawt.JAWTUtil; @@ -28,7 +28,7 @@ public class AppContextInfo { static { DEBUG = JAWTUtil.DEBUG; final Method[] _getAppContextMethod = { null }; - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { return UnsafeUtil.doWithoutIllegalAccessLogger(new PrivilegedAction<Object>() { diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java b/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java index 9d38b1f4b..61358c56a 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java @@ -28,7 +28,6 @@ package com.jogamp.nativewindow.javafx; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.nativewindow.AbstractGraphicsDevice; @@ -43,6 +42,7 @@ import com.jogamp.common.ExceptionUtils; import com.jogamp.common.util.InterruptedRuntimeException; import com.jogamp.common.util.ReflectionUtil; import com.jogamp.common.util.RunnableTask; +import com.jogamp.common.util.SecurityUtil; import com.sun.javafx.tk.TKStage; import javafx.application.Platform; @@ -69,7 +69,7 @@ public class JFXAccessor { static { final boolean[] _DEBUG = new boolean[] { true }; - final Method[] res = AccessController.doPrivileged(new PrivilegedAction<Method[]>() { + final Method[] res = SecurityUtil.doPrivileged(new PrivilegedAction<Method[]>() { @Override public Method[] run() { NativeWindowFactory.initSingleton(); // last resort .. @@ -270,6 +270,7 @@ public class JFXAccessor { public static long getWindowHandle(final Window stageWindow) throws NativeWindowException { final long h[] = { 0 }; runOnJFXThread(true, new Runnable() { + @Override public void run() { try { final TKStage tkStage = (TKStage) tkStageGetter.invoke(stageWindow); diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java index 7f4a94c5b..1ddf14b82 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java @@ -32,7 +32,6 @@ import com.jogamp.common.os.Platform; import java.io.PrintStream; import java.lang.reflect.Field; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import org.eclipse.swt.SWT; @@ -50,6 +49,7 @@ import com.jogamp.nativewindow.AbstractGraphicsDevice; import com.jogamp.nativewindow.NativeWindowFactory; import com.jogamp.nativewindow.VisualIDHolder; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionNumber; import com.jogamp.nativewindow.macosx.MacOSXGraphicsDevice; import com.jogamp.nativewindow.windows.WindowsGraphicsDevice; @@ -138,7 +138,7 @@ public class SWTAccessor { } static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { NativeWindowFactory.initSingleton(); // last resort .. diff --git a/src/nativewindow/classes/jogamp/nativewindow/BcmVCArtifacts.java b/src/nativewindow/classes/jogamp/nativewindow/BcmVCArtifacts.java index 0fc0665bc..a6be62e4e 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/BcmVCArtifacts.java +++ b/src/nativewindow/classes/jogamp/nativewindow/BcmVCArtifacts.java @@ -29,9 +29,10 @@ package jogamp.nativewindow; import java.io.File; -import java.security.AccessController; import java.security.PrivilegedAction; +import com.jogamp.common.util.SecurityUtil; + /** * Heuristics about Broadcom (BCM) VideoCore (VC) existence and usage */ @@ -48,7 +49,7 @@ public class BcmVCArtifacts { final File driCard0Location = new File( "/dev/dri/card0"); final boolean[] res = new boolean [3]; - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { res[0] = vcLibLocation.isFile(); diff --git a/src/nativewindow/classes/jogamp/nativewindow/Debug.java b/src/nativewindow/classes/jogamp/nativewindow/Debug.java index 8d8fd0667..9ccb5b3a5 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/Debug.java +++ b/src/nativewindow/classes/jogamp/nativewindow/Debug.java @@ -28,10 +28,10 @@ package jogamp.nativewindow; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; /** Helper routines for logging and debugging. */ @@ -41,7 +41,7 @@ public class Debug extends PropertyAccess { private static final boolean debugAll; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { PropertyAccess.addTrustedPrefix("nativewindow."); diff --git a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java index 1284974bf..7d530dda6 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java +++ b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java @@ -29,16 +29,16 @@ package jogamp.nativewindow; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.jvm.JNILibLoaderBase; import com.jogamp.common.os.Platform; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.cache.TempJarCache; public class NWJNILibLoader extends JNILibLoaderBase { public static boolean loadNativeWindow(final String ossuffix) { - return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { Platform.initSingleton(); diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java index fe83ebc76..04585e4ca 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java @@ -39,17 +39,17 @@ package jogamp.nativewindow.jawt; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.nativewindow.NativeWindowFactory; import jogamp.nativewindow.NWJNILibLoader; import java.awt.Toolkit; -import java.security.AccessController; import java.security.PrivilegedAction; public class JAWTJNILibLoader extends NWJNILibLoader { static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { // Make sure that awt.dll is loaded before loading jawt.dll. Otherwise diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java index f4e55cd47..a28ed8235 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java @@ -45,7 +45,6 @@ import java.awt.Toolkit; import java.awt.geom.AffineTransform; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Map; @@ -67,6 +66,7 @@ import jogamp.nativewindow.x11.X11Lib; import com.jogamp.common.ExceptionUtils; import com.jogamp.common.os.Platform; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.UnsafeUtil; import com.jogamp.common.util.VersionNumber; import com.jogamp.common.util.locks.LockFactory; @@ -80,11 +80,10 @@ public class JAWTUtil { /** OSX JAWT version option to use CALayer */ public static final int JAWT_MACOSX_USE_CALAYER = 0x80000000; - /** OSX JAWT CALayer availability on Mac OS X >= 10.6 Update 4 (recommended) */ - public static final VersionNumber JAWT_MacOSXCALayerMinVersion = new VersionNumber(10,6,4); - /** OSX JAWT CALayer required with Java >= 1.7.0 (implies OS X >= 10.7 */ - public static final VersionNumber JAWT_MacOSXCALayerRequiredForJavaVersion = Platform.Version17; + private static final int MacOS_JVM_1_7_COMPARE; + /** OSX JAWT CALayer availability on Mac OS X >= 10.6 Update 4 (recommended) */ + private static final int MacOS_10_6_4_COMPARE; // See whether we're running in headless mode private static final boolean headlessMode; @@ -125,16 +124,14 @@ public class JAWTUtil { * Returns true if this platform's JAWT implementation supports offscreen layer. */ public static boolean isOffscreenLayerSupported() { - return PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS && - PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0; + return PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS && MacOS_10_6_4_COMPARE >= 0; } /** * Returns true if this platform's JAWT implementation requires using offscreen layer. */ public static boolean isOffscreenLayerRequired() { - return PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS && - PlatformPropsImpl.JAVA_VERSION_NUMBER.compareTo(JAWT_MacOSXCALayerRequiredForJavaVersion)>=0; + return PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS && MacOS_JVM_1_7_COMPARE >= 0; } /** @@ -238,14 +235,11 @@ public class JAWTUtil { */ public static int getOSXCALayerQuirks() { int res = 0; - if( PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS && - PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0 ) { - + if( PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS && MacOS_10_6_4_COMPARE >= 0 ) { /** Knowing impl. all expose the SIZE bug */ res |= JAWT_OSX_CALAYER_QUIRK_SIZE; - final int c = PlatformPropsImpl.JAVA_VERSION_NUMBER.compareTo(PlatformPropsImpl.Version17); - if( c < 0 || c == 0 && PlatformPropsImpl.JAVA_VERSION_UPDATE < 40 ) { + if( MacOS_JVM_1_7_COMPARE < 0 || MacOS_JVM_1_7_COMPARE == 0 && PlatformPropsImpl.JAVA_VERSION_UPDATE < 40 ) { res |= JAWT_OSX_CALAYER_QUIRK_POSITION; } else { res |= JAWT_OSX_CALAYER_QUIRK_LAYOUT; @@ -269,7 +263,7 @@ public class JAWTUtil { if(isOffscreenLayerRequired()) { if(PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS) { - if(PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0) { + if(MacOS_10_6_4_COMPARE >= 0) { jawt_version_flags_offscreen |= JAWTUtil.JAWT_MACOSX_USE_CALAYER; tryOffscreenLayer = true; tryOnscreen = false; @@ -326,6 +320,14 @@ public class JAWTUtil { // Thread.dumpStack(); } + if( PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS ) { + MacOS_JVM_1_7_COMPARE = PlatformPropsImpl.JAVA_VERSION_NUMBER.compareTo(new VersionNumber(1, 7, 0)); + MacOS_10_6_4_COMPARE = PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(new VersionNumber(10,6,4)); + } else { + MacOS_JVM_1_7_COMPARE = -1; + MacOS_10_6_4_COMPARE = -1; + } + headlessMode = GraphicsEnvironment.isHeadless(); if( headlessMode ) { @@ -362,7 +364,7 @@ public class JAWTUtil { // Always enforce using sun.awt.SunToolkit's awtLock even on JVM >= Java_9, // as we have no other official means to synchronize native UI locks especially for X11 { - final SunToolkitData std = AccessController.doPrivileged(new PrivilegedAction<SunToolkitData>() { + final SunToolkitData std = SecurityUtil.doPrivileged(new PrivilegedAction<SunToolkitData>() { @Override public SunToolkitData run() { return UnsafeUtil.doWithoutIllegalAccessLogger(new PrivilegedAction<SunToolkitData>() { @@ -407,7 +409,7 @@ public class JAWTUtil { gdGetScaleFactorMID = null; gdGetCGDisplayIDMIDOnOSX = null; } else { - final GraphicsDeviceData gdd = (GraphicsDeviceData) AccessController.doPrivileged(new PrivilegedAction<Object>() { + final GraphicsDeviceData gdd = (GraphicsDeviceData) SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { final GraphicsDeviceData d = new GraphicsDeviceData(); diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java index f67cc7189..4e89709f2 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java @@ -43,7 +43,6 @@ package jogamp.nativewindow.jawt.macosx; import java.awt.Component; import java.awt.GraphicsConfiguration; import java.nio.Buffer; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.nativewindow.AbstractGraphicsConfiguration; @@ -54,6 +53,7 @@ import com.jogamp.nativewindow.MutableSurface; import com.jogamp.nativewindow.util.Point; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.nativewindow.awt.JAWTWindow; import jogamp.nativewindow.Debug; @@ -272,7 +272,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface { ret = NativeSurface.LOCK_SURFACE_CHANGED; } if (firstLock) { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { dsi = ds.GetDrawingSurfaceInfo(); diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java index 55aaf90d2..54f34375d 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java @@ -44,10 +44,10 @@ import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.ExceptionUtils; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.UnsafeUtil; import com.jogamp.nativewindow.AbstractGraphicsConfiguration; @@ -68,7 +68,7 @@ public class Win32SunJDKReflection { private static boolean initialized; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { return UnsafeUtil.doWithoutIllegalAccessLogger(new PrivilegedAction<Object>() { diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java index d86704c07..497d901f5 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java @@ -44,10 +44,10 @@ import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.lang.reflect.Method; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.ExceptionUtils; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.UnsafeUtil; import com.jogamp.nativewindow.AbstractGraphicsConfiguration; @@ -67,7 +67,7 @@ public class X11SunJDKReflection { private static boolean initialized; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { return UnsafeUtil.doWithoutIllegalAccessLogger(new PrivilegedAction<Object>() { diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java index e06a68953..10a3a602f 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java @@ -32,7 +32,6 @@ import com.jogamp.nativewindow.NativeWindowFactory; import com.jogamp.nativewindow.util.Insets; import com.jogamp.nativewindow.util.Point; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.ExceptionUtils; @@ -41,6 +40,7 @@ import com.jogamp.common.util.Function; import com.jogamp.common.util.FunctionTask; import com.jogamp.common.util.InterruptedRuntimeException; import com.jogamp.common.util.RunnableTask; +import com.jogamp.common.util.SecurityUtil; import jogamp.nativewindow.Debug; import jogamp.nativewindow.NWJNILibLoader; @@ -70,7 +70,7 @@ public class OSXUtil implements ToolkitProperties { } if( useMainThreadChecker ) { final String libMainThreadChecker = "/Applications/Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib"; - final NativeLibrary lib = AccessController.doPrivileged(new PrivilegedAction<NativeLibrary>() { + final NativeLibrary lib = SecurityUtil.doPrivileged(new PrivilegedAction<NativeLibrary>() { @Override public NativeLibrary run() { return NativeLibrary.open(libMainThreadChecker, false, false, OSXUtil.class.getClassLoader(), true); diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java index 99ce16136..61d21026a 100644 --- a/src/newt/classes/com/jogamp/newt/NewtFactory.java +++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java @@ -34,7 +34,6 @@ package com.jogamp.newt; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Arrays; @@ -48,6 +47,7 @@ import com.jogamp.nativewindow.NativeWindowFactory; import com.jogamp.common.util.IOUtil; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; import jogamp.newt.Debug; import jogamp.newt.DisplayImpl; @@ -63,7 +63,7 @@ public class NewtFactory { private static String sysPaths = "newt/data/jogamp-16x16.png newt/data/jogamp-32x32.png"; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { NativeWindowFactory.initSingleton(); // last resort .. diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index f6c7ad955..c7e1c0a45 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -34,7 +34,6 @@ package com.jogamp.newt.opengl; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.List; @@ -74,6 +73,7 @@ import jogamp.opengl.GLContextImpl; import jogamp.opengl.GLDrawableImpl; import com.jogamp.common.GlueGenVersion; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionUtil; import com.jogamp.common.util.locks.RecursiveLock; import com.jogamp.newt.MonitorDevice; @@ -739,7 +739,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind if( animThread == Thread.currentThread() ) { anim.stop(); // on anim thread, non-blocking } else { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { if( anim.isAnimating() && null != animThread ) { diff --git a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java index c30576ff4..055e38020 100644 --- a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java +++ b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java @@ -28,7 +28,6 @@ package com.jogamp.newt.util.applet; import java.lang.reflect.Field; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.nativewindow.NativeWindow; @@ -43,6 +42,7 @@ import com.jogamp.opengl.GLPipelineFactory; import jogamp.newt.Debug; import com.jogamp.common.util.InterruptSource; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.newt.Window; import com.jogamp.newt.event.KeyEvent; import com.jogamp.newt.event.KeyListener; @@ -119,7 +119,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener { Object instance = null; try { - final Class<?> clazz = AccessController.doPrivileged(new PrivilegedAction<Class<?>>() { + final Class<?> clazz = SecurityUtil.doPrivileged(new PrivilegedAction<Class<?>>() { @Override public Class<?> run() { final ClassLoader cl = Thread.currentThread().getContextClassLoader(); @@ -312,7 +312,8 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener { if(e.getKeyChar()=='r' && 0==e.getModifiers() && null!=parentWin) { e.setConsumed(true); glWindow.invokeOnNewThread(null, false, new Runnable() { - public void run() { + @Override + public void run() { if(null == glWindow.getParent()) { glWindow.reparentWindow(parentWin, -1, -1, 0 /* hints */); } else { diff --git a/src/newt/classes/jogamp/newt/Debug.java b/src/newt/classes/jogamp/newt/Debug.java index a255cb755..60b259214 100644 --- a/src/newt/classes/jogamp/newt/Debug.java +++ b/src/newt/classes/jogamp/newt/Debug.java @@ -28,10 +28,10 @@ package jogamp.newt; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.util.PropertyAccess; +import com.jogamp.common.util.SecurityUtil; /** Helper routines for logging and debugging. */ @@ -41,7 +41,7 @@ public class Debug extends PropertyAccess { private static final boolean debugAll; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { PropertyAccess.addTrustedPrefix("newt."); diff --git a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java index fde3de222..e2bf86002 100644 --- a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java +++ b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java @@ -39,11 +39,11 @@ package jogamp.newt; -import java.security.AccessController; import java.security.PrivilegedAction; import com.jogamp.common.jvm.JNILibLoaderBase; import com.jogamp.common.os.Platform; +import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.cache.TempJarCache; public class NEWTJNILibLoader extends JNILibLoaderBase { @@ -52,7 +52,7 @@ public class NEWTJNILibLoader extends JNILibLoaderBase { * i.e. X11 for Unix, GDI for Windows .. and so forth. */ public static boolean loadNEWTHead() { - return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { Platform.initSingleton(); @@ -68,7 +68,7 @@ public class NEWTJNILibLoader extends JNILibLoaderBase { * Loads the NEWT native library for the drm/gbm display. */ public static boolean loadNEWTDrmGbm() { - return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + return SecurityUtil.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { Platform.initSingleton(); diff --git a/src/newt/native/MacNewtNSWindow.m b/src/newt/native/MacNewtNSWindow.m index eef3278b9..6ae36af9c 100644 --- a/src/newt/native/MacNewtNSWindow.m +++ b/src/newt/native/MacNewtNSWindow.m @@ -110,6 +110,12 @@ static jint mods2JavaMods(NSUInteger mods) return javaMods; } +#if 0 + +// +// Disabled due to crash on MacOS >= 13, see CKCH_CreateDictionaries() below +// + static CFStringRef CKCH_CreateStringForKey(CGKeyCode keyCode, const UCKeyboardLayout *keyboardLayout) { UInt32 keysDown = 0; UniChar chars[4]; @@ -123,12 +129,14 @@ static CFStringRef CKCH_CreateStringForKey(CGKeyCode keyCode, const UCKeyboardLa return CFStringCreateWithCharacters(kCFAllocatorDefault, chars, 1); } -static CFMutableDictionaryRef CKCH_CreateCodeToCharDict(TISInputSourceRef keyboard) { - CFDataRef layoutData = (CFDataRef) TISGetInputSourceProperty(keyboard, kTISPropertyUnicodeKeyLayoutData); +static CFMutableDictionaryRef CKCH_CreateCodeToCharDict(CFDataRef layoutData) { if( NULL == layoutData ) { return NULL; } const UCKeyboardLayout *keyboardLayout = (const UCKeyboardLayout *)CFDataGetBytePtr(layoutData); + if( NULL == keyboardLayout ) { + return NULL; + } CFMutableDictionaryRef codeToCharDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 128, NULL, NULL); if ( NULL != codeToCharDict ) { @@ -152,10 +160,41 @@ static CFMutableDictionaryRef CKCH_CreateCodeToCharDict(TISInputSourceRef keyboa static CFMutableDictionaryRef CKCH_USCodeToNNChar = NULL; static void CKCH_CreateDictionaries() { - TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource(); - if( NULL != currentKeyboard ) { - CKCH_USCodeToNNChar = CKCH_CreateCodeToCharDict(currentKeyboard); - CFRelease(currentKeyboard); + bool done = false; + TISInputSourceRef inputSource; + inputSource = TISCopyCurrentKeyboardInputSource(); + if( NULL != inputSource ) { + /** + * Crash on MacOS >= 13 + * + * thread #3, stop reason = ESR_EC_BRK_AARCH64 (fault address: 0x1f287d300) + * frame #0: 0x0000000196e7c924 libdispatch.dylib`_dispatch_assert_queue_fail + 120 + * frame #1: 0x0000000196e7c8ac libdispatch.dylib`dispatch_assert_queue + 196 + * frame #2: 0x00000001a07b66a4 HIToolbox`islGetInputSourceListWithAdditions + 160 + * frame #3: 0x00000001a07b8ccc HIToolbox`isValidateInputSourceRef + 92 + * frame #4: 0x00000001a07b8b8c HIToolbox`TSMGetInputSourceProperty + 44 + * frame #5: 0x000000012c961890 libnewt_head.dylib`CKCH_CreateDictionaries at MacNewtNSWindow.m:166:48 + * frame #6: 0x000000012c95f68c libnewt_head.dylib`+[NewtNSWindow initNatives:forClass:](self=0x000000012c96d600, _cmd="initNatives:forClass:", env=0x000000014b80e2a8 + */ + CFDataRef layoutData = (CFDataRef) TISGetInputSourceProperty(inputSource, kTISPropertyUnicodeKeyLayoutData); + if( NULL != layoutData ) { + CKCH_USCodeToNNChar = CKCH_CreateCodeToCharDict(layoutData); + done = true; + } + CFRelease(inputSource); + } + if( !done ) { + // TISGetInputSourceProperty returns null with Japanese keyboard layout. + // Using TISCopyCurrentKeyboardLayoutInputSource to fix NULL return. + inputSource = TISCopyCurrentKeyboardLayoutInputSource(); + if( NULL != inputSource ) { + CFDataRef layoutData = (CFDataRef) TISGetInputSourceProperty(inputSource, kTISPropertyUnicodeKeyLayoutData); + if( NULL != layoutData ) { + CKCH_USCodeToNNChar = CKCH_CreateCodeToCharDict(layoutData); + done = true; + } + CFRelease(inputSource); + } } } @@ -174,6 +213,8 @@ static UniChar CKCH_CharForKeyCode(jshort keyCode) { return rChar; } +#endif + static jmethodID enqueueMouseEventID = NULL; static jmethodID enqueueKeyEventID = NULL; static jmethodID requestFocusID = NULL; @@ -761,7 +802,9 @@ static jmethodID windowRepaintID = NULL; for (i = 0; i < len; i++) { // Note: the key code in the NSEvent does not map to anything we can use UniChar keyChar = (UniChar) [chars characterAtIndex: i]; - UniChar keySymChar = CKCH_CharForKeyCode(keyCode); + // Disabled due to crash on MacOS >= 13, see CKCH_CreateDictionaries() below + // UniChar keySymChar = CKCH_CharForKeyCode(keyCode); + UniChar keySymChar = 0; DBG_PRINT("sendKeyEvent: %d/%d code 0x%X, char 0x%X, mods 0x%X/0x%X -> keySymChar 0x%X\n", i, len, (int)keyCode, (int)keyChar, (int)mods, (int)javaMods, (int)keySymChar); @@ -848,7 +891,9 @@ NS_ENDHANDLER insetsChangedID && sizeScreenPosInsetsChangedID && screenPositionChangedID && focusChangedID && windowDestroyNotifyID && requestFocusID && windowRepaintID) { - CKCH_CreateDictionaries(); + // + // Disabled due to crash on MacOS >= 13, see CKCH_CreateDictionaries() below + // CKCH_CreateDictionaries(); return YES; } return NO; diff --git a/src/oculusvr/classes/com/jogamp/oculusvr/OVRDynamicLibraryBundleInfo.java b/src/oculusvr/classes/com/jogamp/oculusvr/OVRDynamicLibraryBundleInfo.java index 4b5145ded..6e25c83bb 100644 --- a/src/oculusvr/classes/com/jogamp/oculusvr/OVRDynamicLibraryBundleInfo.java +++ b/src/oculusvr/classes/com/jogamp/oculusvr/OVRDynamicLibraryBundleInfo.java @@ -34,15 +34,15 @@ import com.jogamp.common.os.DynamicLibraryBundleInfo; import com.jogamp.common.os.Platform; import com.jogamp.common.util.RunnableExecutor; import com.jogamp.common.util.cache.TempJarCache; +import com.jogamp.common.util.SecurityUtil; -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.*; /* pp */ final class OVRDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { private static final List<String> glueLibNames; static { - AccessController.doPrivileged(new PrivilegedAction<Object>() { + SecurityUtil.doPrivileged(new PrivilegedAction<Object>() { public Object run() { Platform.initSingleton(); |