diff options
-rw-r--r-- | jnlp-files/jogl-applet-bug816_glcanvas02a.html (renamed from jnlp-files/jogl-applet-bug816_glcanvas02.html) | 8 | ||||
-rw-r--r-- | jnlp-files/jogl-applet-bug816_glcanvas02b.html | 32 | ||||
-rw-r--r-- | jnlp-files/jogl-applet-bug848_glcanvas01.html | 4 | ||||
-rw-r--r-- | jnlp-files/jogl-test-applets.html | 4 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java | 6 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java (renamed from src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02.java) | 17 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java | 89 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java | 14 |
8 files changed, 157 insertions, 17 deletions
diff --git a/jnlp-files/jogl-applet-bug816_glcanvas02.html b/jnlp-files/jogl-applet-bug816_glcanvas02a.html index f4958ec1b..79fb22d76 100644 --- a/jnlp-files/jogl-applet-bug816_glcanvas02.html +++ b/jnlp-files/jogl-applet-bug816_glcanvas02a.html @@ -11,14 +11,14 @@ Bug816 OSX CALayer Pos - Box Layout <P> <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" - width="600" height="300"> - <param name="code" value="com.jogamp.opengl.test.junit.jogl.demos.es2.awt.Bug816AppletGLCanvas02"> + width="664" height="364"> + <param name="code" value="com.jogamp.opengl.test.junit.jogl.demos.es2.awt.Bug816AppletGLCanvas02a"> <param name="archive" value="jar/lib/gluegen-rt.jar, jar/lib/jogl-all.jar, jar/jogl-test.jar"> <comment> - <embed code="com.jogamp.opengl.test.junit.jogl.demos.es2.awt.Bug816AppletGLCanvas02" - width="600" height="300" + <embed code="com.jogamp.opengl.test.junit.jogl.demos.es2.awt.Bug816AppletGLCanvas02a" + width="664" height="364" type="application/x-java-applet;version=1.6" archive="jar/gluegen-rt.jar, jar/jogl-all.jar, diff --git a/jnlp-files/jogl-applet-bug816_glcanvas02b.html b/jnlp-files/jogl-applet-bug816_glcanvas02b.html new file mode 100644 index 000000000..eb05e84a5 --- /dev/null +++ b/jnlp-files/jogl-applet-bug816_glcanvas02b.html @@ -0,0 +1,32 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html> +<head> +<title>Bug816 OSX CALayer Pos - Grid Layout</title> +</head> +<body BGCOLOR="#ffffff"> + +<P> +Bug816 OSX CALayer Pos - Grid Layout +</P> + +<P> +<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" + width="664" height="364"> + <param name="code" value="com.jogamp.opengl.test.junit.jogl.demos.es2.awt.Bug816AppletGLCanvas02b"> + <param name="archive" value="jar/lib/gluegen-rt.jar, + jar/lib/jogl-all.jar, + jar/jogl-test.jar"> + <comment> + <embed code="com.jogamp.opengl.test.junit.jogl.demos.es2.awt.Bug816AppletGLCanvas02b" + width="664" height="364" + type="application/x-java-applet;version=1.6" + archive="jar/gluegen-rt.jar, + jar/jogl-all.jar, + jar/jogl-test.jar"> + <noembed>Sorry, no Java support detected.</noembed> + </embed> + </comment> +</object> +</P> +</body> +</html> diff --git a/jnlp-files/jogl-applet-bug848_glcanvas01.html b/jnlp-files/jogl-applet-bug848_glcanvas01.html index bc6e90dc2..99fa6aa4d 100644 --- a/jnlp-files/jogl-applet-bug848_glcanvas01.html +++ b/jnlp-files/jogl-applet-bug848_glcanvas01.html @@ -11,14 +11,14 @@ Bug 848: Applet on OSX w/ CALayer and 2 or more GLCanvas may 'crash'. <P> <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" - width="900" height="600"> + width="1024" height="664"> <param name="code" value="com.jogamp.opengl.test.junit.jogl.demos.es2.awt.Bug848AppletGLCanvas01"> <param name="archive" value="jar/lib/gluegen-rt.jar, jar/lib/jogl-all.jar, jar/jogl-test.jar"> <comment> <embed code="com.jogamp.opengl.test.junit.jogl.demos.es2.awt.Bug848AppletGLCanvas01" - width="900" height="600" + width="1024" height="664" type="application/x-java-applet;version=1.6" archive="jar/gluegen-rt.jar, jar/jogl-all.jar, diff --git a/jnlp-files/jogl-test-applets.html b/jnlp-files/jogl-test-applets.html index 5f60076bf..be0a5be81 100644 --- a/jnlp-files/jogl-test-applets.html +++ b/jnlp-files/jogl-test-applets.html @@ -205,11 +205,13 @@ Misc tests: <li>Bug 816 - OSX CALayer Positioning Bug <ul> <li><a href="jogl-applet-bug816_glcanvas01.html">01: Custom bounds within applet</a></li> - <li><a href="jogl-applet-bug816_glcanvas02.html">02: Box layout within applet</a></li> + <li><a href="jogl-applet-bug816_glcanvas02a.html">02a: Box layout within applet</a></li> + <li><a href="jogl-applet-bug816_glcanvas02b.html">02b: Grid layout within applet</a></li> </ul></li> <li>Misc Issues <ul> <li><a href="jogl-applet-bug818_gljpanel01.html">Bug 818: OSX 10.6.8 NV GT 330M GLJPanel Crash</a></li> + <li><a href="jogl-applet-bug848_glcanvas01.html">Bug 848: Applet on OSX w/ CALayer and 2 or more GLCanvas may crash</a></li> </ul></li> </ul> </p> diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java index 83a129455..c7153840f 100644 --- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java +++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java @@ -252,9 +252,9 @@ public class JOGLNewtApplet1Run extends Applet { System.err.println("GLWindow: "+glWindow); } base.start(); - if( null != newtCanvasAWT && - newtCanvasAWT.isOffscreenLayerSurfaceEnabled() && - 0 != ( JAWTUtil.JAWT_OSX_CALAYER_QUIRK_POSITION & JAWTUtil.getOSXCALayerQuirks() ) ) { + if( null != newtCanvasAWT && + newtCanvasAWT.isOffscreenLayerSurfaceEnabled() && + 0 != ( JAWTUtil.JAWT_OSX_CALAYER_QUIRK_POSITION & JAWTUtil.getOSXCALayerQuirks() ) ) { // force relayout final int cW = newtCanvasAWT.getWidth(); final int cH = newtCanvasAWT.getHeight(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java index 161f05c8d..3bbb423fd 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java @@ -46,18 +46,19 @@ import com.jogamp.opengl.util.Animator; * </p> */ @SuppressWarnings("serial") -public class Bug816AppletGLCanvas02 extends Applet { +public class Bug816AppletGLCanvas02a extends Applet { GLAnimatorControl animator; + boolean added = false; @Override public void init() { - System.err.println("GearsApplet: init() - begin"); + System.err.println("GearsApplet: init() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); animator = new Animator(); new BoxLayout(this, BoxLayout.X_AXIS); - setSize(600, 300); + setSize(664, 364); add(createCanvas()); add(createCanvas()); - System.err.println("GearsApplet: init() - end"); + System.err.println("GearsApplet: init() - end [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); } private GLCanvas createCanvas() { @@ -68,13 +69,21 @@ public class Bug816AppletGLCanvas02 extends Applet { return canvas; } + String currentThreadName() { + return Thread.currentThread().getName(); + } + @Override public void start() { + System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); animator.start(); + animator.setUpdateFPSFrames(60, System.err); + System.err.println("GearsApplet: start() - end [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); } @Override public void stop() { + System.err.println("GearsApplet: stop() - [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); animator.stop(); } } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java new file mode 100644 index 000000000..87a7ea4f5 --- /dev/null +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java @@ -0,0 +1,89 @@ +/** + * 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.demos.es2.awt; + +import java.applet.Applet; +import java.awt.GridLayout; + +import javax.media.opengl.GLAnimatorControl; +import javax.media.opengl.awt.GLCanvas; + +import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; +import com.jogamp.opengl.util.Animator; + +/** + * Bug 816: OSX CALayer Positioning Bug. + * <p> + * Diff. OSX CALayer positioning w/ java6, [7uxx..7u40[, and >= 7u40 + * </p> + * <p> + * Test uses a grid layout within the Applet. + * </p> + */ +@SuppressWarnings("serial") +public class Bug816AppletGLCanvas02b extends Applet { + GLAnimatorControl animator; + boolean added = false; + + @Override + public void init() { + System.err.println("GearsApplet: init() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); + animator = new Animator(); + this.setLayout(new GridLayout(1, 2)); + setSize(664, 364); + add(createCanvas()); + add(createCanvas()); + System.err.println("GearsApplet: init() - end [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); + } + + private GLCanvas createCanvas() { + GLCanvas canvas = new GLCanvas(); + canvas.addGLEventListener(new GearsES2(1)); + canvas.setSize(300, 300); + animator.add(canvas); + return canvas; + } + + String currentThreadName() { + return Thread.currentThread().getName(); + } + + @Override + public void start() { + System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); + animator.start(); + animator.setUpdateFPSFrames(60, System.err); + System.err.println("GearsApplet: start() - end [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); + } + + @Override + public void stop() { + System.err.println("GearsApplet: stop() - [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); + animator.stop(); + } +} diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java index 7b7b4e4c4..89e31cfe9 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java @@ -50,16 +50,16 @@ public class Bug848AppletGLCanvas01 extends Applet { @Override public void init() { - System.err.println("GearsApplet: init() - begin"); + System.err.println("GearsApplet: init() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); new BoxLayout(this, BoxLayout.X_AXIS); - setSize(900, 600); + setSize(1024, 664); add(createCanvas()); add(createCanvas()); add(createCanvas()); add(createCanvas()); add(createCanvas()); add(createCanvas()); - System.err.println("GearsApplet: init() - end"); + System.err.println("GearsApplet: init() - end [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); } private GLCanvas createCanvas() { @@ -70,15 +70,23 @@ public class Bug848AppletGLCanvas01 extends Applet { return canvas; } + String currentThreadName() { + return Thread.currentThread().getName(); + } + @Override public void start() { + System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); for (GLAnimatorControl control : animators) { control.start(); + control.setUpdateFPSFrames(60, System.err); } + System.err.println("GearsApplet: start() - end [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); } @Override public void stop() { + System.err.println("GearsApplet: stop() - [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName()); for (GLAnimatorControl control : animators) { control.stop(); } |