Jogamp
jogl.git
3 years agoMerge remote-tracking branch 'ausenco/master' v2.1.3
Sven Gothel [Thu, 12 Dec 2013 04:53:35 +0000 (05:53 +0100)]
Merge remote-tracking branch 'ausenco/master'

3 years agoBug 918: Fix EOS Regression: Only use pts>duration for EOS if duration > 0 (camera...
Sven Gothel [Wed, 11 Dec 2013 20:09:59 +0000 (21:09 +0100)]
Bug 918: Fix EOS Regression: Only use pts>duration for EOS if duration > 0 (camera or other sources may not have duration)

Regression of commit 8a8ed735f6631b2da7bf605c5c3dda4e0fc13905

3 years agoALAudioSink: Fix stop and flush of OpenAL source
Sven Gothel [Wed, 11 Dec 2013 19:50:43 +0000 (20:50 +0100)]
ALAudioSink: Fix stop and flush of OpenAL source

- stopImpl() shall always issue alSourceStop(..) if state is not STOPPED
- Remove 'flush' hint for dequeueBuffer(..), we perform proper flush in respective method, see below
- flush() needs to issue:
   - stopImpl() - which should already dequeue all buffers
   - Explicitly dequeue all buffers: via 'alSourcei(alSource[0], AL.AL_BUFFER, 0)'
   - Then dequeue manually processed buffers: dequeueBuffer( false /* wait */ );
   - And dequeue _all_ buffers: dequeueForceAll();

3 years agoBug 918 (2/2): Determine StreamWorker usage after stream-init ; Fix seek(..) ; Fallba...
Sven Gothel [Wed, 11 Dec 2013 19:46:04 +0000 (20:46 +0100)]
Bug 918 (2/2): Determine StreamWorker usage after stream-init ; Fix seek(..) ; Fallback for EOS Detection ; MovieSimple uses full GLEventListener for 'Audio Only' as well to test seek

Determine StreamWorker usage after init
  - To support audio only files, we need to determine to use StreamWorker
after completion of stream-init.

Fix seek(..)
  - FFMPeg: pos0 needs to use aPTS for audio-only
  - Clip target time [0..duration[

Fallback for EOS Detection
  In case the backend does not report proper EOS:

  - Utilize 'nullFramesCount >= MAX' -> EOS,
    where MAX is number of frames for 3s play duraction
    and where 'nullFramesCount' is increased if no valid packet is available
    and no decoded-video or -audio in the queue.

  - Utilize pts > duration -> EOS

MovieSimple uses full GLEventListener for 'Audio Only' as well to test seek
  - Matroska seek for audio-only leads to EOS ..
    http://video.webmfiles.org/big-buck-bunny_trailer.webm

  - MP4 audio-only seek works
    http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4

MovieSimple/MovieCube:
  - Use audio-pts in audio-only to calc target time

Tested:
  - A, V and A+V
  - Pause, Stop and Seek
  - GNU/Linux

3 years agoBug 918: GLMediaPlayer: Fix Deadlock if EOS happens after pause/resume (seek) - Teste...
Sven Gothel [Wed, 11 Dec 2013 06:41:31 +0000 (07:41 +0100)]
Bug 918: GLMediaPlayer: Fix Deadlock if EOS happens after pause/resume (seek) - Tested w/ seeking 'Audio Only' and Matroska

Test stream was default of MovieSimple:
  http://video.webmfiles.org/big-buck-bunny_trailer.webm

while disabling video (-vid -2)

3 years agoBug 918 (1/2): Use StreamWorker in 'Audio Only' mode, since no 'getNextTexture(....
Sven Gothel [Wed, 11 Dec 2013 05:21:42 +0000 (06:21 +0100)]
Bug 918 (1/2): Use StreamWorker in 'Audio Only' mode, since no 'getNextTexture(..)' is issued here!

Thanks to Xerxes to analyze this issue thoroughly.

TODO: Implement EOS for 'Audio Only' and test seek, pause, etc .. - Apply manual tests in MovieSimple

3 years agoBug 922 (2/2): NEWT Window.reparentWindow(..): Use REPARENT_HINT_BECOMES_VISIBLE...
Sven Gothel [Wed, 11 Dec 2013 04:25:31 +0000 (05:25 +0100)]
Bug 922 (2/2): NEWT Window.reparentWindow(..): Use REPARENT_HINT_BECOMES_VISIBLE to ensure GL State Preservation ; Add unit test !

3 years agoBug 922 (1/2): NEWT Window.reparentWindow(..): Provide REPARENT_HINT_BECOMES_VISIBLE...
Sven Gothel [Wed, 11 Dec 2013 04:23:31 +0000 (05:23 +0100)]
Bug 922 (1/2): NEWT Window.reparentWindow(..): Provide REPARENT_HINT_BECOMES_VISIBLE hint via new method variant using hints; Deprecate other reparentWindow(..) variants w/o hints.

NEWT Window.reparentWindow(..): Provide REPARENT_HINT_BECOMES_VISIBLE hint via new method variant using hints:
  - Add REPARENT_HINT_FORCE_RECREATION, covering 'old' forceDestroyCreate boolean argument
  - Add REPARENT_HINT_BECOMES_VISIBLE, Claim window becomes visible after reparenting, which is important for e.g. preserving the GL-states in case window is invisible while reparenting.

Deprecate other reparentWindow(..) variants w/o hints.

Use only new variant using hints w/o semantical change.

3 years agoTestShutdownCompleteNEWT/AWT: Align both tests and account for GLInfo.
Sven Gothel [Tue, 10 Dec 2013 21:53:11 +0000 (22:53 +0100)]
TestShutdownCompleteNEWT/AWT: Align both tests and account for GLInfo.

3 years agoTestShutdownCompleteNEWT: Enhance profiling via '-wait -initOnly' ; Use Platform...
Sven Gothel [Tue, 10 Dec 2013 21:05:17 +0000 (22:05 +0100)]
TestShutdownCompleteNEWT: Enhance profiling via '-wait -initOnly' ; Use Platform.currentTimeMicros() for accuracy

ReflectionUtil usage:

TestShutdownCompleteNEWT -wait -initOnly

Hotspots:
   - MakeCurrent 5.3% - Called 52 times
   - ClassLoader.findClass(..) 3.1% - Called 486 times .
      - ReflectionUtil: 13 times ~ 0.3%

3 years agoBug 904: 'User Vertical Flip' for GLJPanel w/o vertical flip must be considered in...
Sven Gothel [Tue, 10 Dec 2013 20:27:14 +0000 (21:27 +0100)]
Bug 904: 'User Vertical Flip' for GLJPanel w/o vertical flip must be considered in AWTTilePainter: 'Origin of GL image is still on Bottom'

3 years agoBug 904: 'User Vertical Flip' for GLJPanel shall be performed via PROJECTION matrix...
Sven Gothel [Tue, 10 Dec 2013 20:24:17 +0000 (21:24 +0100)]
Bug 904: 'User Vertical Flip' for GLJPanel shall be performed via PROJECTION matrix scaling instead of MODELVIEW rotation ...

'User Vertical Flip' for GLJPanel shall be performed via PROJECTION matrix scaling instead of MODELVIEW rotation
to simplify workflow, and to remove artifacts w/ tiled printing.

3 years agoBug 747: VectorUtil: Make scale(..) creating new float[] deprecated, adding 'in place...
Sven Gothel [Tue, 10 Dec 2013 20:20:13 +0000 (21:20 +0100)]
Bug 747: VectorUtil: Make scale(..) creating new float[] deprecated, adding 'in place' variant w/ passing result float[] ; TODO: Replace all variations with 'in place' version to be more memory efficient.

Make scale(..) creating new float[] deprecated, adding 'in place' variant w/ passing result float[]

TODO: Replace all variations with 'in place' version to be more memory efficient.

See Bug747: Validate memory footprint and usage / General performance

3 years agojogl: update the entry for JaamSim to a better image, update link to homepage
Harvey Harrison [Mon, 9 Dec 2013 16:10:31 +0000 (08:10 -0800)]
jogl: update the entry for JaamSim to a better image, update link to homepage

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

3 years agoTestNewtKeyEventAutoRepeatAWT: Fix regression of commit 8512777873461ee33d8ed913ee26b...
Sven Gothel [Wed, 4 Dec 2013 14:59:59 +0000 (15:59 +0100)]
TestNewtKeyEventAutoRepeatAWT: Fix regression of commit 8512777873461ee33d8ed913ee26bafc00a08a02

3 years agoBug 919 - TestNewtKeyCodesAWT w/ NewtCanvasAWT Fails on Windows Due to Clogged Key...
Sven Gothel [Wed, 4 Dec 2013 06:51:30 +0000 (07:51 +0100)]
Bug 919 - TestNewtKeyCodesAWT w/ NewtCanvasAWT Fails on Windows Due to Clogged Key-Release Event by AWT Robot

Impact: Only unit test code

- TestNewtKeyCodesAWT:
  Fix Bug 919 - Move mouse bacl/forth while waiting for events ..

- Use common wait for key timeout/polling using constants in NEWTKeyUtil

- InputEventCountAdapter:
  'getQueued()' -> 'copyQueue()' - ensuring queue is copied while instance is locked.

3 years agoBug 914: Newt OSX: Reset NSApp's presentationOptions @ windowClose0() / Assume having...
Sven Gothel [Tue, 3 Dec 2013 20:54:57 +0000 (21:54 +0100)]
Bug 914: Newt OSX: Reset NSApp's presentationOptions @ windowClose0() / Assume having focus in fullscreen-mode

- Reset NSApp's presentationOptions @ windowClose0()

  Commit 69c334448cfe8af553fd97689137ecf8f996b378 started using the [NSApp setPresentationOptions: opts]
  but missed to reset to defaults @ windowClose0();

- Assume having focus in fullscreen-mode
  NewtMacWindow::windowDidBecomeKey()' is not always called in fullscreen-mode!

Note: OSX Fullscreen from a browser still shows the browser title-bar
until mouse-click. Don't know how to avoid this. Minor issue..

3 years agoBug 916 - NEWT Fullscreen Mode on Windows ALT-TAB doesn't allow Application Switching
Sven Gothel [Tue, 3 Dec 2013 03:08:36 +0000 (04:08 +0100)]
Bug 916 - NEWT Fullscreen Mode on Windows ALT-TAB doesn't allow Application Switching

Remedy for 'some' display drivers, i.e. Intel HD:
  Explicitly push fullscreen window to BOTTOM when inactive (ALT-TAB)

3 years agoNEWT Windows: Rearrange wndProc switch-case: All key/mouse events shall be at last
Sven Gothel [Mon, 2 Dec 2013 16:29:19 +0000 (17:29 +0100)]
NEWT Windows: Rearrange wndProc switch-case: All key/mouse events shall be at last

3 years agoBug 914: Newt OSX: Don't use exclusive fullscreen mode (captured display) in favor...
Sven Gothel [Mon, 2 Dec 2013 04:39:01 +0000 (05:39 +0100)]
Bug 914: Newt OSX: Don't use exclusive fullscreen mode (captured display) in favor of proper WM incl. ALT-TAB app-switching

3 years agoBug 914 - Don't allow 'alwaysontop' in fullscreen mode, always allow switching to...
Sven Gothel [Sun, 1 Dec 2013 22:22:17 +0000 (23:22 +0100)]
Bug 914 - Don't allow 'alwaysontop' in fullscreen mode, always allow switching to other applications via ALT-TAB

As described @ <http://forum.jogamp.org/Regression-of-alwaysOnTopBug-tp4030735p4030738.html>,
we shall not steal the desktop in fullscreen mode via 'alwaysontop'.

Latest tests on X11/GNU/Linux and Windows7 - before this patch:

With default settings, i.e. alwaysontop (atop) disabled,
it works as expected here, i.e.:
  - ALT-TAB triggers WM dialog, switching between apps.
  - ALT-TAB can actually switch to other apps.

However, with enabled atop:
  - ALT-TAB triggers WM dialog, switching between apps.
  - ALT-TAB does _not_ switch to other apps. (*)

I consider this a serious issue, since we shall not steal
the desktop in fullscreen mode.

This patch disables atop in fullscreen mode,
i.e. (*) will switch to other apps again!

3 years agoGLJPanel.initializeBackend(offthread=true): Enable on Windows, thanks to Bug 907...
Sven Gothel [Sun, 1 Dec 2013 19:05:01 +0000 (20:05 +0100)]
GLJPanel.initializeBackend(offthread=true): Enable on Windows, thanks to Bug 907 impl. DummyDispatchThread (DDT)

Bug 907 implemented DDT used to create and destroy offscreen surface's dummy drawable on Windows.
This enables offscreen initialization on Windows running from a short lived arbitrary thread.

3 years agoBug 907 - Add native Windows test sending WM_GETTEXT to all windows and dumping the...
Randolf Schultz [Fri, 29 Nov 2013 02:18:25 +0000 (03:18 +0100)]
Bug 907 - Add native Windows test sending WM_GETTEXT to all windows and dumping the result. If working, Bug907 is fixed and hence DDT is working.

3 years agoBug 907 - Refine DummyDispatchThread (DDT) Handling: Proper OO integration in Registe...
Sven Gothel [Fri, 29 Nov 2013 01:24:01 +0000 (02:24 +0100)]
Bug 907 - Refine DummyDispatchThread (DDT) Handling: Proper OO integration in RegisteredClass; Safe DDT Post/WaitForReady handling and error cases ; ...

Proper OO integration of DDT in RegisteredClass
  - DDT is optional to RegisteredClass[Factory],
    i.e. NEWT without DDT and DummyWindow with DDT.

  - Using native type DummyThreadContext per DDT
    passed as DDT handle to java referenced in RegisteredClass

  - Passing DDT handle to related native methods,
    if not null use DDT - otherwise work on current thread.
    The latter impacts CreateDummyWindow0 and DestroyWindow0.

Safe DDT Post/WaitForReady handling and error cases ; ...
  - Wait until command it complete using a 3s timeout
  - Terminate thread if errors occur and throw an exception

+++

Discussion: DDT Native Implementation

Due to original code, the DDT is implemented in native code.
Usually we should favor running the DDT from a java thread.
However, since it's main purpose is _not_ to interact w/ java
and the native implementation has less footprint (performance and memory)
we shall be OK w/ it for now - as long the implementation IS SAFE.

3 years agoGLDrawableFactory.shutdown0() Add DEBUG line at the end
Sven Gothel [Fri, 29 Nov 2013 01:07:30 +0000 (02:07 +0100)]
GLDrawableFactory.shutdown0() Add DEBUG line at the end

3 years agoGLDrawableFactory: destroy() -> shutdownImpl() - Add DEBUG output in implementation
Sven Gothel [Thu, 28 Nov 2013 21:43:25 +0000 (22:43 +0100)]
GLDrawableFactory: destroy() -> shutdownImpl() - Add DEBUG output in implementation

3 years agoBug 907 - Fix regression of 'cleanup' Commit 52c95c19dbd69a7fc6b307d2b2db357ceb43ddf5
Sven Gothel [Thu, 28 Nov 2013 21:04:46 +0000 (22:04 +0100)]
Bug 907 - Fix regression of 'cleanup' Commit 52c95c19dbd69a7fc6b307d2b2db357ceb43ddf5

3 years agoBug 907 - Cleanup Commit e9c711a86aa05f4f24c69972532833f5a98911a3
Sven Gothel [Thu, 28 Nov 2013 15:34:15 +0000 (16:34 +0100)]
Bug 907 - Cleanup Commit e9c711a86aa05f4f24c69972532833f5a98911a3

Cleanup Commit e9c711a86aa05f4f24c69972532833f5a98911a3:
  - Fix while loop in SendCloseMessage (native)

  - static 'threadid' must be volatile

  - Whitespace

  - Redundancy
    - CreateDummyWindow

  - Scope (java, move JNI funcs back to private)

  - Remove [invalid] pointer usage (native)
    - ThreadParam's threadReady and hWndPtr shall not be pointers - invalid
    - No need to use a threadReady pointer.

  - Validate threadid (native)

TODO:
  - Make 'native dispatch thread' optional
  - Store 'native dispatch thread' in window class

3 years agoBug 907 - Initial patch allowing Jogl to respond to other applications that try to...
Randolf Schultz [Thu, 28 Nov 2013 13:55:03 +0000 (14:55 +0100)]
Bug 907 - Initial patch allowing Jogl to respond to other applications that try to retrieve window names

3 years agoFix Bug 902: FFMPEGMediaPlayer uses IOUtil.decodeURIIfFilePath(uri) to decode proper...
Sven Gothel [Thu, 28 Nov 2013 12:43:32 +0000 (13:43 +0100)]
Fix Bug 902: FFMPEGMediaPlayer uses IOUtil.decodeURIIfFilePath(uri) to decode proper file-scheme if applicable - otherwise encoded ASCII URI.

3 years agoRefine DemoBug910ExtendedAWTAppletLifecycleCheck (commit 9310b11b2b6e1e89fa5ed9b8de26...
Sven Gothel [Tue, 26 Nov 2013 19:38:13 +0000 (20:38 +0100)]
Refine DemoBug910ExtendedAWTAppletLifecycleCheck (commit 9310b11b2b6e1e89fa5ed9b8de26e56ff6a6b262): Test start/stop balance.

3 years agoBug 910: Add Standalone Extended Applet Lifecycle Validation Test
Sven Gothel [Tue, 26 Nov 2013 19:08:42 +0000 (20:08 +0100)]
Bug 910: Add Standalone Extended Applet Lifecycle Validation Test

Test is online @ http://jogamp.org/deployment/test/bug910/

Test validates the state of the added component:
  TC1 - addNotify() and removeNotify() has been called from AWT-EDT.
  TC2 - removeNotify() is not called before Applet.destroy()

Test also validates the Applet state:
  TA1 - isActive()
  TA2 - init count
  TA3 - start count
  TA4 - stop count
  TA5 - destroy count

3 years agoWorkaround Bug 910 (IcedTea-Web): NewtCanvasAWT shall postpone JAWTWindow destruction...
Sven Gothel [Mon, 25 Nov 2013 21:08:50 +0000 (22:08 +0100)]
Workaround Bug 910 (IcedTea-Web): NewtCanvasAWT shall postpone JAWTWindow destruction via explicit set flag.

IcedTea-Web_1.5pre+rbc73a1362e9c still issues NewtCanvasAWT.removeNotify()
before before Applet.destroy(), i.e. removes NewtCanvasAWT from the Container
ahead of time (Applet protocol destroy()).

However, it fixes the non AWT-EDT issue, i.e. calls NewtCanvasAWT.removeNotify()
from the actual AWT-EDT - good.

Since the root cause still exist, we cannot use heuristics as described in
Bug 910 comment 9, but need to set a flag in NewtCanvasAWT to skip JAWT destruction
and remove it latter within Applet.destroy().

NewtCanvasAWT.removeNotify.0 - isApplet true @ [AWT-EventQueue-0, isAWT-EDT true]

3 years agoBug 672 (NewtCanvasSWT): Reuse SWTAccessor.isOS_TYPE ; Impl NW.getLocationOnScreen...
Sven Gothel [Mon, 25 Nov 2013 03:25:04 +0000 (04:25 +0100)]
Bug 672 (NewtCanvasSWT): Reuse SWTAccessor.isOS_TYPE ; Impl NW.getLocationOnScreen(..) for X11 and Windows ; Allow unit test to run on all platforms.

- Reuse SWTAccessor.isOS_TYPE (public now)

- Impl NW.getLocationOnScreen(..) for X11 and Windows reusing existing native code

- Allow unit test to run on all platforms.

Note: NewtCanvasSWT unit tests require a 'wait for realized' while SWT dispatching.
Otherwise the 'sash unit test' will fail since realiziation happens later, at least on X11.

Hence extended AWTRobotUtil.waitForRealized(..) to use a 'waitAction'
which is used here w/ special SWT dispatch Runnable.

AWTRobotUtil.waitForRealized(..) operates on time-delta instead of iteration-counter,
allowing above 'waitAction' Runnable.

AWTRobotUtil.waitForRealized(..) removed 2nd 'glad.isRealized()' loop ..

3 years agoBug 672: Move Unit Tests to appropriate SWT package and prepent Test so they get...
Sven Gothel [Mon, 25 Nov 2013 00:51:26 +0000 (01:51 +0100)]
Bug 672: Move Unit Tests to appropriate SWT package and prepent Test so they get picked up by our unit test run

3 years agoBug 672 (NewtCanvasSWT ignore windowing offset on OSX').
Petros Koutsolampros [Sun, 24 Nov 2013 22:46:58 +0000 (22:46 +0000)]
Bug 672 (NewtCanvasSWT ignore windowing offset on OSX').
The NewtCanvasSWT is now brought into place by the parent SWT Composite
and the super SWT Canvas it extends. Also added two test cases. One with
a simple SashForm and the NewtCanvasSWT in the second cell, and another
with the NewtCanvasSWT in a Composite, that Composite now in the second
cell of the SashForm. The second test is necessary because the
NewtCanvasSWT does not receive SWT.Resize events in this configuration,
but only SWT.Paint ones (a behaviour inherited from the super SWT
Canvas)

3 years agoWorkaround Bug 910 (IcedTea-Web): NewtCanvasAWT shall postpone JAWTWindow destruction...
Sven Gothel [Sat, 23 Nov 2013 16:01:09 +0000 (17:01 +0100)]
Workaround Bug 910 (IcedTea-Web): NewtCanvasAWT shall postpone JAWTWindow destruction if removeNotify() is called from non AWT-EDT

3 years agoJOGLNewtAppletBase's add/remove 'reparentHome WindowListener' at start()/stop()
Sven Gothel [Sat, 23 Nov 2013 15:59:27 +0000 (16:59 +0100)]
JOGLNewtAppletBase's add/remove 'reparentHome WindowListener' at start()/stop()

3 years agoJOGLNewtApplet1Run: Perform AWT Operations on AWT-EDT ; Remove redundant explicit...
Sven Gothel [Sat, 23 Nov 2013 12:25:21 +0000 (13:25 +0100)]
JOGLNewtApplet1Run: Perform AWT Operations on AWT-EDT ; Remove redundant explicit call to reparentWindow(null) @ destroy

3 years agoJOGLNewtAppletBase's windowDestroyNotify(): Double check 'awtParent' before reparenti...
Sven Gothel [Sat, 23 Nov 2013 12:22:13 +0000 (13:22 +0100)]
JOGLNewtAppletBase's windowDestroyNotify(): Double check 'awtParent' before reparenting 'back to parent'

3 years agoAWTWindowClosingProtocol: Hold Window reference impl. is listening to to properly...
Sven Gothel [Sat, 23 Nov 2013 03:03:19 +0000 (04:03 +0100)]
AWTWindowClosingProtocol: Hold Window reference impl. is listening to to properly removeClosingListener() (and replace boolean state)

3 years agoBug 909 - Reccreate GLJPanel's BufferedImage is no more sourced by singleton AWTGLPix...
Sven Gothel [Thu, 21 Nov 2013 00:42:54 +0000 (01:42 +0100)]
Bug 909 - Reccreate GLJPanel's BufferedImage is no more sourced by singleton AWTGLPixelBuffer

GLJPanel must validate whether it's local BufferedImage's DataBuffer is sourced
by the current singleton AWTGLPixelBuffer.

Case:
GLJPanel-B has created a new singleton AWTGLPixelBuffer w/ increased size.
Previous created GLJPanel-A's local BufferedImage's DataBuffer is no more sourced
by the singleton AWTGLPixelBuffer and hence must be re-created.

3 years agoWWW: Add J4K and Unlicense in Tools/Libraries ..
Sven Gothel [Mon, 18 Nov 2013 21:52:21 +0000 (22:52 +0100)]
WWW: Add J4K and Unlicense in Tools/Libraries ..

3 years agoNewtCanvasAWT: Remove useless block in else branch
Sven Gothel [Mon, 18 Nov 2013 21:15:53 +0000 (22:15 +0100)]
NewtCanvasAWT: Remove useless block in else branch

3 years agojogl: push other call to clearGlobalFocus to the AWT EDT
Harvey Harrison [Mon, 18 Nov 2013 19:28:40 +0000 (11:28 -0800)]
jogl: push other call to clearGlobalFocus to the AWT EDT

Follow-on to commit:
d544c839f6df10f20977c786a446833f3aa7ef13 (jogl: do the clearGlobalFocusOwner() call on the AWT EDT in NewtCanvasAWT)

Likely this won't hurt anything.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

3 years agojogl: do the clearGlobalFocusOwner() call on the AWT EDT in NewtCanvasAWT
Harvey Harrison [Mon, 18 Nov 2013 18:54:35 +0000 (10:54 -0800)]
jogl: do the clearGlobalFocusOwner() call on the AWT EDT in NewtCanvasAWT

Otherwise we can deadlock in the native focusrequest calls from the AWT thread,
see bug 879 for the details.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

3 years agojogl: simplify conditional that repeats test for isOnScreen
Harvey Harrison [Mon, 18 Nov 2013 18:55:30 +0000 (10:55 -0800)]
jogl: simplify conditional that repeats test for isOnScreen

if (isOnscreen)
else if (!isOnScreen)

change to

if (isOnscreen)
else

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

3 years agojogl: add missing @Override annotation in NewtCanvasAWT
Harvey Harrison [Mon, 18 Nov 2013 18:54:01 +0000 (10:54 -0800)]
jogl: add missing @Override annotation in NewtCanvasAWT

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

3 years agoFix Bug 893 - NewtCanvasAWT Lifecycle Race Condition (NPE on shutdown periodically)
Sven Gothel [Mon, 18 Nov 2013 15:12:52 +0000 (16:12 +0100)]
Fix Bug 893 - NewtCanvasAWT Lifecycle Race Condition (NPE on shutdown periodically)

As suggested: Employ synchronization on lifecycle actions _and_ perform destroyImpl(..) always on AWT-EDT to avoid a deadlock.

3 years agoBug 890 - GLContextImpl's Version Validation: Only validate Integer based Version...
Sven Gothel [Mon, 18 Nov 2013 14:34:42 +0000 (15:34 +0100)]
Bug 890 - GLContextImpl's Version Validation: Only validate Integer based Version if requested context or string-version is >= 3.0

.. otherwise, spec doesn't require integer based version to work!

3 years agoEGLGraphicsConfiguration: Add deauled DEBUG output for failed EGL-Config Queries
Sven Gothel [Mon, 18 Nov 2013 14:32:17 +0000 (15:32 +0100)]
EGLGraphicsConfiguration: Add deauled DEBUG output for failed EGL-Config Queries

3 years agoNEWT WindowImpl: Move consumePointerEvent(..) below doPointerEvent(..) to easy editin...
Sven Gothel [Mon, 18 Nov 2013 12:43:42 +0000 (13:43 +0100)]
NEWT WindowImpl: Move consumePointerEvent(..) below doPointerEvent(..) to easy editing/review

3 years agoNEWT Event Tests: Move TestParentingFocus* to event test package
Sven Gothel [Mon, 18 Nov 2013 12:41:35 +0000 (13:41 +0100)]
NEWT Event Tests: Move TestParentingFocus* to event test package

3 years agoNewtCanvasAWT: Add method of 'isAWTEventPassThrough()', used in unit tests to fix...
Sven Gothel [Mon, 18 Nov 2013 12:36:54 +0000 (13:36 +0100)]
NewtCanvasAWT: Add method of 'isAWTEventPassThrough()', used in unit tests to fix event validation for offscreen mode (OSX/CALayer)

3 years agoNEWT AWTAdapter*: Don't act if not setup (due to lazy setup mode), refines commit...
Sven Gothel [Mon, 18 Nov 2013 12:35:59 +0000 (13:35 +0100)]
NEWT AWTAdapter*: Don't act if not setup (due to lazy setup mode), refines commit 5c6c11abf643013976ecbc0df463a923a1f52696

3 years agoNewtCanvasAWT: Use final AWT[Key|Mouse]Adapter and set downstream lazily; Consume...
Sven Gothel [Mon, 18 Nov 2013 12:03:58 +0000 (13:03 +0100)]
NewtCanvasAWT: Use final AWT[Key|Mouse]Adapter and set downstream lazily; Consume AWT KeyEvents in downstream mode; Test respects 'consumed' key events.

3 years agoNEWT AWTAdapter: Add notion of consuming the AWT InputEvent (will be used for key...
Sven Gothel [Mon, 18 Nov 2013 12:01:12 +0000 (13:01 +0100)]
NEWT AWTAdapter: Add notion of consuming the AWT InputEvent (will be used for key events); Allow AWTAdapter to be lazily setup w/ downstream object.

3 years agoFix Bug 879 Regression (2/2) - NewtCanvasAWT.FocusAction must take focus when in...
Sven Gothel [Mon, 18 Nov 2013 00:11:15 +0000 (01:11 +0100)]
Fix Bug 879 Regression (2/2) - NewtCanvasAWT.FocusAction must take focus when in offscreen-mode (OSX/CALayer)

NewtCanvasAWT.FocusAction must take focus when in offscreen-mode (OSX/CALayer)
since the NEWT window _is_ offscreen (no input events) and AWT events are translated to NEWT.

Regression of commit 0be87f241c0f0b2f5881d9a602ce12378b8e453d

3 years agoUse 'gluegen-clang.properties' for generic clang and 'gluegen-xcode_clang.properties...
Sven Gothel [Sun, 17 Nov 2013 16:29:37 +0000 (17:29 +0100)]
Use 'gluegen-clang.properties' for generic clang and 'gluegen-xcode_clang.properties' for OSX xcode-clang ; Add GNU/Linux LLVM/clang build scripts

3 years agoNativewindow/NEWT: Fix C Return Statement
Sven Gothel [Sun, 17 Nov 2013 16:28:10 +0000 (17:28 +0100)]
Nativewindow/NEWT: Fix C Return Statement

3 years agoFix GLIBC > 2.4 dependency regression of commit 613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d
Sven Gothel [Sun, 17 Nov 2013 04:31:22 +0000 (05:31 +0100)]
Fix GLIBC > 2.4 dependency regression of commit 613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d

Commit 613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d introduced 'memcpy' usage in Xmisc.c which could create a GLIBC > 2.4 dependency.
Include GlueGen's glibc-compat-symbols.h to remove such dependency.

3 years agoFix Bug 879 - Threads deadlock in native keyboardfocus calls made form multiple threa...
Sven Gothel [Sun, 17 Nov 2013 03:55:33 +0000 (04:55 +0100)]
Fix Bug 879 - Threads deadlock in native keyboardfocus calls made form multiple threads; Fix Bug 892: Reduce Focus Hopping

Since we manage focus key traversal ourselves w/o requiring the AWT
component to have the focus[1],
we simply can drop requesting the focus for 'focus hopping' NEWT -> AWT -> NEWT[2].

Further more, 'MenuSelectionManager.defaultManager().clearSelectedPath()'
must be performed on AWT-EDT w/o blocking. Otherwise it may perform blocking tasks on AWT-EDT.

[1] Commit cb7118fc875b6722803e4b11d5681671962a8d3a
introduced function to query the next or previous 'to be focused' component:
   AWTMisc.getNextFocus(..) .. etc.

[2] Focus hopping is also addressed in Bug 892

3 years agoBug 903 - NEWT: Support 'Continue Drag on Exit'; Consistent Mouse ENTER/EXIT
Sven Gothel [Sun, 17 Nov 2013 00:54:32 +0000 (01:54 +0100)]
Bug 903 - NEWT: Support 'Continue Drag on Exit'; Consistent Mouse ENTER/EXIT

- Support 'Continue Drag on Exit'
  - Track dragging operation, allow exterior dragging
  - Hence track EXIT (see below)
  - Windows:
    - Capture mouse for exterior dragging
    - Only 'NewtWindows_trackPointerLeave' if 'entering'
    - Simplify touch: No 'inside' check - Not required.

- Consistent Mouse ENTER/EXIT
  - Track ENTER/EXIT and synthesize if required, drop duplicate
  - OSX benefits, since it never produced ENTER/EXIT events
  - AWT (or other TK) translated events beahve equal now.
  - Required for EXIT event after ending exterior dragging and final RELEASE

Tests: Passed unit tests 'junit.run.newt.event' on
  - GNU/Linux
  - Windows7
  - OSX 10.7

Tested exterior tracking manually w/ NEWT TestGearsES2NEWT and TestGearsES2NewtCanvasAWT:
  - GNU/Linux
  - Windows7 (mouse)
  - Windows8.1 (touch)
  - OSX 10.7

3 years agoBug 906 - JAWTWindow Component- and HierarchyListener must be detached at JAWTWindow...
Sven Gothel [Sat, 16 Nov 2013 04:00:27 +0000 (05:00 +0100)]
Bug 906 - JAWTWindow Component- and HierarchyListener must be detached at JAWTWindow.destroy() - GLCanvas Recreation Case

In case a JAWTWindow owner recreates itself, destroying JAWTWindow must detach the
Component- and HierarchyListener from the AWT component!

Test TestBug816GLCanvasFrameHoppingB849B889AWT
shows properly detaching listener at jawtWindow destruction.

3 years agoApplet Test Bug848AppletGLCanvas01: Only use vsync-interval 1 for last GLJPanel
Sven Gothel [Fri, 15 Nov 2013 10:54:14 +0000 (11:54 +0100)]
Applet Test Bug848AppletGLCanvas01: Only use vsync-interval 1 for last GLJPanel

3 years agoTestPerf001GLJPanelInit02AWT: Wrong test name 'Gears' -> 'Nop'
Sven Gothel [Thu, 14 Nov 2013 19:39:31 +0000 (20:39 +0100)]
TestPerf001GLJPanelInit02AWT: Wrong test name 'Gears' -> 'Nop'

3 years agoBug 904 - GLJPanel: Add property to skip isGLOriented() based vertical flip by defaul...
Sven Gothel [Thu, 14 Nov 2013 13:57:14 +0000 (14:57 +0100)]
Bug 904 - GLJPanel: Add property to skip isGLOriented() based vertical flip by default (2/2)

Property 'jogl.gljpanel.noverticalflip' will set the skipGLOrientationVerticalFlip default to true - intended for perf. testing of existing applications

3 years agoBug 904 - GLJPanel: Allow user to skip isGLOriented() based vertical flip of offscree...
Sven Gothel [Thu, 14 Nov 2013 12:52:43 +0000 (13:52 +0100)]
Bug 904 - GLJPanel: Allow user to skip isGLOriented() based vertical flip of offscreen backend

Add new GLJPanel method 'setSkipGLOrientationVerticalFlip(..)':

  /**
   * Set skipping {@link #isGLOriented()} based vertical flip,
   * which usually is required by the offscreen backend,
   * see details about <a href="#verticalFlip">vertical flip</a>
   * and <a href="#fboGLSLVerticalFlip">FBO / GLSL vertical flip</a>.
   * <p>
   * If set to <code>true</code>, user needs to flip the OpenGL rendered scene
   * <i>if {@link #isGLOriented()} == true</i>, e.g. via the PMV matrix.<br/>
   * See constraints of {@link #isGLOriented()}.
   * </p>
   */
  public final void setSkipGLOrientationVerticalFlip(boolean v) {

GearsES2: Handles 'flipVerticalInGLOrientation'

Unit test 'TestPerf001GLJPanelInit02AWT' validates and measures performance.

3 years agoNEWT: Add more documentation to WindowImpl's doPointerEvent(..) and consumePointerEve...
Sven Gothel [Wed, 13 Nov 2013 16:53:57 +0000 (17:53 +0100)]
NEWT: Add more documentation to WindowImpl's doPointerEvent(..) and consumePointerEvent(..) impl. details

3 years agoGLJPanel: Remove unused import
Sven Gothel [Wed, 13 Nov 2013 14:44:35 +0000 (15:44 +0100)]
GLJPanel: Remove unused import

3 years agoFix javadoc: TileRendererBase (links to manual anchors) and GLSharedContextSetter...
Sven Gothel [Tue, 12 Nov 2013 11:02:56 +0000 (12:02 +0100)]
Fix javadoc: TileRendererBase (links to manual anchors) and GLSharedContextSetter (remove <> in links, more details on Immersion.16.

3 years agoFix Bug 889 [Related: Bug 816, Bug 849, Bug 729] - GLCanvas disappear when moves...
Sven Gothel [Sun, 10 Nov 2013 19:59:03 +0000 (20:59 +0100)]
Fix Bug 889 [Related: Bug 816, Bug 849, Bug 729] - GLCanvas disappear when moves between two JFrame

When JAWTWindow's visibility tracker updates component's local visibility,
it should read it's local visibility state instead 'trusting' the passed state.

Make JAWTWindow's visibility tracker DEBUG output more brief for readability.

3 years agoAdd TestGLWindows03NEWTAnimResize: Test NEWT basic resize while holding position...
Sven Gothel [Sun, 10 Nov 2013 15:08:16 +0000 (16:08 +0100)]
Add TestGLWindows03NEWTAnimResize: Test NEWT basic resize while holding position .. (to be refined)

3 years agoBug 899: Validate whether we propagate WNDPROC as retrieved from 'getDummyWndProc0...
Sven Gothel [Sun, 10 Nov 2013 13:09:00 +0000 (14:09 +0100)]
Bug 899: Validate whether we propagate WNDPROC as retrieved from 'getDummyWndProc0()' in RegisteredClassFactory - Result: Yes we do.

GDI.initSingleton() dummyWindowClassFactory RegisteredClassFactory[moduleHandle 0x13f3e0000, _dummyWindow_clazz, wndProc 0x6c101de6, shared[refCount 0, class null]]

GDI.CreateDummyWindow() dummyWindowClassFactory RegisteredClassFactory[moduleHandle 0x13f3e0000, _dummyWindow_clazz, wndProc 0x6c101de6, shared[refCount 1, class RegisteredClass[handle 0x13f3e0000, _dummyWindow_clazz0]]]
GDI.CreateDummyWindow() dummyWindowClass RegisteredClass[handle 0x13f3e0000, _dummyWindow_clazz0]

++

Note: The RegisteredClassFactory mechanism is used for NEWT Windows as well.

3 years agoFix Bug 901 - NEWT: Lookup Windows 7 Touch Event Functions Dynamically to not break...
Sven Gothel [Sun, 10 Nov 2013 12:33:36 +0000 (13:33 +0100)]
Fix Bug 901 - NEWT: Lookup Windows 7 Touch Event Functions Dynamically to not break Windows < 7 Compatibility

3 years agoTests: Align NEWT parenting focus tests (package and class names) using NewtCanvasAWT
Sven Gothel [Sun, 10 Nov 2013 09:03:30 +0000 (10:03 +0100)]
Tests: Align NEWT parenting focus tests (package and class names) using NewtCanvasAWT

3 years agoSimplify Animator* Synchronization: Remove barrier 'stateSync' and favor simple ...
Sven Gothel [Sun, 10 Nov 2013 06:19:04 +0000 (07:19 +0100)]
Simplify Animator* Synchronization: Remove barrier 'stateSync' and favor simple 'synchronized' on Animator for field-get, which is already used in most methods

Utilizing a 2nd synchronization object 'stateSync' besides the main sync object, Animator itself,
is hard to maintain. It's performance advantages for querying states ae questionable and may even
introduce bugs.

Use synchronization on Animator instance for all field read/write access.

Fix unsynchronized write access of 'animThread' in Animator.MainLoop.run().

3 years agoTests: Add com/jogamp/opengl/test/junit/jogl/acore/anim Animator test package
Sven Gothel [Sat, 9 Nov 2013 19:12:32 +0000 (20:12 +0100)]
Tests: Add com/jogamp/opengl/test/junit/jogl/acore/anim Animator test package

3 years agoTestPerf001GLJPanelInit02AWT: Same size for !overlap and overlap
Sven Gothel [Sat, 9 Nov 2013 10:13:11 +0000 (11:13 +0100)]
TestPerf001GLJPanelInit02AWT: Same size for !overlap and overlap

3 years agoTestPerf001GLJPanelInit02AWT: Add overlapping test ..
Sven Gothel [Fri, 8 Nov 2013 14:51:57 +0000 (15:51 +0100)]
TestPerf001GLJPanelInit02AWT: Add overlapping test ..

3 years agoAndroid ES3 Movie Demos: Add workaround for: P0003: Extension 'GL_OES_EGL_image_exter...
Sven Gothel [Thu, 7 Nov 2013 14:30:26 +0000 (15:30 +0100)]
Android ES3 Movie Demos: Add workaround for: P0003: Extension 'GL_OES_EGL_image_external' not supported

+                // Bug on Nexus 10, ES3 - Android 4.3, where
+                // GL_OES_EGL_image_external extension directive leads to a failure _with_ '#version 300 es' !
+                //   P0003: Extension 'GL_OES_EGL_image_external' not supported
+                preludeGLSLVersion = false;

3 years agoGLJPanel: Don't ctor DefaultGLCapabilitiesChooser() if null chooser is passed, this...
Sven Gothel [Thu, 7 Nov 2013 12:38:16 +0000 (13:38 +0100)]
GLJPanel: Don't ctor DefaultGLCapabilitiesChooser() if null chooser is passed, this allows native GLCaps/config query to follow fast-path

3 years agoWindowsWGLGraphicsConfigurationFactory: Fix chosenPFDID -> recommendedIndex (!skipCap...
Sven Gothel [Thu, 7 Nov 2013 12:37:29 +0000 (13:37 +0100)]
WindowsWGLGraphicsConfigurationFactory: Fix chosenPFDID -> recommendedIndex (!skipCapsChooser mode)

Regression of commit cf1163fc88976e7087d3a17524a49139e35a4708:
  Commit dropped seeking recommendedIndex of chosenPFDID within cleaned-up availableCaps
  when in !skipCapsChooser mode.

3 years agoWGLGLCapabilities: Print pfdID as decimal (convention)
Sven Gothel [Thu, 7 Nov 2013 12:32:20 +0000 (13:32 +0100)]
WGLGLCapabilities: Print pfdID as decimal (convention)

3 years agoTestTiledPrintingGearsSwingAWT: Cleanup whitespaces
Sven Gothel [Thu, 7 Nov 2013 12:31:57 +0000 (13:31 +0100)]
TestTiledPrintingGearsSwingAWT: Cleanup whitespaces

3 years agoGLJPanel: Remove redundant !isInitialized [double-]check in initializeBackendImpl...
Sven Gothel [Thu, 7 Nov 2013 10:34:04 +0000 (11:34 +0100)]
GLJPanel: Remove redundant !isInitialized [double-]check in initializeBackendImpl(), already tested before function entry!

3 years agoBug 898: Apply best efford on Animator operation's finishLifecycleAction(..) in ...
Sven Gothel [Thu, 7 Nov 2013 10:33:14 +0000 (11:33 +0100)]
Bug 898: Apply best efford on Animator operation's finishLifecycleAction(..) in !blocking mode, i.e. notifyAll() if waitCondition holds and test again

3 years agoAndroid Newt[Debug|Version]Activity: Separate both activities (testing odd reusing...
Sven Gothel [Thu, 7 Nov 2013 07:37:44 +0000 (08:37 +0100)]
Android Newt[Debug|Version]Activity: Separate both activities (testing odd reusing of app)

3 years agoBug 890 - Fix GLES3 Profile Mapping, i.e. GL2ES2 queries and mappings; Validate isGLE...
Sven Gothel [Thu, 7 Nov 2013 07:36:46 +0000 (08:36 +0100)]
Bug 890 - Fix GLES3 Profile Mapping, i.e. GL2ES2 queries and mappings; Validate isGLES*() usage and definition ; Add and use ShaderCode.createExtensionDirective(..)

- Fix GLES3 Profile Mapping, i.e. GL2ES2 queries and mappings
  - GLProfile: Add GL2ES2 -> ES3 mapping
  - EGLContext: Reuqest major '3' for ES3
  - EGLGLCapabilities/EGLGraphicsConfiguration: Consider EGLExt.EGL_OPENGL_ES3_BIT_KHR

- Validate isGLES*() usage and definition
  - Fix BuildComposablePipeline's isGLES() code

  - For GLSL related queries use isGLES() instead of isGLES2(),
    which would exclude ES3

- Add and use ShaderCode.createExtensionDirective(..)
  - Supporting creating GLSL extension directives while reusing strings from GLExtensions

- Minor cleanup of GLContextImpl.setGLFuncAvail(..)

3 years agoAndroid NEWT*Activity: Request GL2ES2 instead of GLES2 (Be aware of ES3)
Sven Gothel [Thu, 7 Nov 2013 05:24:22 +0000 (06:24 +0100)]
Android NEWT*Activity: Request GL2ES2 instead of GLES2 (Be aware of ES3)

3 years agoAndroid: Cleanup Movie*ActivityLauncher* properties
Sven Gothel [Thu, 7 Nov 2013 05:23:30 +0000 (06:23 +0100)]
Android: Cleanup Movie*ActivityLauncher* properties

3 years agoAndroid: Add NewtDebugActivity
Sven Gothel [Thu, 7 Nov 2013 05:22:52 +0000 (06:22 +0100)]
Android: Add NewtDebugActivity

3 years agoTestPerf001GLWindowInit03NEWT: Don't run !reuse Display - Crash on Windows/ATI driver ..
Sven Gothel [Wed, 6 Nov 2013 17:32:35 +0000 (18:32 +0100)]
TestPerf001GLWindowInit03NEWT: Don't run !reuse Display - Crash on Windows/ATI driver ..

3 years agoBug 894 - GLJPanel: Expose 'initializeBackend(boolean offthread)' allowing user to...
Sven Gothel [Wed, 6 Nov 2013 14:34:09 +0000 (15:34 +0100)]
Bug 894 - GLJPanel: Expose 'initializeBackend(boolean offthread)' allowing user to trigger backend initialization eagerly and offthread (optional, !WINDOWS)

TestPerf001GLJPanelInit02AWT compares all variations: no-gl, glcanvas, gljpanel and gljpanel-initMT (offthread)

3 years agoBug 894 - GLDrawableFactory* [dummy|offscreen] Surface creation w/ own device does...
Sven Gothel [Wed, 6 Nov 2013 14:30:50 +0000 (15:30 +0100)]
Bug 894 - GLDrawableFactory* [dummy|offscreen] Surface creation w/ own device does _not_ require locking on global shared device.

3 years agoNativeWindow *GraphicsDevice: Align constructors to simplify call hierarchy for analysis.
Sven Gothel [Wed, 6 Nov 2013 06:09:01 +0000 (07:09 +0100)]
NativeWindow *GraphicsDevice: Align constructors to simplify call hierarchy for analysis.

3 years agoNEWT Window: Expose 'setVisible(boolean wait, boolean visible)' allowing applications...
Sven Gothel [Wed, 6 Nov 2013 06:06:58 +0000 (07:06 +0100)]
NEWT Window: Expose 'setVisible(boolean wait, boolean visible)' allowing applications to not block until window becomes visible.

3 years agoBug 888 / Bug 891- Enhance GLCapabilities-Query: Refine unit tests
Sven Gothel [Tue, 5 Nov 2013 17:47:56 +0000 (18:47 +0100)]
Bug 888 / Bug 891- Enhance GLCapabilities-Query: Refine unit tests

3 years agoJNI Code: Call DeleteLocalRef(..) manually.
Sven Gothel [Tue, 5 Nov 2013 15:53:18 +0000 (16:53 +0100)]
JNI Code: Call DeleteLocalRef(..) manually.

3 years agoBug 888 / Bug 891- Enhance GLCapabilities-Query: Add raw perf. test case 'choose...
Sven Gothel [Tue, 5 Nov 2013 15:52:29 +0000 (16:52 +0100)]
Bug 888 / Bug 891- Enhance GLCapabilities-Query: Add raw perf. test case 'choose' only and 'full' offscreen-drawable w/ context

test01ChooseOnly exposes X11/GLX perf. enhancement of 613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d:

PRE CHANGE:
++++ UITestCase.setUp: com.jogamp.opengl.test.junit.jogl.perf.TestPerf001RawInit00NEWT - test01ChooseOnly
INIT START #0
Run: 0, count 50/50 raw:
        choose     503/t  10.06/1
INIT END #0
INIT START #1
Run: 1, count 50/50 raw:
        choose     384/t   7.68/1
INIT END #1
INIT START #2
Run: 2, count 50/50 raw:
        choose     344/t   6.88/1
INIT END #2

POST CHANGE:
++++ UITestCase.setUp: com.jogamp.opengl.test.junit.jogl.perf.TestPerf001RawInit00NEWT - test01ChooseOnly
INIT START #0
Run: 0, count 50/50 raw:
        choose      49/t   0.98/1
INIT END #0
INIT START #1
Run: 1, count 50/50 raw:
        choose      43/t   0.86/1
INIT END #1
INIT START #2
Run: 2, count 50/50 raw:
        choose      38/t   0.76/1
INIT END #2

http://JogAmp.org git info: FAQ, tutorial and man pages.