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

Changes

Summary

  1. - Fix GLProcAddressResolver regression: Use GLProcAddressResolver ! (details)
  2. NEWT: Fix AWT Parenting ; Multithreading Issues ; Semantics: destroy(), (details)
  3. Fix: Locking/Threading; Common IntIntHashMap and Buffers; Fix: (details)
  4. GLAutoDrawable: setAnimator/getAnimator/invoke/display changes; NEWT: (details)
  5. GLAutoDrawable: setAnimator/getAnimator/invoke/display changes; NEWT: (details)
  6. NEWT: Changed Lifecycle of Display/Screen (part 2) (details)
  7. NEWT: Fix Display/Window/Screen OO Identity, Reparenting and (details)
  8. RecursiveToolkitLock default TO 5s (details)
  9. Fix: NativeWindow RecursiveToolkitLock, GLWindow (details)
  10. Fix RecursiveToolkitLock: Implement complete fair FIFO scheduler (details)
  11. RecursiveToolkitLock relocation to gluegen finished (details)
  12. Added TestRecursiveToolkitLock; junit.run: disable inner classes in (details)
  13. fix runtest.sh scripts (details)
  14. Moved locking to: com.jogamp.common.util.locks ; Better abstraction ; (details)
  15. New jogamp.common.util.ArrayHashSet, providing O(1) queries/add and (details)
  16. ArrayHashSet: Add 'getOrAdd(key)' identity method to conveniently get (details)
  17. ArrayHashSet: List toList() -> ArrayList toArrayList() (details)
  18. RecursiveLock: TRACE_LOCK: StackTrace -> err.println (details)
Commit ed254acfa7474877cded7ea14588d0cc8d08ef67 by Sven Gothel
- Fix GLProcAddressResolver regression: Use GLProcAddressResolver !

- X11GLXDrawableFactory:
    - Move shared resource creation/destruction into it's own thread
    - Remove the ATI hack (no XDisplay closing) for every Display,
      this is only necessary for the shared XDisplay and in case of AWT.

- Newt
    - Display: Only pumpMessages if device is ready.
    - X11Display: Verify handle not null at DispatchMessage.

- Common recursive ToolkitLock implementation, from
    src/nativewindow/classes/com/jogamp/nativewindow/impl/LockingNativeWindowFactory.java and
    src/newt/classes/com/jogamp/newt/Window.java,
    -> com.jogamp.nativewindow.impl.RecursiveToolkitLock

- Unique XLockDisplay/XUnlockDisplay call via X11Util to simplify debugging.
  X11Util: Added debug code for XLockDisplay/XUnlockDisplay.
           Added fast LongObjectHashMap
           Added static lib loading and initialization.
           Removed active and passive list, as well as unused methods,
           to easy maintenance. Possible since the only 'uncloseable' Display
           might be the shareable one.
- X11Lib: Added static initialization via X11Util

Test:
    junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGears*
        - Add WindowListener for quit ..
The file was addedsrc/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java (diff)
Commit c069735eb68ed0871d4e677ff6a89de0bd32731d by Sven Gothel
NEWT: Fix AWT Parenting ; Multithreading Issues ; Semantics: destroy(), .. ; Misc.

Due to incapabilities of the previous AWT/NEWT reparenting
the implementation and spec had to be changed to support this feature.
See the first 2 comments below.

- Tested on GNU/Linux (OK), Windows (a few bugs left)
-

TODO:
    - Clarify the size/layout issue, ie who is responsible etc
      In the test, incl AWT/NEWT, we set the size on the GLWindow
      and ie pack the AWT Frame.

    - Fix remaining [Windows] bugs ..

    - Fix/Implement MacOSX port ..

Fix AWT/NEWT reparenting:
===========================

- Now NewtFactory's createWindow() method for parenting handles NativeWindow only
  and is no more responsible for creating a child window upon an AWT Component.
  See class com.jogamp.newt.awt.NewtCanvasAWT for NEWT/AWT parenting.

- New com.jogamp.newt.awt.NewtCanvasAWT, responsible for handling
  AWT's reparent events via addNotify/removeNotify.
  Reparenting is implemented via the new NEWT Window's reparentWindow() method.
  Also sets the background erase to false, if supported.

- Fix zero size semantics in Window (setSize/setVisible)
  Since a zero size window is not supported by many compoenent (Windowing system, OpenGL, ..)
  we use the visibility methodology to not show a 0x0 window. See Javadoc.
  AWT components may start with zero size.

