From a4e3f241cfba55e407c68eba91ffcc4beb0758b5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 26 Oct 2010 23:23:39 +0200 Subject: Analysis of glXMakeCurrent freeze on ATI fglrx 8.78.6; Misc .. Analysis of glXMakeCurrent freeze on ATI fglrx 8.78.6 - Workaround in TestGLWindows01NEWT: same create/destroy order - Prove bug with simple native test app: jogl/test/native/displayMultiple02.c Misc: - Reverted d52181032830acdd5e4069a41ccd0daff5922d8a, ie reenable x11IOErrorHandler (nativewindow) - GLDrawableHelper: methods -> final - X11Util.NamedDisplay: remove unused RecursiveLock, Cloneable --- .../test/junit/newt/TestGLWindows01NEWT.java | 77 ++++++++++++++++++++-- 1 file changed, 73 insertions(+), 4 deletions(-) (limited to 'src/junit/com/jogamp/test') diff --git a/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java index 8d0561a81..73d962dfa 100644 --- a/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java +++ b/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java @@ -72,6 +72,7 @@ public class TestGLWindows01NEWT extends UITestCase { GLWindow glWindow; if(null!=screen) { boolean destroyWhenUnused = screen.getDestroyWhenUnused(); + Assert.assertEquals(destroyWhenUnused, screen.getDisplay().getDestroyWhenUnused()); glWindow = GLWindow.create(screen, caps); Assert.assertNotNull(glWindow); Assert.assertEquals(destroyWhenUnused, glWindow.getScreen().getDestroyWhenUnused()); @@ -244,14 +245,76 @@ public class TestGLWindows01NEWT extends UITestCase { } @Test - public void testWindowDecor03TwoWin() throws InterruptedException { + public void testWindowDecor03TwoWinOneDisplay() throws InterruptedException { + GLCapabilities caps = new GLCapabilities(glp); + Assert.assertNotNull(caps); + + Display display = NewtFactory.createDisplay(null); // local display + Assert.assertNotNull(display); + display.setDestroyWhenUnused(true); + + Screen screen1 = NewtFactory.createScreen(display, 0); // screen 0 + Assert.assertNotNull(screen1); + GLWindow window1 = createWindow(screen1, caps, width, height, + true /* onscreen */, false /* undecorated */, + false /*addGLEventListenerAfterVisible*/); + Assert.assertNotNull(window1); + + Screen screen2 = NewtFactory.createScreen(display, 0); // screen 0 + Assert.assertNotNull(screen2); + GLWindow window2 = createWindow(screen2, caps, width, height, + true /* onscreen */, false /* undecorated */, + false /*addGLEventListenerAfterVisible*/); + Assert.assertNotNull(window2); + + Assert.assertEquals(1,Display.getActiveDisplayNumber()); + + Assert.assertEquals(2,display.getReferenceCount()); + Assert.assertEquals(true,display.isNativeValid()); + Assert.assertNotNull(display.getEDTUtil()); + Assert.assertEquals(true,display.getEDTUtil().isRunning()); + + Assert.assertEquals(1,screen1.getReferenceCount()); + Assert.assertEquals(true,screen1.isNativeValid()); + + Assert.assertEquals(1,screen2.getReferenceCount()); + Assert.assertEquals(true,screen2.isNativeValid()); + + int state; + for(state=0; state*100 X11 Display). + // In such cases, closing displays shall happen in the same order as + // opening them, otherwise some driver related bug appears. + // You may test this, ie just reverse the destroy order below. + // See also native test: jogl/test/native/displayMultiple02.c + destroyWindow(window1, null, null, true); + destroyWindow(window2, null, null, true); Assert.assertEquals(0,Display.getActiveDisplayNumber()); @@ -308,7 +377,7 @@ public class TestGLWindows01NEWT extends UITestCase { Assert.assertNotNull(display2.getEDTUtil()); Assert.assertEquals(false,display2.getEDTUtil().isRunning()); Assert.assertEquals(0,screen2.getReferenceCount()); - Assert.assertEquals(false,screen2.isNativeValid()); + Assert.assertEquals(false,screen2.isNativeValid()); } public static void setDemoFields(GLEventListener demo, GLWindow glWindow) { -- cgit v1.2.3