From 64041218f3d5965b9525e8699aa97e9ec751cd95 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 12 Jan 2013 09:08:55 +0100 Subject: Move all Exclusive Context Thread (ECT) tests to it's own package to de-clutter core test package --- make/scripts/tests-x64.bat | 12 +- make/scripts/tests.sh | 14 +- .../junit/jogl/acore/ExclusiveContextBase00.java | 420 --------------------- .../jogl/acore/ExclusiveContextBase00AWT.java | 161 -------- .../jogl/acore/ExclusiveContextBase00NEWT.java | 94 ----- .../junit/jogl/acore/ExclusiveContextBase10.java | 213 ----------- .../jogl/acore/ExclusiveContextBase10AWT.java | 161 -------- .../jogl/acore/ExclusiveContextBase10NEWT.java | 94 ----- .../acore/TestExclusiveContext01VSyncAnimAWT.java | 70 ---- .../acore/TestExclusiveContext01VSyncAnimNEWT.java | 67 ---- .../acore/TestExclusiveContext02FPSAnimAWT.java | 70 ---- .../acore/TestExclusiveContext02FPSAnimNEWT.java | 67 ---- .../acore/TestExclusiveContext11VSyncAnimNEWT.java | 66 ---- .../acore/TestExclusiveContext12FPSAnimNEWT.java | 67 ---- .../jogl/acore/ect/ExclusiveContextBase00.java | 420 +++++++++++++++++++++ .../jogl/acore/ect/ExclusiveContextBase00AWT.java | 161 ++++++++ .../jogl/acore/ect/ExclusiveContextBase00NEWT.java | 94 +++++ .../jogl/acore/ect/ExclusiveContextBase10.java | 213 +++++++++++ .../jogl/acore/ect/ExclusiveContextBase10AWT.java | 161 ++++++++ .../jogl/acore/ect/ExclusiveContextBase10NEWT.java | 94 +++++ .../ect/TestExclusiveContext01VSyncAnimAWT.java | 70 ++++ .../ect/TestExclusiveContext01VSyncAnimNEWT.java | 67 ++++ .../ect/TestExclusiveContext02FPSAnimAWT.java | 70 ++++ .../ect/TestExclusiveContext02FPSAnimNEWT.java | 67 ++++ .../ect/TestExclusiveContext11VSyncAnimNEWT.java | 66 ++++ .../ect/TestExclusiveContext12FPSAnimNEWT.java | 67 ++++ 26 files changed, 1563 insertions(+), 1563 deletions(-) delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ExclusiveContextBase00.java delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ExclusiveContextBase00AWT.java delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ExclusiveContextBase00NEWT.java delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ExclusiveContextBase10.java delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ExclusiveContextBase10AWT.java delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ExclusiveContextBase10NEWT.java delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/TestExclusiveContext01VSyncAnimAWT.java delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/TestExclusiveContext01VSyncAnimNEWT.java delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/TestExclusiveContext02FPSAnimAWT.java delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/TestExclusiveContext02FPSAnimNEWT.java delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/TestExclusiveContext11VSyncAnimNEWT.java delete mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/TestExclusiveContext12FPSAnimNEWT.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00AWT.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00NEWT.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10AWT.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10NEWT.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimAWT.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimNEWT.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimAWT.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimNEWT.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext11VSyncAnimNEWT.java create mode 100644 src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext12FPSAnimNEWT.java diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat index 8367228b5..20cb54147 100755 --- a/make/scripts/tests-x64.bat +++ b/make/scripts/tests-x64.bat @@ -18,12 +18,12 @@ REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLDeb REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT %* REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestMapBuffer01NEWT -REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext01VSyncAnimNEWT %* -REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext01VSyncAnimAWT %* -REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext02FPSAnimNEWT %* -REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext02FPSAnimAWT %* -scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext11VSyncAnimNEWT %* -REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext12FPSAnimNEWT %* +REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext01VSyncAnimNEWT %* +REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext01VSyncAnimAWT %* +REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext02FPSAnimNEWT %* +REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext02FPSAnimAWT %* +scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext11VSyncAnimNEWT %* +REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext12FPSAnimNEWT %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateOnOffscrnCapsNEWT $* REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT $* diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index b9c5302a9..130cf1570 100755 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -263,7 +263,7 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestRedSquareES2NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT $* -testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl3.newt.TestGeomShader01TextureGL3NEWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl3.newt.TestGeomShader01TextureGL3NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestFloatUtil01MatrixMatrixMultNOUI $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestPMVMatrix01NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestPMVMatrix02NEWT $* @@ -285,12 +285,12 @@ testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl3.newt.TestGeomShader01Textu #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLPointsNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLMesaBug651NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLMesaBug658NEWT $* -#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext01VSyncAnimNEWT $* -#testawt com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext01VSyncAnimAWT $* -#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext02FPSAnimNEWT $* -#testawt com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext02FPSAnimAWT $* -#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext11VSyncAnimNEWT $* -#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestExclusiveContext12FPSAnimNEWT $* +testnoawt com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext01VSyncAnimNEWT $* +#testawt com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext01VSyncAnimAWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext02FPSAnimNEWT $* +#testawt com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext02FPSAnimAWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext11VSyncAnimNEWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext12FPSAnimNEWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ExclusiveContextBase00.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ExclusiveContextBase00.java deleted file mode 100644 index c6eb3a103..000000000 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ExclusiveContextBase00.java +++ /dev/null @@ -1,420 +0,0 @@ -/** - * Copyright 2013 JogAmp Community. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of JogAmp Community. - */ - -package com.jogamp.opengl.test.junit.jogl.acore; - -import com.jogamp.newt.NewtFactory; -import com.jogamp.newt.Window; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil; -import com.jogamp.opengl.test.junit.util.UITestCase; - -import com.jogamp.opengl.util.Animator; -import com.jogamp.opengl.util.AnimatorBase; - -import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; - -import javax.media.nativewindow.Capabilities; -import javax.media.nativewindow.util.InsetsImmutable; - -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLCapabilitiesImmutable; -import javax.media.opengl.GLProfile; - -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.AfterClass; -import org.junit.Test; - -/** - * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase. - */ -public abstract class ExclusiveContextBase00 extends UITestCase { - static boolean testExclusiveWithAWT = false; - static final int durationParts = 9; - static long duration = 320 * durationParts; // ms ~ 20 frames - - static boolean showFPS = false; - static int showFPSRate = 100; - - static final int demoSize = 128; - - static InsetsImmutable insets = null; - static int scrnHeight, scrnWidth; - static int num_x, num_y; - - static int swapInterval = 0; - - @BeforeClass - public static void initClass00() { - Window dummyWindow = NewtFactory.createWindow(new Capabilities()); - dummyWindow.setSize(demoSize, demoSize); - dummyWindow.setVisible(true); - Assert.assertEquals(true, dummyWindow.isVisible()); - Assert.assertEquals(true, dummyWindow.isNativeValid()); - insets = dummyWindow.getInsets(); - scrnHeight = dummyWindow.getScreen().getHeight(); - scrnWidth = dummyWindow.getScreen().getWidth(); - num_x = scrnWidth / ( demoSize + insets.getTotalWidth() ) - 2; - num_y = scrnHeight / ( demoSize + insets.getTotalHeight() ) - 2; - dummyWindow.destroy(); - } - - @AfterClass - public static void releaseClass00() { - } - - protected abstract boolean isAWTTestCase(); - protected abstract Thread getAWTRenderThread(); - protected abstract AnimatorBase createAnimator(); - protected abstract GLAutoDrawable createGLAutoDrawable(String title, int x, int y, int width, int height, GLCapabilitiesImmutable caps); - protected abstract void setGLAutoDrawableVisible(GLAutoDrawable[] glads); - protected abstract void destroyGLAutoDrawableVisible(GLAutoDrawable glad); - - protected void runTestGL(GLCapabilitiesImmutable caps, int drawableCount, boolean exclusive, boolean preAdd, boolean shortenTest) throws InterruptedException { - final boolean useAWTRenderThread = isAWTTestCase(); - if( useAWTRenderThread && exclusive ) { - if( testExclusiveWithAWT ) { - System.err.println("Warning: Testing AWT + Exclusive -> Not advised!"); - } else { - System.err.println("Info: Skip test: AWT + Exclusive!"); - return; - } - } - if( useAWTRenderThread && exclusive && !testExclusiveWithAWT) { - System.err.println("Skip test: AWT + Exclusive -> Not advised!"); - return; - } - final Thread awtRenderThread = getAWTRenderThread(); - final AnimatorBase animator = createAnimator(); - if( !useAWTRenderThread ) { - animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD); - } - final GLAutoDrawable[] drawables = new GLAutoDrawable[drawableCount]; - for(int i=0; i0) { - System.err.println("Clearing drawable ECT was done 'later' @ "+(c*20)+"ms, ok "+ok); - } - Assert.assertEquals(true, ok); - } - final Thread t = drawables[i].setExclusiveContextThread(ect); - Assert.assertEquals(null, t); - } - - Thread.sleep(duration/durationParts); // 3 - } - - // Disable/Enable exclusive mode via Animator for all GLAutoDrawable - if(exclusive) { - final Thread ect = animator.getExclusiveContextThread(); - if( useAWTRenderThread ) { - Assert.assertEquals(awtRenderThread, ect); - } else { - Assert.assertEquals(animator.getThread(), ect); - } - - Assert.assertEquals(true, animator.setExclusiveContext(false)); - Assert.assertFalse(animator.isExclusiveContextEnabled()); - for(int i=0; i Platform.getJavaVersionNumber().compareTo(version170); - System.err.println("OSX CALayer AWT-Mod Bug "+osxCALayerAWTModBug); - System.err.println("OSType "+Platform.getOSType()); - System.err.println("Java Version "+Platform.getJavaVersionNumber()); - - try { - EventQueue.invokeAndWait(new Runnable() { - public void run() { - awtEDT = Thread.currentThread(); - } } ); - } catch (Exception e) { - e.printStackTrace(); - Assert.assertNull(e); - } - - } - - @AfterClass - public static void releaseClass00AWT() { - } - - @Override - protected boolean isAWTTestCase() { return true; } - - @Override - protected Thread getAWTRenderThread() { - return awtEDT; - } - - @Override - protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, GLCapabilitiesImmutable caps) { - final GLCanvas glCanvas = new GLCanvas(); - - // FIXME: Below AWT layouts freezes OSX/Java7 @ setVisible: Window.setVisible .. CWrapper@NSWindow.isKeyWindow - // final Dimension sz = new Dimension(width, height); - // glCanvas.setMinimumSize(sz); - // glCanvas.setPreferredSize(sz); - // glCanvas.setSize(sz); - try { - EventQueue.invokeAndWait(new Runnable() { - public void run() { - final Frame frame = new Frame(); - frame.setLayout(new BorderLayout()); - frame.setMinimumSize(new Dimension(width, height)); - frame.setBounds(x, y, width, height); - frame.add(glCanvas, BorderLayout.CENTER); - // frame.pack(); - frame.validate(); - if( !osxCALayerAWTModBug ) { - frame.setTitle(title); - } - } }); - } catch (Exception e) { - e.printStackTrace(); - Assert.assertNull(e); - } - - return glCanvas; - } - - protected Frame getFrame(GLAutoDrawable glad) { - Container p = ((Component)glad).getParent(); - while( null != p && !( p instanceof Frame ) ) { - p = p.getParent(); - } - return (Frame)p; - } - - @Override - protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) { - try { - EventQueue.invokeAndWait(new Runnable() { - public void run() { - final int count = glads.length; - for(int i=0; i Not advised!"); - } else { - System.err.println("Info: Skip test: AWT + Exclusive!"); - return; - } - } - if( useAWTRenderThread && exclusive && !testExclusiveWithAWT) { - System.err.println("Skip test: AWT + Exclusive -> Not advised!"); - return; - } - final Thread awtRenderThread = getAWTRenderThread(); - final AnimatorBase animator = createAnimator(); - if( !useAWTRenderThread ) { - animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD); - } - final GLAutoDrawable[] drawables = new GLAutoDrawable[drawableCount]; - for(int i=0; i Platform.getJavaVersionNumber().compareTo(version170); - System.err.println("OSX CALayer AWT-Mod Bug "+osxCALayerAWTModBug); - System.err.println("OSType "+Platform.getOSType()); - System.err.println("Java Version "+Platform.getJavaVersionNumber()); - - try { - EventQueue.invokeAndWait(new Runnable() { - public void run() { - awtEDT = Thread.currentThread(); - } } ); - } catch (Exception e) { - e.printStackTrace(); - Assert.assertNull(e); - } - - } - - @AfterClass - public static void releaseClass00AWT() { - } - - @Override - protected boolean isAWTTestCase() { return true; } - - @Override - protected Thread getAWTRenderThread() { - return awtEDT; - } - - @Override - protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, GLCapabilitiesImmutable caps) { - final GLCanvas glCanvas = new GLCanvas(); - - // FIXME: Below AWT layouts freezes OSX/Java7 @ setVisible: Window.setVisible .. CWrapper@NSWindow.isKeyWindow - // final Dimension sz = new Dimension(width, height); - // glCanvas.setMinimumSize(sz); - // glCanvas.setPreferredSize(sz); - // glCanvas.setSize(sz); - try { - EventQueue.invokeAndWait(new Runnable() { - public void run() { - final Frame frame = new Frame(); - frame.setLayout(new BorderLayout()); - frame.setMinimumSize(new Dimension(width, height)); - frame.setBounds(x, y, width, height); - frame.add(glCanvas, BorderLayout.CENTER); - // frame.pack(); - frame.validate(); - if( !osxCALayerAWTModBug ) { - frame.setTitle(title); - } - } }); - } catch (Exception e) { - e.printStackTrace(); - Assert.assertNull(e); - } - - return glCanvas; - } - - protected Frame getFrame(GLAutoDrawable glad) { - Container p = ((Component)glad).getParent(); - while( null != p && !( p instanceof Frame ) ) { - p = p.getParent(); - } - return (Frame)p; - } - - @Override - protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) { - try { - EventQueue.invokeAndWait(new Runnable() { - public void run() { - final int count = glads.length; - for(int i=0; i Not advised!"); + } else { + System.err.println("Info: Skip test: AWT + Exclusive!"); + return; + } + } + if( useAWTRenderThread && exclusive && !testExclusiveWithAWT) { + System.err.println("Skip test: AWT + Exclusive -> Not advised!"); + return; + } + final Thread awtRenderThread = getAWTRenderThread(); + final AnimatorBase animator = createAnimator(); + if( !useAWTRenderThread ) { + animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD); + } + final GLAutoDrawable[] drawables = new GLAutoDrawable[drawableCount]; + for(int i=0; i0) { + System.err.println("Clearing drawable ECT was done 'later' @ "+(c*20)+"ms, ok "+ok); + } + Assert.assertEquals(true, ok); + } + final Thread t = drawables[i].setExclusiveContextThread(ect); + Assert.assertEquals(null, t); + } + + Thread.sleep(duration/durationParts); // 3 + } + + // Disable/Enable exclusive mode via Animator for all GLAutoDrawable + if(exclusive) { + final Thread ect = animator.getExclusiveContextThread(); + if( useAWTRenderThread ) { + Assert.assertEquals(awtRenderThread, ect); + } else { + Assert.assertEquals(animator.getThread(), ect); + } + + Assert.assertEquals(true, animator.setExclusiveContext(false)); + Assert.assertFalse(animator.isExclusiveContextEnabled()); + for(int i=0; i Platform.getJavaVersionNumber().compareTo(version170); + System.err.println("OSX CALayer AWT-Mod Bug "+osxCALayerAWTModBug); + System.err.println("OSType "+Platform.getOSType()); + System.err.println("Java Version "+Platform.getJavaVersionNumber()); + + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + awtEDT = Thread.currentThread(); + } } ); + } catch (Exception e) { + e.printStackTrace(); + Assert.assertNull(e); + } + + } + + @AfterClass + public static void releaseClass00AWT() { + } + + @Override + protected boolean isAWTTestCase() { return true; } + + @Override + protected Thread getAWTRenderThread() { + return awtEDT; + } + + @Override + protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, GLCapabilitiesImmutable caps) { + final GLCanvas glCanvas = new GLCanvas(); + + // FIXME: Below AWT layouts freezes OSX/Java7 @ setVisible: Window.setVisible .. CWrapper@NSWindow.isKeyWindow + // final Dimension sz = new Dimension(width, height); + // glCanvas.setMinimumSize(sz); + // glCanvas.setPreferredSize(sz); + // glCanvas.setSize(sz); + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + final Frame frame = new Frame(); + frame.setLayout(new BorderLayout()); + frame.setMinimumSize(new Dimension(width, height)); + frame.setBounds(x, y, width, height); + frame.add(glCanvas, BorderLayout.CENTER); + // frame.pack(); + frame.validate(); + if( !osxCALayerAWTModBug ) { + frame.setTitle(title); + } + } }); + } catch (Exception e) { + e.printStackTrace(); + Assert.assertNull(e); + } + + return glCanvas; + } + + protected Frame getFrame(GLAutoDrawable glad) { + Container p = ((Component)glad).getParent(); + while( null != p && !( p instanceof Frame ) ) { + p = p.getParent(); + } + return (Frame)p; + } + + @Override + protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) { + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + final int count = glads.length; + for(int i=0; i Not advised!"); + } else { + System.err.println("Info: Skip test: AWT + Exclusive!"); + return; + } + } + if( useAWTRenderThread && exclusive && !testExclusiveWithAWT) { + System.err.println("Skip test: AWT + Exclusive -> Not advised!"); + return; + } + final Thread awtRenderThread = getAWTRenderThread(); + final AnimatorBase animator = createAnimator(); + if( !useAWTRenderThread ) { + animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD); + } + final GLAutoDrawable[] drawables = new GLAutoDrawable[drawableCount]; + for(int i=0; i Platform.getJavaVersionNumber().compareTo(version170); + System.err.println("OSX CALayer AWT-Mod Bug "+osxCALayerAWTModBug); + System.err.println("OSType "+Platform.getOSType()); + System.err.println("Java Version "+Platform.getJavaVersionNumber()); + + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + awtEDT = Thread.currentThread(); + } } ); + } catch (Exception e) { + e.printStackTrace(); + Assert.assertNull(e); + } + + } + + @AfterClass + public static void releaseClass00AWT() { + } + + @Override + protected boolean isAWTTestCase() { return true; } + + @Override + protected Thread getAWTRenderThread() { + return awtEDT; + } + + @Override + protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, GLCapabilitiesImmutable caps) { + final GLCanvas glCanvas = new GLCanvas(); + + // FIXME: Below AWT layouts freezes OSX/Java7 @ setVisible: Window.setVisible .. CWrapper@NSWindow.isKeyWindow + // final Dimension sz = new Dimension(width, height); + // glCanvas.setMinimumSize(sz); + // glCanvas.setPreferredSize(sz); + // glCanvas.setSize(sz); + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + final Frame frame = new Frame(); + frame.setLayout(new BorderLayout()); + frame.setMinimumSize(new Dimension(width, height)); + frame.setBounds(x, y, width, height); + frame.add(glCanvas, BorderLayout.CENTER); + // frame.pack(); + frame.validate(); + if( !osxCALayerAWTModBug ) { + frame.setTitle(title); + } + } }); + } catch (Exception e) { + e.printStackTrace(); + Assert.assertNull(e); + } + + return glCanvas; + } + + protected Frame getFrame(GLAutoDrawable glad) { + Container p = ((Component)glad).getParent(); + while( null != p && !( p instanceof Frame ) ) { + p = p.getParent(); + } + return (Frame)p; + } + + @Override + protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) { + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + final int count = glads.length; + for(int i=0; i