- New NEWT Window: reparentWindow(NativeWindow newParent, Screen newScreen)
  Allowing to change the parent of a window. Similar with the fullscreen toggle,
  but without size/position change.
  Native reparenting allows to keep alive the native
  window while changing the container, hence it is preferred to a destroy/create cycle.
  To benefit from the native reparenting, a NEWT implementation has to implement
    'protected boolean reparentWindowImpl(long newWindowHandle)'
  and return true, otherwise reparenting will be 'emulated' via
  the expensive destroy/create cycle.

- NEWT's Window references all of it's children, if any

- NEWT's Window propagates setVisible/destroy actions to it's children.

- Fix NEWT's destroy() semantics.
  A call of destroy() or destroy(false) shall only result in the destruction of the
  native window (handle) nothing more. A subsequent setVisible(true) shall allow
  the complete recreation of the Window into a usable state.
    A call of destroy(true) destroys all resources the Window holds,
  may include Screen/Display and OpenGL resources in case of GLWindow.
  This is necessary to allow proper reparenting, where a native window may become
  destroyed, but should be recreated via setVisible(true) later on.

- Fix NEWT set[Size|Position|Fullscreen|Visible] synchronization.
  Use a recursive lock instead of the Window instance, otherwise arbitrary Window access
  via AWT's EDT, NEWT's EDT or other threads can block.
  Also removed a use pattern like:
    key.lock()
    try {
        EDT.invoke(action());
    } finally {
        key.unlock();
    }
  Where action() itself uses the same lock object (here key), the result is a deadlock.

NativeWindow Changes:
======================

- We can use XInitThreads() now (concurrent threading support)
  in combination with AWT.
  Might have been some async in our NEWT locking in regards to AWT (sync()),
  and the X11 Display changes made in c787f50d77e2491eb0d8201d534a6fa4885a929e.

- NativeWindow's window handle is _not_ transient like surface handle,
  fixed documentation.

JOGL Changes:
=============

- New 'isRealized()' method in GLDrawable.

-
Misc Fixes
============
- Fix NEWT set[Size|Position|Fullscreen|Visible] duplicate code
  Due to pure abstract signatures, the set[Size|Position|Fullscreen|Visible]
  implementations of X11, OSX, .. contained duplicate code and state handling (size, pos, ..).
  These are now decoupled, ie generic set[Size|Position|Fullscreen|Visible] implementations
  calling simple set[Size|Position|Fullscreen|Visible]Impl implementations.

- Fix NEWT: Renamed setAutoDrawableClient(boolean) to setHandleDestroyNotify(boolean)
  The semantic of
    setAutoDrawableClient(boolean) defaults to false
  was too complicated and specific, hence changed to
    setHandleDestroyNotify(boolean) defaults to true
  since its more clear and the name refers the window itself..

- Fix NEWT: Removed GLWindow's unused global window list

- Fix NEWT: Remove Window's unused event mask

- Rename com.jogamp.newt.impl.awt.AWTNewtFactory -> com.jogamp.newt.awt.NewtFactoryAWT
The file was modified src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java (diff)
Commit 4c9d40cbb94ddbbc11fec4451e7efe268d96c4be by Sven Gothel
Fix: Locking/Threading; Common IntIntHashMap and Buffers; Fix: glMap*Buffer*; GLX/WGL/CgGL: All runtime dynamic; Misc ..

TODO: Compile and test on MacOSX ..

Fix:
=====

Multithreading/Locking:
    See jogl/doc/Implementation/MultiThreading.txt

    - Locking layer is not platform agnostic, ie GLContextImpl, GLDrawableImpl, ..
      and NEWT: Window/Display
    - No more use of JAWT global lock necessary, removed.
    - No need for X11 Display lock, on the contrary,
      this made the NV driver hang.
    - Use common window/surface lock
    - All NativeWindow surfaceLock's are recursive now

glMapBuffer: If size is 0, don't do cont with the native call.
glMapBufferRange: Fix capacity.
glNamedBufferDataEXT: Track the size.
glMapNamedBufferEXT: Manual impl. - use the tracked size

glXGetVisualFromFBConfig, glXChooseFBConfig, glXChooseVisual: Instead of
ignoring and implement a renamed version (*Copied), we just use ManualImplementation
for the proper copy-result code.

DesktopGLDynamicLookupHelper: Initialize _hasGLBinding* attributes
in the determing loadGLJNILibrary() method, which is called by super().
Otherwise static init will overwrite them after the super() call.

