From 2dbbfdd226bf1a9158936531a299adb5bdd2ad4a Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sun, 26 Mar 2006 18:52:02 +0000 Subject: Fixed bugs in implementation of -Djogl.GLContext.noopt flag git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@685 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java | 10 +++++----- .../sun/opengl/impl/windows/WindowsOnscreenGLContext.java | 14 +++++++++++++- .../com/sun/opengl/impl/x11/X11OnscreenGLContext.java | 10 +++++----- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java b/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java index 977e3315c..3f08b084e 100644 --- a/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java +++ b/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java @@ -77,7 +77,7 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext { } return ret; } finally { - if (optimizationEnabled) { + if (isOptimizable()) { if (lockRes != MacOSXOnscreenGLDrawable.LOCK_SURFACE_NOT_READY) { drawable.unlockSurface(); } @@ -86,10 +86,10 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext { } protected void releaseImpl() throws GLException { - if (!optimizationEnabled) { - try { - super.releaseImpl(); - } finally { + try { + super.releaseImpl(); + } finally { + if (!isOptimizable()) { drawable.unlockSurface(); } } diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLContext.java b/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLContext.java index 4e1dbd1c0..4f41cd8e1 100644 --- a/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLContext.java +++ b/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLContext.java @@ -66,7 +66,19 @@ public class WindowsOnscreenGLContext extends WindowsGLContext { int ret = super.makeCurrentImpl(); return ret; } finally { - if (lockRes != WindowsOnscreenGLDrawable.LOCK_SURFACE_NOT_READY) { + if (isOptimizable()) { + if (lockRes != WindowsOnscreenGLDrawable.LOCK_SURFACE_NOT_READY) { + drawable.unlockSurface(); + } + } + } + } + + protected void releaseImpl() throws GLException { + try { + super.releaseImpl(); + } finally { + if (!isOptimizable()) { drawable.unlockSurface(); } } diff --git a/src/classes/com/sun/opengl/impl/x11/X11OnscreenGLContext.java b/src/classes/com/sun/opengl/impl/x11/X11OnscreenGLContext.java index f4f4c7094..908257ba1 100644 --- a/src/classes/com/sun/opengl/impl/x11/X11OnscreenGLContext.java +++ b/src/classes/com/sun/opengl/impl/x11/X11OnscreenGLContext.java @@ -68,7 +68,7 @@ public class X11OnscreenGLContext extends X11GLContext { } return super.makeCurrentImpl(); } finally { - if (optimizationEnabled) { + if (isOptimizable()) { if (lockRes != X11OnscreenGLDrawable.LOCK_SURFACE_NOT_READY) { drawable.unlockSurface(); } @@ -77,10 +77,10 @@ public class X11OnscreenGLContext extends X11GLContext { } protected void releaseImpl() throws GLException { - if (!optimizationEnabled) { - try { - super.releaseImpl(); - } finally { + try { + super.releaseImpl(); + } finally { + if (!isOptimizable()) { drawable.unlockSurface(); } } -- cgit v1.2.3