diff options
Diffstat (limited to 'src/classes/com/sun/opengl/impl/x11/glx')
7 files changed, 8 insertions, 24 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java index bbb33bd42..9b1ef65da 100755 --- a/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java @@ -109,9 +109,6 @@ public class X11ExternalGLXDrawable extends X11GLXDrawable { throw new GLException("Should not call this"); } - public void destroy() { - } - class Context extends X11GLXContext { Context(X11GLXDrawable drawable, GLContext shareWith) { super(drawable, shareWith); diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java index 457240503..5312e29c9 100644 --- a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java @@ -325,7 +325,7 @@ public abstract class X11GLXContext extends GLContextImpl { public boolean isOptimizable() { return (super.isOptimizable() && - !X11GLXDrawableFactory.getX11Factory().isVendorATI()); + !((X11GLXDrawableFactory)getGLDrawable().getFactory()).isVendorATI()); } //---------------------------------------------------------------------- diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java index 075106005..8bf18e670 100644 --- a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java @@ -114,7 +114,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { if (target == null) { throw new IllegalArgumentException("Null target"); } - target = NativeWindowHelper.unwrap(target); + target = NativeWindowFactory.getNativeWindow(target); X11OnscreenGLXDrawable drawable = new X11OnscreenGLXDrawable(this, target); long visualID = target.getVisualID(); int screen = target.getScreenIndex(); @@ -424,12 +424,6 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { return caps; } - public void lockToolkit() { - } - - public void unlockToolkit() { - } - // Display connection for use by visual selection algorithm and by all offscreen surfaces private static long staticDisplay=0; private static boolean xineramaEnabled=false; @@ -508,10 +502,6 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { return tmp[tmp_offset]; } - public static X11GLXDrawableFactory getX11Factory() { - return (X11GLXDrawableFactory) getFactory(false); - } - /** Workaround for apparent issue with ATI's proprietary drivers where direct contexts still send GLX tokens for GL calls */ public static boolean isVendorATI() { diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java index 446d6f4e5..74b2191ab 100644 --- a/src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java @@ -131,11 +131,11 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable { drawable = 0; pixmap = 0; display = 0; - nw.invalidate(); setChosenGLCapabilities(null); } finally { getFactory().unlockToolkit(); } + super.destroy(); } public boolean isDoubleBuffered() { diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java index 1741ba72a..107eba9d2 100644 --- a/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java @@ -66,23 +66,17 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable { public void swapBuffers() throws GLException { getFactory().lockToolkit(); - try { - boolean didLock = false; - + try { if (component.getSurfaceHandle() == 0) { if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { return; } - - didLock = true; } GLX.glXSwapBuffers(component.getDisplayHandle(), component.getSurfaceHandle()); - if (didLock) { - unlockSurface(); - } } finally { + unlockSurface(); getFactory().unlockToolkit(); } } diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java index 3f29095cb..d5cdd6016 100644 --- a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java @@ -89,6 +89,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable { } finally { getFactory().unlockToolkit(); } + super.destroy(); } public void setSize(int width, int height) { diff --git a/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXDrawableFactory.java index a6f545b87..a5ec4c46c 100644 --- a/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXDrawableFactory.java @@ -171,11 +171,13 @@ public class X11AWTGLXDrawableFactory extends X11GLXDrawableFactory { } public void lockToolkit() { + super.lockToolkit(); JAWTUtil.lockToolkit(); } public void unlockToolkit() { JAWTUtil.unlockToolkit(); + super.unlockToolkit(); } } |