X11GLXDrawableFactory: Don't release anything at shutdown (removed sharedContext.destroy()),
since this caused a freeze/SEGV sometimes.

Fixed NEWT's reparentWindow() functionality incl NewtCanvasAWT usage.
    - Native: if not visible, don't focus, etc
    - NewtCanvasAWT: Use the container size to start with
    - Run the command on the EDT

Using GlueGen's new DynamicLibraryBundle utility:
  - X11, Windows and MacOSX OpenGL adapted to DynamicLibraryBundleInfo.
  - X11GLXDynamicLookupHelper -> X11GLXDynamicLibraryBundleInfo
    - Remove all path from lib names.
    - GL order:  libGL.so.1, libGL.so, GL
    - shallLinkGlobal: true -> to server some 'old' DRI systems
        -> http://dri.sourceforge.net/doc/DRIuserguide.html
    - shallLookupGlobal: false
    - Try both : glXGetProcAddressARB and glXGetProcAddress
    - Using bootstrap: GLX.glXGetProcAddress(long glxGetProcAddressHandle, String glFuncName)

Found the issue with LIBGL_DRIVERS_PATH, ie if not set
no valid GL instance can be found (ie ATI fglrx/DRI).
This may happen if using a differen user than the desktop user
for whom the env var is set within some /etc/X11/Xsession.d/ script.

Enhancements:
=============

GLBufferSizeTracker: Use IntIntHashMap and add DirectState size tracking.
GLBufferStateTracker: Use IntIntHashMap.
GLStateTracker: Use IntIntHashMap.

GLDynamicLookupHelper: More generic (global loading/lookup and GetProcAddress function name list),
                       remove redundant code.
   FIXME:
    MacOSXCGLDynamicLookupHelper:
        - Not tested
        - Not using NSImage lookup anymore as recommended by OSX API Doc,
          so dlsym is used always (to be tested)

    WindowsWGLDynamicLookupHelper:
        - Not tested

GLX/WGL/CgGL is all runtime-dynamic as now, ie loaded and looked-up at runtime,
no compile time dependencies to GL anymore, nor a need to specify CgGL.

Split up WGL in GDI and WGL, to allow proper dynamic runtime linkage of OpenGL32
while using static binding to GDI32

NEWT events generated by native code are enqueued and not send directly.
This should ease locking mechanisms .. if any are necessary.

NEWT: More platform specific code moved to *Impl method,
simplifying the generic code of the superclass and impl protocol.

Cleanup:
=========

Replace all InternalBufferUtil's with com.jogamp.common.nio.Buffers

Removed all InternalBufferUtil's from repository

Removed GLContextImpl notion of 'optimized' surface locking,
where the surface gets unlocked during makeCurrent/release.
This just makes no sense and would impact multithreading in a horrible way.
The file was modified src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java (diff)
Commit e82d55e7ad9ec8ded84d8154d9e999655ce536c5 by Sven Gothel
GLAutoDrawable: setAnimator/getAnimator/invoke/display changes; NEWT: Adding native repaint; NewtCanvasAWT focus fix

Support for native repaint, which shall call display() in case no animator is running.
GLAutoDrawable invoke(GLRunnable) impl. handles case if invoked on animator thread,
or no animator thread is running (issueing a display() call).
The impl resides in GLDrawableHelper.

GLEventListener's init() and glViewport()/reshape() method must be called before the 1st display()
and after a dispose() call. It could miss the 1st display() call if added
after the setVisible(true) call - due to the native repainting.
The impl resides in GLDrawableHelper.

The Animator un-/registers itself at the GLAutoDrawable via setAnimator.

NEWT Window reparent always issues a resize() and display() call.

NEWT native Window uses direct send.*Event for input events (again),
instead of enqueueing it for performance.

NEWT Window implements all status change and Java native event callbacks,
instead of having duplicated code in all implementations.

NewtCanvasAWT if the Newt window is focused, the AWT/Swing component[s] will loose the focus.
The file was modified src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java (diff)
Commit 548f41754a66b556376e56a5abd568a41aeba828 by Sven Gothel
GLAutoDrawable: setAnimator/getAnimator/invoke/display changes; NEWT: Adding native repaint; Fix reparent/fullscreen

New: NEWT Native Repaint
=========================
Support for native repaint, which shall call display() in case no animator is running.
GLAutoDrawable invoke(GLRunnable) impl. handles case if invoked on animator thread,
or no animator thread is running (issueing a display() call).
The impl resides in GLDrawableHelper.

