From 28b0df6c300494a2b54c07fdf43ef04f5f1b0073 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 8 Sep 2011 03:43:54 +0200 Subject: Destruction of GLAutoDrawable shall not remove them from AnimatorControl (due to recreation) ; NEWT/Window: Remove isValid() API entry - always true! Destruction of GLAutoDrawable shall not remove them from AnimatorControl (due to recreation) - Completes commit b65e1e76d413b70e5593173e6bd36d30675554a6 - WindowImpl: - volatile: windowHandle/visible fields (memeory sync critical) - destroy must set visible := false, to avoid immediate recreation via a display call of another thread, ie an animator. NEWT/Window: Remove isValid() API entry - always true! - NEWT/Window's can always be recreated. - redundancy in API is even worse than redundancy in impl. :) --- ...TestSwingAWTRobotUsageBeforeJOGLInitBug411.java | 14 ++++++---- .../junit/newt/TestGLWindows02NEWTAnimated.java | 17 +++++++++++- .../junit/newt/TestWindowClosingProtocol01AWT.java | 2 ++ .../newt/TestWindowClosingProtocol03NewtAWT.java | 31 +++++++++++++++------- 4 files changed, 49 insertions(+), 15 deletions(-) (limited to 'src/test/com/jogamp') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java index fb92e92ac..2809a138c 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java @@ -50,7 +50,6 @@ import java.awt.Dimension; import java.awt.AWTException; import java.awt.Robot; import java.awt.Point; -import java.awt.Rectangle; import java.awt.event.InputEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -269,12 +268,13 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase { Assert.assertEquals(true, anim.isAnimating()); // due to newtCanvasAWT/win1 newtCanvasAWT.destroy(); // destroys both newtCanvasAWT/win1 - Assert.assertEquals(false, win0.isNativeValid()); Assert.assertEquals(false, win1.isNativeValid()); + Assert.assertEquals(false, win0.isNativeValid()); + Assert.assertEquals(true, anim.isAnimating()); + + Assert.assertEquals(true, anim.stop()); Assert.assertEquals(false, anim.isAnimating()); - anim.stop(); - System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test01NewtCanvasAWT(): End"); } @@ -304,11 +304,15 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase { anim.add(glCanvas); runTestGL(glCanvas, glCanvas); + Assert.assertEquals(true, anim.isAnimating()); + anim.remove(glCanvas); + Assert.assertEquals(false, anim.isAnimating()); + /** win0.destroy(); Assert.assertEquals(true, anim.isAnimating()); */ - anim.stop(); + Assert.assertEquals(true, anim.stop()); System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test02GLCanvas(): End"); } diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java index bfc3f43a7..3176d59e5 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java @@ -124,7 +124,14 @@ public class TestGLWindows02NEWTAnimated extends UITestCase { while(animator.isAnimating() && animator.getTotalFPSDuration() NOP / HIDE (default) @@ -78,6 +87,7 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase { Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false)); Assert.assertEquals(true, frame.isDisplayable()); + Assert.assertEquals(false, frame.isVisible()); Assert.assertEquals(true, newtCanvas.isValid()); Assert.assertEquals(true, newtCanvas.isDisplayable()); Assert.assertEquals(true, glWindow.isNativeValid()); @@ -88,8 +98,10 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase { public void run() { frame.setVisible(true); } }); - Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true)); - + Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true)); + Assert.assertEquals(true, frame.isDisplayable()); + Assert.assertEquals(true, frame.isVisible()); + // // close with op (JFrame): DISPOSE_ON_CLOSE -- newtCanvas -- glWindow --> dispose // @@ -100,6 +112,7 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase { Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true)); Assert.assertEquals(false, frame.isDisplayable()); + Assert.assertEquals(false, frame.isVisible()); Assert.assertEquals(false, newtCanvas.isValid()); Assert.assertEquals(false, newtCanvas.isDisplayable()); Assert.assertEquals(false, glWindow.isNativeValid()); -- cgit v1.2.3