diff options
author | Sven Gothel <[email protected]> | 2013-10-30 01:57:34 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-10-30 01:57:34 +0100 |
commit | c53440b808ecf8ea066479c004cac4cdbb1e989d (patch) | |
tree | 01f0722dd048c3db3f1e400c32d958bed92a70ed /src/test | |
parent | 5cb08416a6ed44814065771f469a94f79c49ab3f (diff) |
Bug 776 GLContext Sharing: GLSharedContextSetter API Doc: Add 'glFinish()' to lifecycle considerations ; GearsES2: Add glFinish() after init().
Diffstat (limited to 'src/test')
6 files changed, 37 insertions, 0 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java index ede01b52f..3b576fabd 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java @@ -181,7 +181,10 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase { } catch(Exception e) { e.printStackTrace(); } + // Stopped animator allows native windowing system 'repaint' event + // to trigger GLAD 'display' animator.stop(); + Assert.assertEquals(false, animator.isAnimating()); if( destroyCleanOrder ) { System.err.println("XXX Destroy in clean order NOW"); @@ -332,9 +335,14 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase { } catch(Exception e) { e.printStackTrace(); } + // Stopped animator allows native windowing system 'repaint' event + // to trigger GLAD 'display' a1.stop(); + Assert.assertEquals(false, a1.isAnimating()); a2.stop(); + Assert.assertEquals(false, a2.isAnimating()); a3.stop(); + Assert.assertEquals(false, a3.isAnimating()); if( destroyCleanOrder ) { System.err.println("XXX Destroy in clean order NOW"); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java index c35b0658c..d4079e30c 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java @@ -172,7 +172,10 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase { } catch(Exception e) { e.printStackTrace(); } + // Stopped animator allows native windowing system 'repaint' event + // to trigger GLAD 'display' animator.stop(); + Assert.assertEquals(false, animator.isAnimating()); javax.swing.SwingUtilities.invokeAndWait(new Runnable() { public void run() { @@ -281,9 +284,14 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase { } catch(Exception e) { e.printStackTrace(); } + // Stopped animator allows native windowing system 'repaint' event + // to trigger GLAD 'display' a1.stop(); + Assert.assertEquals(false, a1.isAnimating()); a2.stop(); + Assert.assertEquals(false, a2.isAnimating()); a3.stop(); + Assert.assertEquals(false, a3.isAnimating()); javax.swing.SwingUtilities.invokeAndWait(new Runnable() { public void run() { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java index 24dc09ffb..e8e4cc739 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java @@ -308,6 +308,8 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase { } catch(Exception e) { e.printStackTrace(); } + // Stopped animator allows native windowing system 'repaint' event + // to trigger GLAD 'display' a1.stop(); Assert.assertEquals(false, a1.isAnimating()); a2.stop(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java index 96a8a5094..c94ae1140 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java @@ -176,7 +176,10 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase { } catch(Exception e) { e.printStackTrace(); } + // Stopped animator allows native windowing system 'repaint' event + // to trigger GLAD 'display' animator.stop(); + Assert.assertEquals(false, animator.isAnimating()); if( destroyCleanOrder ) { System.err.println("XXX Destroy in clean order NOW"); @@ -287,9 +290,14 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase { } catch(Exception e) { e.printStackTrace(); } + // Stopped animator allows native windowing system 'repaint' event + // to trigger GLAD 'display' a1.stop(); + Assert.assertEquals(false, a1.isAnimating()); a2.stop(); + Assert.assertEquals(false, a2.isAnimating()); a3.stop(); + Assert.assertEquals(false, a3.isAnimating()); if( destroyCleanOrder ) { System.err.println("XXX Destroy in clean order NOW"); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java index 9b6ab88fa..9ccfd394f 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java @@ -244,7 +244,10 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase { } catch(Exception e) { e.printStackTrace(); } + // Stopped animator allows native windowing system 'repaint' event + // to trigger GLAD 'display' animator.stop(); + Assert.assertEquals(false, animator.isAnimating()); display.syncExec(new Runnable() { public void run() { @@ -335,9 +338,14 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase { } catch(Exception e) { e.printStackTrace(); } + // Stopped animator allows native windowing system 'repaint' event + // to trigger GLAD 'display' a1.stop(); + Assert.assertEquals(false, a1.isAnimating()); a2.stop(); + Assert.assertEquals(false, a2.isAnimating()); a3.stop(); + Assert.assertEquals(false, a3.isAnimating()); display.syncExec(new Runnable() { public void run() { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java index 6c5ddf6e6..be7fcee07 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java @@ -304,6 +304,8 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL st.useProgram(gl, false); + gl.glFinish(); // make sure .. for shared context (impacts OSX 10.9) + System.err.println(Thread.currentThread()+" GearsES2.init "+sid()+" FIN "+this); isInit = true; } @@ -429,6 +431,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL @Override public void display(GLAutoDrawable drawable) { if( !isInit ) { return; } + if(null != sharedGears && !sharedGears.isInit() ) { return; } GLAnimatorControl anim = drawable.getAnimator(); if( verbose && ( null == anim || !anim.isAnimating() ) ) { System.err.println(Thread.currentThread()+" GearsES2.display "+sid()+" "+drawable.getWidth()+"x"+drawable.getHeight()+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(drawable.getHandle())); |