The Animator un-/registers itself at the GLAutoDrawable via setAnimator.

New: NEWT AWT/NEWT Parenting Focus Handling
============================================
Introducing Window.FocusRunnable, to be registered at the NEWT Window,
which will be executed before the native focus claim.
Window.FocusRunnable's run method returns a boolean,
which determines whether the native implementation shall proceed claiming the native focus.
This API focus hook is necessary to allow an optional underlying windowing toolkit,
ie AWT (see usage NewtCanvasAWT), to make the focus traversal transparent.

Fix: GLEventListener / GLDrawableHelper
========================================
GLEventListener's init() and glViewport()/reshape() method must be called before the 1st display()
and after a dispose() call. It could miss the 1st display() call if added
after the setVisible(true) call - due to the native repainting.
The impl resides in GLDrawableHelper.

Fix: Misc NEWT
==============
Window reparent issues a resize() and display() call, if it is visible.

native Window uses direct send.*Event for input events (again),
instead of enqueueing it for performance.

Window impl all status change native event Java callbacks, instead of having
duplicated code in all implementations.

Fullscreen, reposition at zero.

Reparent/Fullscreen repaint if visible.

Native reparent/fullscreen, fix glitches on Windows (visibility while reparenting)
The file was modified src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java (diff)
Commit 57c0095eb778dac3a7f413bede00e59b35b4069a by Sven Gothel
NEWT: Changed Lifecycle of Display/Screen (part 2)

Window Reparenting (unification):
    On the fly Display/Screen creation resides in NewtFactory.
    Reparenting logic within Window.
    Handles all reparenting cases now:
        ACTION_NONE, ACTION_SOFT_REPARENTING,
        ACTION_NATIVE_REPARENTING, ACTION_NATIVE_CREATION

- out.println -> err.println

++++

- Bumbed windows bat scripts to 1.6.0_21 and ant 1.8.1
- Debug: /RecursiveToolkitLock.java TO is 300s for now, while not finished.
-

+++

Needs more testing. Deadlocks: AWT/NEWT parenting.
The file was modified src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java (diff)
Commit 342e2031852f98b98f09441d1ef408a6180c5680 by Sven Gothel
NEWT: Fix Display/Window/Screen OO Identity, Reparenting and requestFocus

NativeWindow: Interface NativeWindow changes:
    - Remove 'throws' qualifier in lockSurface(), since it is not
    - Adding convenient 'one call' isSurfaceLockedByOtherThread()
    - Adding getSurfaceLockOwner()

NEWT Window/GLWindow:

- Unclutter Window/GLWindow relationship - save Window's indentity
    GLWindow's role is a GLAutoDrawable implementation aggregating
    (maybe even compositioning) a Window.

    The previous implementation just derived from the Window implementation,
    overwriting methods and fields - impossible to ensure sanity / completness.
    It was also not ensured that the added functionality of GLWindow
    (setVisible, destroy, ..) has been issued in case of handling the
    aggregated Window alone (window callbacks, ..).

    To solve this issue in a 1st attempt without changing the GLWindow API,
    Window is just an interface, being implemented by their specializations,
    hence sanity is intrinsic.

    GLWindow's added functionality is ensured by a Window.LifecycleHook
    interfaced implementation, registered at the aggregated Window.

    - Screen and Window are interfaces now (new files)

    - Display is an abstract class.

    - Their (abstract) implementations resides in impl/<BaseName>Impl

    - GLWindow implements Window as well

- Remove Screen reference handled by setScreen(Screen) method.

- Lock native parentWindow if used (createNative/reparenting)

- Move lockSurface/unlockSurface from unchecked override pattern
  to an callback style using abstract methods lockSurfaceImpl/...

- Sorting all methods to semantic sections, abstract, superinterface, ..

- Reparenting: Handling different reparenting situations:
    - Unchanged - No change
    - Native Reparenting - Compatible Display/Screen, try native reparenting
    - Native (Re)Creation - Use destroy/create pattern
    - Native Creation Pending - Create later

- setUndecorated() calls reconfigure Window now, ie tries to change the window actually

- Don't issue 'requestFocus()' directly from the native implementation anymore,
  call it from the Java code.

- Window/GLWindow/NewtFactory: Constructor simplification
    Avoid explosion of constructor overloading, ie removing the 'undecorated' variant,
    since this is redundant due to the 'setUndecorated(boolean)' method.

