Skip to content
The Jenkins Controller is preparing for shutdown. No new builds can be started.
Unstable

Changes

Summary

  1. MacOSXCGLContext[NSOpenGLLayer/NSView]: Propagate drawable change (details)
  2. GLAutoDrawable: Fix GLEventListener lifecycle and expose more user (details)
  3. FPSAnimator: Wait '2 x period' or 20ms, whichever is greater in case of (details)
  4. GLDrawableUtil.swapGLContextAndAllGLEventListener(..): Add glFinish() (details)
  5. Adding Andres Colubri's Test Case (junit'fyed), which provokes a (details)
  6. TestGLCanvasAWTActionDeadlock01AWT -> (details)
  7. TestGLCanvasAWTActionDeadlock00AWT: Remove redundant argument (details)
  8. TestGLCanvasAWTActionDeadlock01AWT: Reproducing OSX deadlock variation, (details)
  9. Analyzed OSX Deadlock w/ AWT Applet & CALayer: Andres Colubri's Test (details)
  10. GLAutoDrawable: Refine API change of commit (details)
  11. TestGLCanvasAWTActionDeadlock0[01]AWT: Disable 'restart' test on current (details)
  12. Fix GLDrawableHelper.recreateGLDrawable(..): Sync GL command stream (details)
Commit 808c8da0729b845d010d3f5e0babf1fc6129c3e9 by Sven Gothel
MacOSXCGLContext[NSOpenGLLayer/NSView]: Propagate drawable change

Propagate drawable change to MacOSXCGLContext where either context/NSView or context/NSOpenGLLayer
association needs to get updated.

Fixes drawable/context switch.
The file was modifiedsrc/jogl/native/macosx/MacOSXWindowSystemInterface-calayer.m (diff)
The file was modifiedsrc/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java (diff)
The file was modifiedmake/stub_includes/opengl/macosx-window-system.h (diff)
The file was modifiedsrc/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java (diff)
The file was modifiedsrc/jogl/native/macosx/MacOSXWindowSystemInterface.m (diff)
The file was modifiedsrc/nativewindow/classes/javax/media/nativewindow/OffscreenLayerSurface.java (diff)
The file was modifiedsrc/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java (diff)
Commit c002e04f848116922a1ed7bd96ead54961649bbd by Sven Gothel
GLAutoDrawable: Fix GLEventListener lifecycle and expose more user control (API Change) ; Added GLDrawableUtil

A GLEventListener resides in two states, initialized and uninitialized.
When added to a GLAutoDrawable, it is uninitialized.
A first 'display()' will issue GLEventListener's 'init(..)' which renders it initialized.
This is usually accompanied by 'reshape(..)' propagating the drawable's dimension.

Destruction of the GLAutoDrawable will issue GLEventListener's 'dispose(..)' which renders it uninitialized.

It turns our these means of GLEventListener controls are not sufficient in case
the user requires to remove and add them during the lifecycle and rendering of their GLAutoDrawable host.
GLAutoDrawable 'removeGLEventListener(..)' merely removes the GLEventListener from the list,
but does not complete it's lifecycle, i.e. issues 'dispose(..)' if initialized to realease GL related resources.

Hence the following essential API changes are made to complete the lifecycle:

+  public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove);

   disposing a single GLEventListener, allowing it's removal from the list being optional

This is demonstrated via GLDrawableUtil.swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b), see below.

++++++++

Further more the following API changes were made to expose complete control of
GLEventListener to the user:

-  public void removeGLEventListener(GLEventListener listener);
+  public GLEventListener removeGLEventListener(GLEventListener listener);

   The return value allows simple pipelining, and also delivers information whether
   the passed listener was actually removed.

-  public GLEventListener removeGLEventListener(int index) throws IndexOutOfBoundsException;
+  public int getGLEventListenerCount();
+  public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException;

   Dropping the redundant removal by index, while adding count and get methods.

+  public boolean getGLEventListenerInitState(GLEventListener listener);
+  public void setGLEventListenerInitState(GLEventListener listener, boolean initialized);

   Allows retrieving and setting of listener states.

