diff options
author | Kenneth Russel <[email protected]> | 2005-11-09 20:25:40 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-11-09 20:25:40 +0000 |
commit | 221199afb57829adac29f3b2988453b67331a324 (patch) | |
tree | 311a07ccc2c78f2bea12b813628715b7f5d1e990 /src/classes/com/sun/opengl/impl/x11 | |
parent | dba4677caf231ac26c70518a3e82651b0e01c8f2 (diff) |
Made X11GLDrawableFactory.lockToolkit() and unlockToolkit() non-static
so they can be overridden in subclasses. Fixed build breakage from
last checkin.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@430 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/x11')
3 files changed, 14 insertions, 10 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLContext.java b/src/classes/com/sun/opengl/impl/x11/X11GLContext.java index f8d35edd4..5ae52fb1d 100644 --- a/src/classes/com/sun/opengl/impl/x11/X11GLContext.java +++ b/src/classes/com/sun/opengl/impl/x11/X11GLContext.java @@ -292,10 +292,10 @@ public abstract class X11GLContext extends GLContextImpl { // These synchronization primitives prevent the AWT from making // requests from the X server asynchronously to this code. protected void lockToolkit() { - X11GLDrawableFactory.lockToolkit(); + X11GLDrawableFactory.getX11Factory().lockToolkit(); } protected void unlockToolkit() { - X11GLDrawableFactory.unlockToolkit(); + X11GLDrawableFactory.getX11Factory().unlockToolkit(); } } diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLDrawable.java b/src/classes/com/sun/opengl/impl/x11/X11GLDrawable.java index bfa467b10..6395bbce8 100644 --- a/src/classes/com/sun/opengl/impl/x11/X11GLDrawable.java +++ b/src/classes/com/sun/opengl/impl/x11/X11GLDrawable.java @@ -163,10 +163,10 @@ public abstract class X11GLDrawable extends GLDrawableImpl { // These synchronization primitives prevent the AWT from making // requests from the X server asynchronously to this code. protected void lockToolkit() { - X11GLDrawableFactory.lockToolkit(); + X11GLDrawableFactory.getX11Factory().lockToolkit(); } protected void unlockToolkit() { - X11GLDrawableFactory.unlockToolkit(); + X11GLDrawableFactory.getX11Factory().unlockToolkit(); } } diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java index 90f5b9fe5..133431824 100644 --- a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java @@ -343,22 +343,22 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl { return res; } - public static void lockToolkit() { + public void lockToolkit() { if (!Java2D.isOGLPipelineActive() || !Java2D.isQueueFlusherThread()) { JAWT.getJAWT().Lock(); } } - public static void unlockToolkit() { + public void unlockToolkit() { if (!Java2D.isOGLPipelineActive() || !Java2D.isQueueFlusherThread()) { JAWT.getJAWT().Unlock(); } } - public void lockToolkitForJava2D() { + public void lockAWTForJava2D() { lockToolkit(); } - public void unlockToolkitForJava2D() { + public void unlockAWTForJava2D() { unlockToolkit(); } @@ -366,11 +366,11 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl { private static long staticDisplay; public static long getDisplayConnection() { if (staticDisplay == 0) { - lockToolkit(); + getX11Factory().lockToolkit(); try { staticDisplay = GLX.XOpenDisplay(null); } finally { - unlockToolkit(); + getX11Factory().unlockToolkit(); } if (staticDisplay == 0) { throw new GLException("Unable to open default display, needed for visual selection and offscreen surface handling"); @@ -414,6 +414,10 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl { return tmp[tmp_offset]; } + public static X11GLDrawableFactory getX11Factory() { + return (X11GLDrawableFactory) getFactory(); + } + private void maybeDoSingleThreadedWorkaround(Runnable action) { if (Threading.isSingleThreaded() && !Threading.isOpenGLThread()) { |