diff options
author | Kenneth Russel <[email protected]> | 2006-02-24 10:22:31 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-02-24 10:22:31 +0000 |
commit | 90e0e400f14e10cfba3aaa2d3760b95fc114ce65 (patch) | |
tree | 8cb3dbc435e545b7ac410ebc9c2e55aeac05b395 /src | |
parent | 492fe63d517b554cdf9f6ed355a71b5b18df2c97 (diff) |
Fixed Issue 191: Add new opengl.1thread=new or similar
A new recognized option -Dopengl.1thread=worker has been added to the
Threading class and is now the default. Optimization has been added to
leave the last context current on that thread so in the single-context
case context switching is avoided. Code has been added to make this
interoperate well with the manual use of the GLContext APIs.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@637 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rwxr-xr-x | src/classes/javax/media/opengl/Threading.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/classes/javax/media/opengl/Threading.java b/src/classes/javax/media/opengl/Threading.java index f8d54d95d..94de9e7d9 100755 --- a/src/classes/javax/media/opengl/Threading.java +++ b/src/classes/javax/media/opengl/Threading.java @@ -111,8 +111,10 @@ import com.sun.opengl.impl.*; <PRE> -Dopengl.1thread=false Disable single-threading of OpenGL work - -Dopengl.1thread=true Enable single-threading of OpenGL work (default) + -Dopengl.1thread=true Enable single-threading of OpenGL work (default -- on a newly-created worker thread) -Dopengl.1thread=auto Select default single-threading behavior (currently on) + -Dopengl.1thread=worker Enable single-threading of OpenGL work on newly-created worker thread (default) + -Dopengl.1thread=awt Enable single-threading of OpenGL work on AWT event dispatch thread (the default behavior in older releases) </PRE> */ @@ -120,7 +122,7 @@ public class Threading { private static boolean singleThreaded = true; private static final int AWT = 1; private static final int WORKER = 2; - private static int mode = AWT; + private static int mode = WORKER; static { AccessController.doPrivileged(new PrivilegedAction() { @@ -130,11 +132,11 @@ public class Threading { workaround = workaround.toLowerCase(); if (workaround.equals("true") || workaround.equals("auto") || - workaround.equals("awt")) { - // Nothing to do; default = singleThreaded, mode = AWT - } else if (workaround.equals("worker")) { + workaround.equals("worker")) { + // Nothing to do; default = singleThreaded, mode = WORKER + } else if (workaround.equals("awt")) { singleThreaded = true; - mode = WORKER; + mode = AWT; } else { singleThreaded = false; } |