All in all these API changes allows a user to experience all freedoms in dealing w/
GLEventListeners hosted by GLAutoDrawable impl. and shall be future proof.

Note that we have avoided the Iterator pattern due to it's overhead of temporal objects creation.
The simple indexed access allows us to implement each method as an atomic operation.

+++++++++++

Further more a simple enqueue(..) method has been added, allowing to just enqueue a GLRunnable
w/o provoking it's execution - as invoke(..) does.
This method pleases a use case where GLRunnables are batched and shall be executed later on..

   public boolean invoke(boolean wait, GLRunnable glRunnable);
+  public void enqueue(GLRunnable glRunnable);

+++++++++++

Added GLDrawableUtil, exposes utility function to rearrange GLEventListener, modifiy GLAutoDrawable, etc.

GLDrawableUtil.swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b)
is tested and demonstrated w/ TestGLContextDrawableSwitchNEWT.

Manually tested on X11, OSX and Windows.
The file was addedsrc/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java (diff)
The file was modifiedsrc/jogl/classes/javax/media/opengl/awt/GLCanvas.java (diff)
The file was modifiedsrc/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java (diff)
The file was modifiedsrc/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java (diff)
The file was modifiedsrc/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java (diff)
The file was modifiedmake/scripts/tests.sh (diff)
The file was modifiedsrc/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextDrawableSwitchNEWT.java (diff)
The file was modifiedsrc/jogl/classes/javax/media/opengl/GLAutoDrawable.java (diff)
The file was modifiedsrc/jogl/classes/jogamp/opengl/GLDrawableHelper.java (diff)
The file was modifiedsrc/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java (diff)
The file was modifiedsrc/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java (diff)
The file was modifiedsrc/jogl/classes/javax/media/opengl/awt/GLJPanel.java (diff)
The file was modifiedmake/scripts/tests-x64.bat (diff)
Commit 9cf42434eb58160e25c79613efca51f2fd4d6086 by Sven Gothel
FPSAnimator: Wait '2 x period' or 20ms, whichever is greater in case of pause/stop - taking execution frequency into account
The file was modifiedsrc/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java (diff)
Commit b51cab4a8bcf8d9256e39657369510e39d22f162 by Sven Gothel
GLDrawableUtil.swapGLContextAndAllGLEventListener(..): Add glFinish() before and after ctx/drawable swap - sync'ing GL state

Otherwise a driver crash may occur on Windows/NVidia.
The file was modifiedsrc/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java (diff)
Commit 77db6a5c22cb4a53cf911b4caf57127770c70968 by Sven Gothel
Adding Andres Colubri's Test Case (junit'fyed), which provokes a Deadlock on OSX - Adding a similar one w/o deadlock and less framework bits.

Andres Colubri reported a test case in the forum:
  <http://forum.jogamp.org/Thread-blocking-issue-with-AWT-but-not-NEWT-on-OSX-td4026674.html>

Which is now included as TestGLCanvasAWTActionDeadlock01AWT.
A similar w/ less framework bits and w/o dealock is also included as TestGLCanvasAWTActionDeadlock00AWT.

A followup commit will incl. a fix after further analysis.

A commit at this point where TestGLCanvasAWTActionDeadlock01AWT still freezes on OSX is done
to be able to reproduce the bug and see the fix as a patch.
The file was modifiedmake/scripts/tests-x64.bat (diff)
The file was modifiedmake/scripts/tests.sh (diff)
The file was addedsrc/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java (diff)
The file was addedsrc/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java (diff)
Commit dc3aa7bdd7fd2afb2301e8813d8a5e7a1f87c4f2 by Sven Gothel
TestGLCanvasAWTActionDeadlock01AWT -> TestGLCanvasAWTActionDeadlock02AWT; To add another intermediate unit test for analysis
The file was addedsrc/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java (diff)
The file was removedsrc/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java (diff)
Commit 5e46e5c24a3c35d17fa51b7790889dc1ca0756f8 by Sven Gothel
TestGLCanvasAWTActionDeadlock00AWT: Remove redundant argument
The file was modifiedsrc/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java (diff)
Commit 0b3f9ee017f7216ec9ff37c16bbb44848aa5cfa5 by Sven Gothel
TestGLCanvasAWTActionDeadlock01AWT: Reproducing OSX deadlock variation, using Applet as component which provokes offscreen FBO layer.
The file was modifiedmake/scripts/tests.sh (diff)
The file was modifiedmake/scripts/tests-x64.bat (diff)
The file was addedsrc/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java (diff)
Commit 3a00361952120f8127a3014623de703ac696e036 by Sven Gothel
Analyzed OSX Deadlock w/ AWT Applet & CALayer: Andres Colubri's Test Case, Commit 77db6a5c22cb4a53cf911b4caf57127770c70968

