aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-06-30 05:14:34 +0200
committerSven Gothel <[email protected]>2012-06-30 05:14:34 +0200
commit9a7c8896fe38ebcd42ed5238b09a7a36d46db9dc (patch)
treed3ffa573aaa3a6d9e3f4232a960e17581b5e19ee /src/nativewindow/classes/jogamp
parentc50fca1b5df9ec3b76fada4dd5dd307bdece531a (diff)
Fix Bug #589 (JAWT Offscreen-Layer resize) and Offscreen-Layer setSwapInterval() deadlock; Reuse JAWT instance; Cleanup
- Fixes - OSXUtil.CreateCALayer*(..): Pass layer target size (if known). This fixes Bug #589 - MacOSXWindowSystemInterface-pbuffer.m: - ALL: displayLink NULL check - setSwapInterval(..): lock only for variable setting, could deadlock when start/stop CVDisplayLink - JAWTWindow.destroy(): use 'surfaceLock' instead of 'synchronized' - Cleanup / Performance - JAWTWindow.lockSurface(): Reuse JAWT instance - MacOSXJAWTWindow: AttachJAWTSurfaceLayer0(..) -> SetJAWTRootSurfaceLayer0(..) Reflects semantic better. - DEBUG - JAWTWindow.updateBounds(..) notify of bounds change
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java10
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
index 0ca5cd297..42fd08df1 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
@@ -207,20 +207,20 @@ public class MacOSXJAWTWindow extends JAWTWindow implements SurfaceChangeable {
((MutableGraphicsConfiguration)getGraphicsConfiguration()).setChosenCapabilities(caps);
}
if(0 == rootSurfaceLayerHandle) {
- rootSurfaceLayerHandle = OSXUtil.CreateCALayer();
+ rootSurfaceLayerHandle = OSXUtil.CreateCALayer(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
if(0 == rootSurfaceLayerHandle) {
OSXUtil.DestroyNSWindow(drawable);
drawable = 0;
unlockSurfaceImpl();
throw new NativeWindowException("Could not create root CALayer: "+this);
}
- if(!AttachJAWTSurfaceLayer0(dsi.getBuffer(), rootSurfaceLayerHandle)) {
+ if(!SetJAWTRootSurfaceLayer0(dsi.getBuffer(), rootSurfaceLayerHandle)) {
OSXUtil.DestroyCALayer(rootSurfaceLayerHandle);
rootSurfaceLayerHandle = 0;
OSXUtil.DestroyNSWindow(drawable);
drawable = 0;
unlockSurfaceImpl();
- throw new NativeWindowException("Could not attach JAWT surfaceLayerHandle: "+this);
+ throw new NativeWindowException("Could not set JAWT rootSurfaceLayerHandle: "+this);
}
}
ret = NativeWindow.LOCK_SUCCESS;
@@ -267,8 +267,8 @@ public class MacOSXJAWTWindow extends JAWTWindow implements SurfaceChangeable {
}
protected Point getLocationOnScreenNativeImpl(final int x0, final int y0) { return null; }
- private static native boolean AttachJAWTSurfaceLayer0(Buffer jawtDrawingSurfaceInfoBuffer, long caLayer);
- // private static native boolean DetachJAWTSurfaceLayer0(Buffer jawtDrawingSurfaceInfoBuffer, long caLayer);
+ private static native boolean SetJAWTRootSurfaceLayer0(Buffer jawtDrawingSurfaceInfoBuffer, long caLayer);
+ // private static native boolean UnsetJAWTRootSurfaceLayer0(Buffer jawtDrawingSurfaceInfoBuffer, long caLayer);
// Variables for lockSurface/unlockSurface
private JAWT_DrawingSurface ds;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
index 3ca76a84a..94f949ea3 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
@@ -77,8 +77,8 @@ public class OSXUtil {
DestroyNSWindow0(nsWindow);
}
- public static long CreateCALayer() {
- return CreateCALayer0();
+ public static long CreateCALayer(int x, int y, int width, int height) {
+ return CreateCALayer0(x, y, width, height);
}
public static void AddCASublayer(long rootCALayer, long subCALayer) {
if(0==rootCALayer || 0==subCALayer) {
@@ -117,7 +117,7 @@ public class OSXUtil {
private static native void DestroyNSView0(long nsView);
private static native long CreateNSWindow0(int x, int y, int width, int height);
private static native void DestroyNSWindow0(long nsWindow);
- private static native long CreateCALayer0();
+ private static native long CreateCALayer0(int x, int y, int width, int height);
private static native void AddCASublayer0(long rootCALayer, long subCALayer);
private static native void RemoveCASublayer0(long rootCALayer, long subCALayer);
private static native void DestroyCALayer0(long caLayer);