aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-07-20 22:05:32 +0200
committerSven Gothel <[email protected]>2012-07-20 22:05:32 +0200
commite58e7739379147af8c7b875f6e8a7cdb40e342bc (patch)
treeb74531fe8dee6d27215169325347860ce616b3e7 /src/newt/classes/com/jogamp
parentfb7d2d8a188fe5da159571cfabfd1d6a8879d1da (diff)
Fix OSX OffscreenLayerSurface (OLS) regressions (pbuffer based)
- Use pbuffer (still), don't set FBO (invisible) - OLS (only impl is JAWTWindow now) stores the attached layer handle created and attached by the GLContext implementation, so 'others' may detach it -> NewtCanvasAWT - NewtCanvasAWT.removeNotify() needs to ask the OLS to detach the layer since it's parent will be gone. - MacOSXCGLContext destroy allows a removed OLS (see above)
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index 9af4a02ae..cd0e9aab6 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -42,7 +42,9 @@ import java.security.PrivilegedAction;
import java.util.Set;
import javax.media.nativewindow.NativeWindow;
+import javax.media.nativewindow.NativeWindowFactory;
import javax.media.nativewindow.OffscreenLayerOption;
+import javax.media.nativewindow.OffscreenLayerSurface;
import javax.media.nativewindow.WindowClosingProtocol;
import javax.swing.MenuSelectionManager;
@@ -368,6 +370,10 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
if(DEBUG) {
System.err.println("NewtCanvasAWT.removeNotify: "+newtChild+", from "+cont);
}
+ final OffscreenLayerSurface ols = NativeWindowFactory.getOffscreenLayerSurface(newtChild, true);
+ if(null != ols && ols.isSurfaceLayerAttached()) {
+ ols.detachSurfaceLayer();
+ }
reparentWindow(false, cont);
super.removeNotify();
}
@@ -413,7 +419,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
// since this it is completely covered by the newtChild (z-order).
setFocusable(true);
} else {
- configureNewtChild(false);
+ configureNewtChild(false);
newtChild.setVisible(false);
newtChild.reparentWindow(null);
if(null != jawtWindow) {
@@ -445,7 +451,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
NewtFactoryAWT.destroyNativeWindow(jawtWindow);
jawtWindow=null;
}
- newtChild.setVisible(false);
+ newtChild.setVisible(false);
newtChild.reparentWindow(null);
newtChild.destroy();
newtChild=null;