summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-01-21 21:01:20 +0100
committerSven Gothel <[email protected]>2023-01-21 21:01:20 +0100
commit4009198e34b50bba9582be24f33eaf83b94a2cb8 (patch)
tree2d78483cb5529865d7c2cd2ad53790285ea21018 /src/nativewindow/classes/jogamp
parentf71abdf19bdcf3ccfcc5455cb15aff4e93d468bb (diff)
JAWTWindow.invalidateNative() and .detachSurfaceLayerImpl(): Pass copy of offscreenSurfaceLayer for pending off-thread operation and immediately zero reference marking its future destruction.
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java5
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java2
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java3
3 files changed, 5 insertions, 5 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
index 4e89709f2..4cba086e0 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
@@ -83,12 +83,12 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
}
@Override
- protected void invalidateNative() {
+ protected void invalidateNative(final long _offscreenSurfaceLayer) {
if(DEBUG) {
System.err.println("MacOSXJAWTWindow.invalidateNative(): osh-enabled "+isOffscreenLayerSurfaceEnabled()+
", osd-set "+offscreenSurfaceDrawableSet+
", osd "+toHexString(offscreenSurfaceDrawable)+
- ", osl "+toHexString(getAttachedSurfaceLayer())+
+ ", osl "+toHexString(_offscreenSurfaceLayer)+
", jsl "+toHexString(jawtSurfaceLayersHandle)+
", rsl "+toHexString(rootSurfaceLayer)+
", wh "+toHexString(windowHandle)+" - "+Thread.currentThread().getName());
@@ -99,7 +99,6 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
if(0 != windowHandle) {
OSXUtil.DestroyNSWindow(windowHandle);
}
- final long _offscreenSurfaceLayer = getAttachedSurfaceLayer(); // Bug 1389
OSXUtil.RunOnMainThread(false, true /* kickNSApp */, new Runnable() {
@Override
public void run() {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
index 655dadd6b..892a9d239 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
@@ -64,7 +64,7 @@ public class WindowsJAWTWindow extends JAWTWindow {
}
@Override
- protected void invalidateNative() {
+ protected void invalidateNative(final long _offscreenSurfaceLayer) {
windowHandle = 0;
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
index 80cf3ba6f..4d50d3882 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
@@ -61,7 +61,8 @@ public class X11JAWTWindow extends JAWTWindow {
}
@Override
- protected void invalidateNative() { }
+ protected void invalidateNative(final long _offscreenSurfaceLayer) {
+ }
@Override
protected JAWT fetchJAWTImpl() throws NativeWindowException {