- Fixed/added API documentation
The file was modified src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java (diff)
Commit 8c85cdd4705cf3fad65e93093a7299d531e2f07e by Sven Gothel
RecursiveToolkitLock default TO 5s
The file was modified src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java (diff)
Commit 671695574b65b2a03c293dce2979b6e9972f35f2 by Sven Gothel
Fix: NativeWindow RecursiveToolkitLock, GLWindow lockSurface/unlockSurface

Fix: NativeWindow RecursiveToolkitLock
    - Use notify(), instead of notifyAll(), so only one thread is being awakened
      for the single resource. Otherwise starvation and timeout happen, since
      the oldest thread might not get waken up (earlier than other threads) within timeout.

    - Inner class for all synchronized (flow/mem) fields for easier fine grained sync/lock.

Fix: GLWindow lockSurface/unlockSurface
    - Enter locked surface block only if surface lock could be acquired
The file was modified src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java (diff)
Commit 0d19ad1b059339cec59aa794b95d38047be7ab3e by Sven Gothel
Fix RecursiveToolkitLock: Implement complete fair FIFO scheduler (wait-interrupt) using a LinkedList
The file was modified src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java (diff)
Commit 6527fa303dcf290f67ec624ca8326b995264514f by Sven Gothel
RecursiveToolkitLock relocation to gluegen finished
The file was removedsrc/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java (diff)
The file was addedsrc/java/com/jogamp/common/util/RecursiveToolkitLock.java (diff)
Commit 23b02e8cce05ed6020ed3eb1c8e23d0d83932379 by Sven Gothel
Added TestRecursiveToolkitLock; junit.run: disable inner classes in batch run
The file was modified make/build-junit.xml (diff)
The file was addedsrc/junit/com/jogamp/common/util/TestRecursiveToolkitLock.java (diff)
Commit 52dcea28906b3e61ef44595399e525dd5169c014 by Sven Gothel
fix runtest.sh scripts
The file was modified make/scripts/runtest.sh (diff)
Commit 1c7f8f8dafe0252afbb0e2701687210814b56793 by Sven Gothel
Moved locking to: com.jogamp.common.util.locks ; Better abstraction ; Misc changes
The file was removedsrc/java/com/jogamp/common/util/RecursiveToolkitLock.java (diff)
The file was modified make/build.xml (diff)
The file was modified src/java/com/jogamp/common/util/ReflectionUtil.java (diff)
The file was addedsrc/java/com/jogamp/common/util/locks/Lock.java (diff)
The file was addedsrc/java/com/jogamp/common/util/locks/RecursiveLock.java (diff)
The file was addedsrc/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java (diff)
The file was modified make/scripts/runtest.sh (diff)
The file was modified src/java/com/jogamp/common/os/Platform.java (diff)
The file was addedsrc/java/com/jogamp/common/util/locks/LockExt.java (diff)
The file was modified src/java/com/jogamp/common/impl/Debug.java (diff)
The file was removedsrc/junit/com/jogamp/common/util/TestRecursiveToolkitLock.java (diff)
Commit 68d1b38046e1c40bc937ba17ed9aac6e99f608b8 by Sven Gothel
New jogamp.common.util.ArrayHashSet, providing O(1) queries/add and identity operations
The file was modified make/scripts/runtest.sh (diff)
The file was addedsrc/junit/com/jogamp/common/util/TestArrayHashSet01.java (diff)
The file was modified src/junit/com/jogamp/common/util/locks/TestRecursiveLock01.java (diff)
The file was addedsrc/java/com/jogamp/common/util/ArrayHashSet.java (diff)
The file was addedsrc/junit/com/jogamp/common/util/TestIteratorIndexCORE.java (diff)
Commit 03b9741af9d3088afe6833553be54b14469922fc by Sven Gothel
ArrayHashSet: Add 'getOrAdd(key)' identity method to conveniently get the identity or add it, if not exist yet
The file was modified src/java/com/jogamp/common/util/ArrayHashSet.java (diff)
The file was modified src/junit/com/jogamp/common/util/TestArrayHashSet01.java (diff)
Commit 1618adf71b6510dd35c1aef3b1b280831d4b4c97 by Sven Gothel
ArrayHashSet: List toList() -> ArrayList toArrayList()
The file was modified src/java/com/jogamp/common/util/ArrayHashSet.java (diff)
Commit c7c61c8d4032afc74932ebb755a7d8567300f223 by Sven Gothel
RecursiveLock: TRACE_LOCK: StackTrace -> err.println
The file was modified src/java/com/jogamp/common/util/locks/RecursiveLock.java (diff)