diff options
author | Sven Gothel <[email protected]> | 2013-02-20 21:51:40 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-02-20 21:51:40 +0100 |
commit | 14b278536e6f8de2ee6254796b89bd27d5419b72 (patch) | |
tree | 0f4ec76f215cbba178eb6732c1f2a9363df9d6d5 /src/test | |
parent | cf3ecdb670c0dfecd1394d5b9d5d5588c1bf71f3 (diff) |
OSX/Java7/CALayer + JAWT: Partially Fix AWT/NEWT CALayer 'out of sight' bug, where our CALayer is moved out of the visible area
- same erroneous behavior for GLCanvas and NewtCanvasAWT
- sized-frame: Set framesize and validate() it
- sized-component: Set component preferred size and call frame.pack()
- added workaround 'OffscreenLayerSurface.layoutSurfaceLayer()' to fix CALayer size, which snaps for:
- OK initial size before setVisible: sized-frame and sized-component
- OK resize w/ sized-frame
- OK manual frame resize
- Invisible: w/ sized-component after setVisible()
++
- CALayer-Sublayer (GL) has additional retain/release when added/removed
to be on safe side.
Diffstat (limited to 'src/test')
5 files changed, 9 insertions, 12 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java index 8d1ad57b4..447c6b94c 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java @@ -77,13 +77,12 @@ public class TestGearsES2AWT extends UITestCase { static int swapInterval = 1; static boolean exclusiveContext = false; static Thread awtEDT; - static Dimension rwsize; + static Dimension rwsize = null; @BeforeClass public static void initClass() { width = 640; height = 480; - rwsize = null; try { EventQueue.invokeAndWait(new Runnable() { public void run() { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java index 52ce425a8..47891a8df 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java @@ -71,7 +71,7 @@ import org.junit.Test; public class TestGearsES2NEWT extends UITestCase { static int screenIdx = 0; static PointImmutable wpos; - static DimensionImmutable wsize, rwsize; + static DimensionImmutable wsize, rwsize=null; static long duration = 500; // ms static boolean opaque = true; @@ -96,7 +96,6 @@ public class TestGearsES2NEWT extends UITestCase { public static void initClass() { if(null == wsize) { wsize = new Dimension(640, 480); - rwsize = null; } } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java index 035ed624a..f98cb240b 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java @@ -78,7 +78,7 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase { static int screenIdx = 0; static PointImmutable wpos; - static DimensionImmutable wsize, rwsize; + static DimensionImmutable wsize, rwsize = null; static long duration = 500; // ms static boolean opaque = true; @@ -99,7 +99,6 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase { public static void initClass() { if(null == wsize) { wsize = new Dimension(640, 480); - rwsize = null; } } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java index 112a1282d..cb2cf064f 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java @@ -73,7 +73,7 @@ import org.junit.Test; public class TestGearsES2NewtCanvasSWT extends UITestCase { static int screenIdx = 0; static PointImmutable wpos; - static DimensionImmutable wsize, rwsize; + static DimensionImmutable wsize, rwsize = null; static long duration = 500; // ms static boolean opaque = true; @@ -93,7 +93,6 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase { public static void initClass() { if(null == wsize) { wsize = new Dimension(640, 480); - rwsize = new Dimension(-1, -1); } } @@ -219,7 +218,7 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase { System.err.println("GL chosen: "+glWindow.getChosenCapabilities()); System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); - if( 0 < rwsize.getWidth() && 0 < rwsize.getHeight() ) { + if( null != rwsize ) { for(int i=0; i<50; i++) { // 500 ms dispatched delay if( !display.readAndDispatch() ) { // blocks on linux .. display.sleep(); @@ -349,7 +348,9 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase { } } wsize = new Dimension(w, h); - rwsize = new Dimension(rw, rh); + if( 0 < rw && 0 < rh ) { + rwsize = new Dimension(rw, rh); + } if(usePos) { wpos = new Point(x, y); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java index 45bd3bb39..08e4ac26a 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java @@ -65,7 +65,7 @@ import org.junit.Test; public class TestGearsES2SWT extends UITestCase { static int screenIdx = 0; static PointImmutable wpos; - static DimensionImmutable wsize, rwsize; + static DimensionImmutable wsize, rwsize=null; static long duration = 500; // ms static boolean opaque = true; @@ -85,7 +85,6 @@ public class TestGearsES2SWT extends UITestCase { public static void initClass() { if(null == wsize) { wsize = new Dimension(640, 480); - rwsize = null; } } |