[1] - The AWT/Applet test case on OSX utilized offscreen CALayer, which is correct.
[2] - the GLEventListener.display(..) method calls Frame.setTitle(".."); which is correct,
      but freezes when called right after GLEventListener.init(..)

BUG on OSX/CALayer: If frame.setTitle() is issued right after initialization
the call hangs in
   at apple.awt.CWindow._setTitle(Native Method)
   at apple.awt.CWindow.setTitle(CWindow.java:765) [1.6.0_37, build 1.6.0_37-b06-434-11M3909]

Happens w/ Oracle's JRE7u9 as well!

Workaround:
- Set 'justInitialized' flag in GLEventListener.init(..)
- Clear 'justInitialized' flag in GLEventListener.display(..) at the end
- Skip Frame.setTitle(..) in GLEventListener.display(..) if 'true == justInitialized'

Somebody may send a bugreport to Oracle / OpenJDK.
The file was modifiedsrc/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java (diff)
The file was modifiedmake/scripts/tests.sh (diff)
The file was modifiedsrc/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java (diff)
Commit 8c78f80f205345fe43ec2639e648421ef0134e57 by Sven Gothel
GLAutoDrawable: Refine API change of commit c002e04f848116922a1ed7bd96ead54961649bbd

As suggested by Julien Gouesse, align 'enqueue(..)' method w/ 'invoke(..)':

-  public void enqueue(GLRunnable glRunnable);

+  public boolean invoke(boolean wait, List<GLRunnable> glRunnables);
The file was modifiedsrc/jogl/classes/javax/media/opengl/awt/GLJPanel.java (diff)
The file was modifiedsrc/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java (diff)
The file was modifiedsrc/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java (diff)
The file was modifiedsrc/jogl/classes/javax/media/opengl/awt/GLCanvas.java (diff)
The file was modifiedsrc/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextDrawableSwitchNEWT.java (diff)
The file was modifiedsrc/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java (diff)
The file was modifiedsrc/jogl/classes/jogamp/opengl/GLDrawableHelper.java (diff)
The file was modifiedsrc/jogl/classes/javax/media/opengl/GLAutoDrawable.java (diff)
The file was modifiedmake/scripts/tests.sh (diff)
Commit 9e2563da5e40964d691fe9502de6c9178f98bee0 by Sven Gothel
TestGLCanvasAWTActionDeadlock0[01]AWT: Disable 'restart' test on current (non AWT) thread - crashes on solaris (which is fine)

Modifying AWT components shall always happen on AWT-EDT anyways.
The file was modifiedsrc/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java (diff)
The file was modifiedsrc/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java (diff)
Commit b83b068c0f426f24a58e2bd9f52de9ebd0c7876d by Sven Gothel
Fix GLDrawableHelper.recreateGLDrawable(..): Sync GL command stream before destruction of drawable

Lack of finishing the GL command stream lead to a SIGSEGV on Windows w/ Nvidia driver
where probably pending GL commands were still being processed concurrently.
The file was modifiedmake/scripts/tests-x64.bat (diff)
The file was modifiedsrc/jogl/classes/jogamp/opengl/GLDrawableHelper.java (diff)
The file was modifiedmake/scripts/java-win64-dbg.bat (diff)
The file was modifiedmake/scripts/java-win64.bat (diff)
The file was modifiedmake/scripts/tests.sh (diff)