aboutsummaryrefslogtreecommitdiffstats
path: root/make
Commit message (Collapse)AuthorAgeFilesLines
...
* OSX/NEWT: Following CALayer streaming design, i.e. issue NSWindow/NSView Ops ↵Sven Gothel2013-03-191-3/+3
| | | | | | | | | | | | | | | | | | | | | on main-thread w/o blocking; NEWT/WindowImpl: Volatile multithreaded mutable values Similar to commits: 28c6472335b924080d638b33a28f8f4eedb459b1 f354fb204d8973453c538dda78a2c82c87be61dc main-thread operations cannot block main-thread. Luckily we are able to create the NSWindow and NSView instance uninitialized (deferred) on the current thread, while issuing their initialization on the main-thread w/o blocking. Further more a size glitch is fixed, which didn't take the title bar into account. +++ NEWT/WindowImpl: Volatile multithreaded mutable values Since position, size and other attributes might get changes off-thread, these fields needs to be volatile.
* OSX CGL: Don't issue [NSOpenGLContext clearDrawable] for [NSOpenGLContext ↵Sven Gothel2013-03-181-0/+1
| | | | setView: view] which breaks pbuffer; Add [NSOpenGLContext clearDrawable].
* OSX/CALayer: Revise CALayer 'RunOnMainThread' utilization, avoiding deadlocksSven Gothel2013-03-141-16/+7
| | | | | | | | | | | | | | | | | | | | | | RunOnMainThread(waitUntilDone:=true,..) can deadlock the main-thread if called from AWT-EDT, since the main-thread may call back to AWT-EDT while injecting a new main-thread task. This patch revises all RunOnMainThread CALayer usage, resulting in only one required left: - OSXUtil.AddCASublayer() w/ waitUntilDone:=false Hence the CALayer code has no more potential to deadlock main-thread/AWT-EDT. OSXUtil.AddCASublayer() must be performed on main-thread, otherwise the CALayer attachment will fail - no visible rendering result. +++ Note: A good trigger to test this deadlock is to magnify/zoom the OSX desktop (click background + ctrl-mouse_wheel) before running some unit tests. TestGLCanvasAWTActionDeadlock01AWT and TestAddRemove02GLWindowNewtCanvasAWT also have the potential to trigger the mentioned deadlock.
* Bug 665: Allow re-association of GLContext/GLEventListener to a GLDrawable ↵Sven Gothel2013-03-131-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Part 4) Note: - GLEventListenerState preservs the GLAutoDrawable state, i.e. GLContext, all GLEventListener and the GLAnimatorControl association. - GLEventListenerState may be utilized to move the state from a dying GLAutoDrawable, to be moved to a new created GLAutoDrawable at a later time. - GLEventListenerState will be made public soon. +++ Exessive unit tests cover the new feature, tested manually on GNU/Linux/X11 and OSX(Java6/Java7). +++ - GLAutoDrawable - Change 'setContext(..)' to allow the destruction of the unbound old context: 'setContext(GLContext newCtx)' -> 'setContext(GLContext newCtx, boolean destroyPrevCtx)' - Implementations: Properly implement 'setRealized(..)' incl. obeying threading constraints if exists. Method is being utilized at least for GLEventListenerState.moveTo(..) to unrealize and realize the drawable resources. +++ Fix propagation of GLContext/GLDrawable association change (Bottom -> Top): GLDrawableImpl.associateContext GLContextImpl.associateDrawable GLContextImpl.makeCurrent GLContextImpl.destroy GLContext.setGLDrawable ... GLDrawableHelper.switchContext GLAutoDrawble.setContext associateDrawable(..)/associateContext(..) unifies and hence: - GLContextImpl.contextRealized() (removed) - GLDrawableImpl.contextRealized() (removed) - GLDrawableImpl.associateContext(..) (merged) - MacOSXCGLContext.drawableChangedNotify(..) (removed) +++ - EGLUpstreamSurfaceHook.evalUpstreamSurface() validates the surface's device for reusage, which is valid in case of GLEventListenerState.moveTo(..) - MacOSXCGLContext.NSOpenGLImpl: pixelFormat replaces NSOpenGLLayerPfmt and has simplified lifecycle [create..destroy], while native NSOpenGLLayer code only holds the reference until released.
* Fix Mix2TexturesES2 unit tests: Use synchronized texID access and add ↵Sven Gothel2013-03-091-3/+23
| | | | | | glFinish() after demo -> FBO rendering on or off thread. Fixes shared GLContext OSX rendering.
* TestBug572AWT: Add test case w/ setting GLCanvas's size and frame.pack() on ↵Sven Gothel2013-02-281-2/+2
| | | | AWT-EDT and current thread.
* Fix NEWT/AWT WindowClosing Unit Tests ; Review/Cleanup NEWT WindowClosing ↵Sven Gothel2013-02-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mechanism Due to a NEWT WindowClosing event regression cause by NewtCanvasAWT changes a review of our WindowClosing event mechanism was required. Important cleanups are marked w/ '(*)' below. I would have preferred to change the 'WindowListener.windowDestroyNotify(WindowEvent)' method to pass a WindowCloseEvent object exposing more information like toolkit or programmatic destruction and passing whether a 'closing' or 'nop' action will be performed based on the WindowClosingMode. For now I postponed this idea .. since it would change the API again, but may reconsider it after merging the Android 'closing' patch. - InputEvent.consumedTag -> NEWTEvent.consumedTag - Window - (*) Promote setWindowDestroyNotifyAction(Runnable) to public, former WindowImpl.setHandleDestroyNotify(boolean). Using a Runnable action for WindowImpl.windowDestroyNotify(boolean) allows a setting defined alternative for destroy() and gets rid of [ab]using WindowListener.windowDestroyNotify(WindowEvent) for lifecycle actions. Used in: - GLWindow - GLAutoDrawableDelegate impl. - WindowImpl - Respect NEWTEvent.consumedTag for WindowEvents as well - (*) Impl. setHandleDestroyNotify(boolean) (see above) - (*) destroy() simply sends out pre- and post- destruction Window events, where windowDestroyNotify(boolean) sends out the pre-destruction event if NOP. - (*) windowDestroyNotify(boolean) is public now, allowing other impl. details to follow proper destruction using handleDestroyNotify Runnable (-> NewtCanvasAWT). - AWTWindowClosingProtocol: - addClosingListenerOneShot() -> addClosingListener() - calling addClosingListener() at addNotify() - calling removeClosingListener() at removeNotify() - AWTWindowClosingProtocol ctor taking NOP runnable, allowing to send WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY at WindowClosingMode.DO_NOTHING_ON_CLOSE - add/remove listener on AWT-EDT - AWTWindowAdapter - Add 'removeWindowClosingFrom(..)', allowing to remove window closing event fwd. - Also fwd windowClosed in window closing fwd'ing. - NewtCanvasAWT - (*) Utilize AWTWindowClosingProtocol NOP runnable (see above) to fwd closing-NOP event to NEWT - (*) Unify remove/destroy code in destroyImpl(..) - !removeNotify -> destroy NEWT child programatic or as toolkit event - removeNotify || windowClosing -> destroy jawtWindow - (*) Remove AWTWindowAdapter/AWTParentWindowAdapter's windowClosingListener, since we utilize AWTWindowClosingProtocol - DisplayImpl - Adding 'final void dispatchMessage(final NEWTEvent event)' allowing to remove the NEWTEventTask wrapping for no reason in enqueueEvent(..) if on EDT and waiting.
* Fix CALayer pos/size and animation.b01Sven Gothel2013-02-223-17/+21
| | | | | | | | | | | | | | | - Fix CALayer animation: - All CALayer animations are set to nil via overriding 'actionForKey' - Fix CALayer pos/size bug: - Fix root and sub CALayer position to 0/0 and size on the main-thread w/o blocking. - If the sub CALayer implements the Objective-C NativeWindow protocol NWDedicatedSize (e.g. JOGL's MyNSOpenGLLayer), the dedicated size is passed to the layer, which propagates it appropriately. - On OSX/Java7 our root CALayer's frame position and size gets corrupted by its NSView, hence we have created the NWDedicatedSize protocol.
* OSX/Java7/CALayer + JAWT: Partially Fix AWT/NEWT CALayer 'out of sight' bug, ↵Sven Gothel2013-02-201-33/+40
| | | | | | | | | | | | | | | | | | | | | | | | | where our CALayer is moved out of the visible area - same erroneous behavior for GLCanvas and NewtCanvasAWT - sized-frame: Set framesize and validate() it - sized-component: Set component preferred size and call frame.pack() - added workaround 'OffscreenLayerSurface.layoutSurfaceLayer()' to fix CALayer size, which snaps for: - OK initial size before setVisible: sized-frame and sized-component - OK resize w/ sized-frame - OK manual frame resize - Invisible: w/ sized-component after setVisible() ++ - CALayer-Sublayer (GL) has additional retain/release when added/removed to be on safe side.
* NEWT/OSX: Fix 'locationOnScreen' usage and use proper client-area window ↵Sven Gothel2013-02-201-3/+2
| | | | | | screen position (Fixes resize -> position) - Tested w/ NEWT GearsES2 and Java6 and Java7 on OSX
* Bug 678 (fix), Bug 641 (API + Windows Impl.), Bug 688 (prep): Update NEWT's ↵Sven Gothel2013-02-195-9/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KeyEvent handling while distinguish keyCode (kbd layout independent) and keySym (kbd layout dependent) API Changes: - Virtual key codes and symbols are of type short. - KeyEvent.keySymbol() shall return a layout dependent value (Bug 641) - Method returns former keyCode() value, which was layout dependent. - Returns 'short' value - KeyEvent.keyCode() returns a short value, instead of int - KeyEvent.keyCode() shall return a layout independent value (Bug 641) - To ease implementation, we only 'require' the scan code to be mapped to a 'US Keyboard layout', which allows reusing layout dependent code while preserving the goal to have a fixed physical key association - Implementation status: - Windows OK - X11 TODO - OSX: 50/50 TODO - Using layout independent 'action keys' - Using layout dependent 'printable keys' - returning above semantics for both, keyCode and keySym - Android 50/50 TODO - Returning the layout independent keyCode - Mapping probably incomplete - KeyEvent.EVENT_KEY_TYPED and KeyListener.keyTyped(KeyEvent) (Bug 688) - Marked DEPRECATED - No more called for auto-repeat events - Synthesized in WindowImpl.consumeKeyEvent(..): No more injection by native- or java driver code - NEWTEvent.eventType: int -> short - field, as well as all method involving eventType changed to short. - NEWTEvent.isSystemEvent: REMOVED - Never used as well as never being implemented properly Internal Changes: - Simplified keyEvent driver code - Especially the Windows native driver's mapping code could be simplified using scanCode and MapVirtualKeyEx - NEWT Event Factories: hashMap -> switch/case Unit Tests: - - Added NewtCanvasAWT Offscreen Layer Tests important to test the AWT -> NEWT translation on OSX/CALayer: - TestNewtKeyCodeModifiersAWT - TestNewtKeyCodesAWT - TestNewtKeyEventAutoRepeatAWT - TestNewtKeyEventOrderAWT - TestNewtKeyPressReleaseUnmaskRepeatAWT
* Unit Tests: Add 'results-java7' to check-junit.sh (Completes commit ↵Sven Gothel2013-02-171-0/+1
| | | | fc9539d50c12f9def7a3babde7384e3d38f61721)
* Unit Tests: Use Property 'jvmJava.exe' ; Add target 'junit.run.local.java7' ↵Sven Gothel2013-02-172-11/+42
| | | | | | (if="jvmJava7.exe") See GlueGen commit 6b86764f2e195b4046000fd5a7fcf3331ca72d21
* OSX/Java7 Cleanup: Remove JavaNativeFoundation dependency; ↵Sven Gothel2013-02-177-21/+63
| | | | NativeWindow-JAWT: Remove c.fixup.jawt.version.macosx (redundant, libjawt.dylib is rpath'ed always)
* Add proper copyright header w/ all remarks regarding re-distribution etc, ↵Sven Gothel2013-02-171-15/+33
| | | | similar to other JNI headers
* build-test.xml: Move 'junit.run.newt.awt' up in file; 'junit.run.newt': ↵Sven Gothel2013-02-171-38/+40
| | | | Exclude *AWT* and *SWT* (similar to 'junit.run.newt.headless')
* NEWT/OSX: Fix Memory Leak ; Fix Occasional Crash Duer to Lifecycle Ops not ↵Sven Gothel2013-02-173-6/+5
| | | | | | | | | | | | | | | | on Main-Thread. - Fix Memory Leak - NewtWindow::dealloc -> [NewtView release]: Fixes NewtView leak - NewtView::dealloc -> removeTrackingRect: Removes occasional crash (double free of TrackingRect) - Fix Occasional Crash Duer to Lifecycle Ops not on Main-Thread. Perform OSX WindowDriver ops on Main-Thread: - close0 - changeContentView0 - createWindow0 - Cleaned up AddRemove unit tests, added TestAddRemove03GLWindowNEWT
* TestWindowClosingProtocol01AWT: More relaxed timing reducing false positivesSven Gothel2013-02-161-3/+2
|
* Fix Bug 644: AWT GLCanvas and GLJPanel ignored their visibility stateSven Gothel2013-02-161-2/+2
| | | | | If !visible, GLCanvas and GLJPanel's paint* and display method shall not render as the other GLAutoDrawable impl. do (GLWindow, SWT GLCanvas).
* Fix Bug 691 (part-3): NSOpenGLLayer::openGLContextForPixelFormat(..) on ↵Sven Gothel2013-02-164-2/+27
| | | | | | | | | | | | | | | | | | | | main-thread deadlock'ed due to locked shared context NSOpenGLLayer::openGLContextForPixelFormat(..) is performed on main-thread at 1st NSOpenGLLayer display method. This happened irregulary, i.e. sometimes (T0) right after NSOpenGLLayer creation and attachSurfaceLayer()/AddCASublayer(..), sometimes later (T1). NSOpenGLLayer::openGLContextForPixelFormat(..) uses the passed shared user context. The shared user context is locked at NSOpenGLLayer's creation (T0) and if performed at this early time the call deadlocks due to pthread_mutex wait for the shared user context. This fix performs NSOpenGLLayer creation and layer attachment while the shared user context is kept unlocked and enforces NSOpenGLLayer display and hence NSOpenGLLayer::openGLContextForPixelFormat(..). Added CGL.setNSOpenGLLayerEnabled(..) to enable/disable NSOpenGLLayer - currently not used. - Passed AddRemove tests for GLCanvas/Swing and GLWindow/NewtCanvasAWT w/ 100 loops on Java6 and Java7 on OSX. - Passed Instruments Leaks test w/ 10 loops on Java6 and Java7
* Refine unit test for Bug 691: Add onscreen/offscreen tests [if available] ; ↵Sven Gothel2013-02-151-3/+3
| | | | Move tests to 'acore'.
* Fix Bug 675: NPE w/ Beans.setDesignTime(true) ; Fix GLCanvas.destroy(): ↵Sven Gothel2013-02-151-5/+5
| | | | | | | | | | | | | | | Don't issue removeNotify(), delete drawable and context only! - Fix Bug 675: NPE w/ Beans.setDesignTime(true) - Carefully consider Beans.isDesginTime() fixes NPE - added unit test - Fix GLCanvas.destroy(): Don't issue removeNotify(), delete drawable and context only! - AWT removeNotify() shall only be issued via AWT itself, not manually - Add 'destroyImpl(boolean destroyJAWTWindowAndAWTDevice)' to be called by - GLCanvas.destroy(): destroyImpl( false ); - GLCanvas.removeNotify(): destroyImpl( true ); - Ensures JAWTWindow and AWTDevice are created and destroyed via the AWT callbacks addNotify() and removeNotify() only.
* Fix Bug 691 (part-2): Extra '[subLayer release]' is wrong, since ↵Sven Gothel2013-02-153-7/+35
| | | | | | | | | | | | | | | | | | | | 'CGL.releaseNSOpenGLLayer' triggers release - but very late w/ AWT usage. OSXUtil_RemoveCASublayer0's added '[subLayer release]' in commit f6e6fab2a7ddfb5c9b614cb072c27ff697629161 is wrong, since 'CGL.releaseNSOpenGLLayer' actually does trigger it's release. This was not seen w/ AWT tests, since it happens very later. A NewtCanvasAWT test disclosed this error -> removed that extra release call. The culprit for the late release w/ AWT usage was CGL.createNSOpenGLLayer's call in the current thread. Moving it to the Main-Thread fixed the problem. All CALayer lifecycle calls are issued on the Main-Thread now. NSOpenGLLayer's CVDisplayLink OpenGL fitting via 'CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext' is now performed at it's context creation in 'NSOpenGLLayer::openGLContextForPixelFormat'. The 'extra' release of the NSOpenGLLayer's NSOpenGLContext as introduced in commit f6e6fab2a7ddfb5c9b614cb072c27ff697629161 is still valid.
* Fix OSX CALayer Bug 690 and Bug 691: Occasional Freeze on CVDisplayLinkStop; ↵Sven Gothel2013-02-143-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Layers and native GL-Context are _not_ Released ; Java Side wait for Main-Thread - Fix Bug 690: Occasional Freeze on CVDisplayLinkStop - NSOpenGLLayer.disableAnimation() shall not claim the renderLock mutex, since the CVDisplayLink callback could be waiting for the lock. This waiting callback could freeze the call to CVDisplayLinkStop. - Fix Bug 691: Layers and native GL-Context are _not_ Released - Following proper release cycle: Context unrealized: - JAWTWindow.detachSurfaceLayer() -> OSXUtil.RemoveCASublayer(..) - CGL.releaseNSOpenGLLayer(..) JAWTWindow.destroy() - MacOSXJAWTWindow.UnsetJAWTRootSurfaceLayer(..) - OSXUtil.DestroyCALayer(..) - 'Magic' CALayer release calls (w/o manual retain beforehand) at: - OSXUtil.RemoveCASublayer(..): [subLayer release] - MacOSXJAWTWindow.UnsetJAWTRootSurfaceLayer(..): [rootLayer release] - OSXUtil.DestroyCALayer(..): [rootLayer release] - 'Magic' NSOpenGLLayer's NSOpenGLContext dealloc: - [NSOpenGLContext clearDrawable] - CGLDestroyContext( [NSOpenGLContext CGLContextObj] ) - Java Side wait for Main-Thread - Waiting for the delegated Main-Thread on the Java side eases debugging and won't block the Main-Thread in native code. - Utilizing this for all CALayer calls Test case: TestGLCanvasAddRemove01SwingAWT
* Fix Animator resume() wait-condition (drawablesEmpty didn't wait for ↵Sven Gothel2013-02-011-4/+11
| | | | pausedIssued); Update TestGLWindows02NEWTAnimated (isPaused())
* Bump Android NDK to android-ndk-r8dSven Gothel2013-01-312-16/+18
|
* Fix AWTKeyAdapter: Reorder AWT events to NEWT order - also ensuring TYPED is ↵Sven Gothel2013-01-303-4/+18
| | | | | | | always sent. This foremost fixes an issue w/ OSX/Java7 and NewtCanvasAWT offscreen CALayer usage, which utilizes AWTKeyAdapter and AWTNewtEventFactory (AWT -> NEWT) key events.
* Add OSX Java7 build/test scriptsSven Gothel2013-01-302-0/+38
|
* OSX unit tests: Disable OSX 32bit tests (redundant - prepare for Java7 tests)Sven Gothel2013-01-291-2/+3
|
* Fix Bug 678: Deliver key-char value for printable chars on all ↵Sven Gothel2013-01-293-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | KeyEventListener (-> On Windows as well) The following is observed, where t0 and t1 refer to subsequent different timestamps: NEWT delivery order: PRESSED (t0), RELEASED (t1) and TYPED (t1) WINDOWS delivery order: PRESSED (t0), TYPED (t0) and RELEASED (t1) Windows Auto-Repeat: PRESSED (t0), TYPED (t0) Hence we changed the event reorder-code in NEWT to trigger NEWT-PRESSED on Windows-TYPED for printable chars, assuring key-char values on all listener callbacks. - KeyEvent.getKeyChar(): Removed disclaimer dedicated for Windows - Keyevent.isActionKey(): Completed for all NEWT non-printable action keys; Added static variant - Keyevent.isPrintableKey(): NEW: returns !isModifierKey(keyCode) && !isActionKey(keyCode) ; With static variant - Windows WindowDriver: - EVENT_KEY_PRESSED handles non-printable chars only - EVENT_KEY_TYPE handles printable chars only - Native: VK_DELETE passes keyCode - Unit tests: Wait for completion 1s -> 2s
* Bug 665 (part 1) - Allow dis-association of GLContext's GLDrawable ..Sven Gothel2013-01-242-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes allowing re-association (incl. null) of GLContext/GLDrawable: - GLAutoDrawable: Refine API doc 'setContext(..)' - GLContext: Refine API doc: 'setGLDrawable(..)' 'getGLDrawable()' - GLContextImpl.setGLDrawable(): Handle null drawable - GLAutoDrawableDelegate/GLAutoDrawableBase: Allow null GLContext - GLDrawableHelper.switchContext(..)/recreateGLDrawable(): Balance GLContext.setGLDrawable(..) calls - New GLEventListenerState, holding state vector [GLEventListener, GLContext, .. ] impl. relocation of all components from/to GLAutoDrawable. - GLDrawableUtil - Using GLEventListenerState for swapGLContextAndAllGLEventListener(..) +++ NEWT Window*: - getDisplayHandle() is 'final', no more 'shortcut' code allowed due to re-association incl. display handle. - close*: - close config's device (was missing) - null config +++ Changes allowing reconfig of Display handle as required to re-associate pre-existing GLContext to a 'window': - AbstractGraphicsDevice: Add isHandleOwner() / clearHandleOwner() - Impl. in X11GraphicsDevice and EGLGraphicsDevice, NOP in DefaultGraphicsDevice - DefaultGraphicsConfiguration add 'setScreen(..)' - MutableGraphicsConfiguration - Make DefaultGraphicsConfiguration.setScreen(..) public - NativeWindowFactory add 'createScreen(String type, AbstractGraphicsDevice device, int screen)' - Refactored from SWTAccessor - NativeWindow x11ErrorHandler: Dump Stack Trace in DEBUG mode, always.
* Android: Allow selection of native window formats RGBA8888, RGBX8888 and ↵Sven Gothel2013-01-202-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | RGB565; Fix HiSilicon/Vivante/Immersion.16 EGLConfig selection (zero depth buffer @ visualID) - NEWT/Android Fix PixelFormat/NativeWindowFormat/VisualID Selection - Fix allows proper selection of native window formats: RGBA8888, RGBX8888 and RGB565 - Selection is performed in 3 steps: 1) @ Construction (non native): SurfaceHolder.setFormat( getSurfaceHolderFormat( caps ) ) 2) @ Native Surface Creation: getANativeWindowFormat( androidFormat) -> ANativeWindow_setBuffersGeometry(..) Note: The set native format is revalidated, i.e. read out via ANativeWindow_getFormat(..). 3) @ EGL Creation: ANativeWindow_getFormat(..) -> fixCaps(..) - simply fixing the chosen caps. - NEWT GLWindow.GLLifecycleHook.resetCounter: - Also reset GLAnimatorControl's counter, if attached. - NEWT WindowImpl -> GLLifecycleHook.resetCounter() calls issued _after_ operation before unlock(). - JOGL/EGLGraphicsConfigurationFactory - Validate whether the visualID matching EGLConfig depth buffer is suitable. On HiSilicon/Vivante/Immersion.16: Depth buffer w/ matching visualID is zero! - NativeWindow/Capabilities.compareTo: Fix alpha comparison
* TestSwingAWTRobotUsageBeforeJOGLInitBug411: Fix 'chicken egg' init problem ↵Sven Gothel2013-01-191-2/+2
| | | | | | w/ AWTRobot, i.e. NativeWindow not yet initialized. Regression since: 50f997557b91a2f014ef0c2ea848c5c326d0cfb2
* Adapt to change 5060b728b26a89a14367f8fca9f4eb7968f719ca: ↵Sven Gothel2013-01-191-2/+2
| | | | ShaderState.uniform(..) returns false if no location available.
* NEWT/Android: Full Lifecycle for WindowDriver; Using static ViewGroup; ↵Sven Gothel2013-01-193-37/+115
| | | | | | | | | | | | | | | | AWTRobotUtil: More tolerant for non AWT env.; Fix adb-launch-* - NEWT/Android WindowDriver - Full Lifecycle, remove refs on closeNative() - Respect isFullscreen() - Using static ViewGroup if available and surface not ready, allows running from main() - AWTRobotUtil: More tolerant for non AWT env. - Check for NEWT first - Only use AWT iff available, which allows running on Android - Fix adb-launch-* - Launch main/junit tests
* Fix Bug 669: Recursive GLContext makeCurrent()/release()Sven Gothel2013-01-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | Culprit: GLContext's makeCurrent() didn't clear the boolean flag 'unlockContextAndSurface' in case the context is already current (-> recursion). Above case was detected within a code block tailed by a finally block, which acted on mentioned flag, i.e. called lock.unlock() and hence decremented the lock count even though the method return w/ successful state. Fixed. Added debug code: GLContext.release() debug code (DEBUG | TRACE_SWITCH), recording stack trace of last release() call, which is dumped in case no current was current. Added 2 unit tests: - Simple recursive GLContext makeCurrent()/release() from within GLEventListener's display(). Test also validates lock count and lock ownership. - GLAutoDrawable display() of another GLAutoDrawable from within GLEventListener's display(..).
* ShaderState: Reduce hash-map utilization at shader switch (reset ↵Sven Gothel2013-01-151-3/+3
| | | | uniforms/attributes); Refine API doc.
* NEWT-MouseEvent getWheelRotation() API Update - Fixes Bug 659: NEWT ↵Sven Gothel2013-01-146-22/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Horizontal Scrolling Behavior (OSX, X11, Win32); Bug 639: High-Res Mouse-Wheel - API update 'float getWheelRotation()': Usually a wheel rotation of > 0.0f is up, and < 0.0f is down. Usually a wheel rotations is considered a vertical scroll. If isShiftDown(), a wheel rotations is considered a horizontal scroll, where shift-up = left = > 0.0f, and shift-down = right = < 0.0f. However, on some OS this might be flipped due to the OS default behavior. The latter is true for OS X 10.7 (Lion) for example. The events will be send usually in steps of one, ie. -1.0f and 1.0f. Higher values may result due to fast scrolling. Fractional values may result due to slow scrolling with high resolution devices. The button number refers to the wheel number. - Fix Bug 659: NEWT Horizontal Scrolling Behavior (OSX, X11, Win32) - See new API doc above - X11/Horiz: Keep using button1 and set SHIFT modifier - OSX/Horiz: - PAD: Use highes absolute scrolling value (Axis1/Axis2) and set SHIFT modifier for horizontal scrolling (Axis2) - XXX: Use deltaX for horizontal scrolling, detected by SHIFT modifier. (traditional) - Windows/Horiz: - Add WM_MOUSEHWHEEL support (-> set SHIFT modifier), but it's rarely impl. for trackpads! - Add exp. WM_HSCROLL, but it will only be delivered if windows has WS_HSCROLL, hence dead code! - Android: - Add ACTION_SCROLL (API Level 12), only used if layout is a scroll layout - Using GestureDetector to detect scroll even w/ pointerCount > 2, while: - skipping 1st scroll event (value too high) - skipping other events while in-scroll mode - waiting until all pointers were released before cont. normally - using View config's 1/touchSlope as scale factor - Fix Bug 639: High-Res Mouse-Wheel - getWheelRotation() return value changed: int -> float allowing fractions, see API doc changes above. - Fractions are currently supported natively (API) on - Windows - OSX - Android - AndroidNewtEventFactory ir refactored (requires an instance now) and AndroidNewtEventTranslator (event listener) is pulled our of Android WindowDriver.
* Move all Exclusive Context Thread (ECT) tests to it's own package to ↵Sven Gothel2013-01-122-13/+13
| | | | de-clutter core test package
* Adding GEOMETRY_SHADER support in ShaderCode, adding core ↵Sven Gothel2013-01-121-1/+3
| | | | | | | | | | | | | | | | | | | GL3/GEOMETRY_SHADER unit tests. ; Simplified GLContext version number - Adding GEOMETRY_SHADER support in ShaderCode, adding core GL3/GEOMETRY_SHADER unit tests Chuck Ritola reported in December 2012 that we lack support of GEOMETRY_SHADER and he provided a test case. The latter is cleaned up to use GL3 core profile features only tesing a pass-through and the flip-XYZ geometry shader. ShaderUtil is fixed. - Simplified GLContext version number The OpenGL major/minor version is now hold in a VersionNumber instance to simplify usage. Also expose it via getGLVersionNumber() while marking getGLVersionMajor() and getGLVersionMinor() deprecated.
* build/test: newt-headless shall exclude AWT/SWTSven Gothel2013-01-111-0/+2
| | | | TestNewtEventModifiersNEWTWindowAWT was incl. in newt headless
* GLAutoDrawable/AnimatorBase: Add ExclusiveContextThread (ECT) feature; ↵Sven Gothel2013-01-112-22/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AnimatorBase: Add setModeBits/MODE_EXPECT_AWT_RENDERING_THREAD; FPSAnimator: Make transactions deterministic. ExclusiveContextThread (ECT) allows user to dedicate a GLContext to a given thread. Only the ECT will be allowed to claim the GLContext, hence releasing must be done on the ECT itself. The core feature is accessible via GLAutoDrawable, while it can be conveniently enabled and disabled via an AnimatorBase implementation. The latter ensures it's being released on the ECT and waits for the result. Note that ECT cannot be guaranteed to work correctly w/ native (heavyweight) AWT components due to resource locking and AWT-EDT access. This is disabled in all new tests per default and noted on the API doc. Note: 'Animator transaction' == start(), stop(), pause(), resume(). - Add ExclusiveContextThread (ECT) feature - GLAutoDrawable NEW: - Thread setExclusiveContextThread(Thread t) - Thread getExclusiveContextThread() - AnimatorBase NEW: - Thread setExclusiveContext(Thread t) - boolean setExclusiveContext(boolean enable) - boolean isExclusiveContextEnabled() - Thread getExclusiveContextThread() - AnimatorBase: Add setModeBits/MODE_EXPECT_AWT_RENDERING_THREAD Allows user to pre-determine whether AWT rendering is expected before starting the animator. If AWT is excluded, a more simple and transaction correct impl. will be used. - FPSAnimator: Make transactions deterministic. FPSAnimator previously did not ensure whether a transaction was completed. A deterministic transaction is required to utilize ECT. FPSAnimator now uses same mechanism like Animator to ensure completeness, i.e. Condition and 'finishLifecycleAction(..)'. Both are moved to AnimatorBase. Tested manually on Linux/NV, Linux/AMD, Windows/NV and OSX/NV. - All new tests validated correctness. - All new tests shows an performance increase of ~3x w/ single GLWindow, where multiple GLWindows don't show a perf. increase.
* Update PNGJ 0.85 -> 1.12 (w/ interlace read support) ; Added PNG Interlace ↵Sven Gothel2012-12-311-2/+2
| | | | read tests (TestPNGTextureFromFileNEWT)
* Enhance PMVMatrix: Use FloatStack to implement PushMatrix and PopMatrix (Bug ↵Sven Gothel2012-12-311-3/+3
| | | | | | | | | | | | | 657) One FloatStack for each, MV, P and T, with initialialSize zero to save memore and growSizes: MV = 16 arrays, P = 2 arrays, T = 2 arrays, with array = 16 floats. This shall save performance due to the preallocated stack when used and growing only in the above mentioned grow intervals. We may finetune the growSize, if required.
* Bug632: Test NEWT Child Window Translucency (X11/Windows) ..Sven Gothel2012-12-304-28/+39
| | | | | | | | | | | | | - Windows: Child window is not translucent at all - X11: Child window is translucent to parent's background, however - parents content is _not_ 'composed in'. - TODO: Find whether there is a solution or not. - Note: The child window does not change it's rel. position if parent moves! This is a feature, since we don't have impl. a layout.
* Cleanup / Simplify: setGLFunctionAvailability(..) / ↵Sven Gothel2012-12-301-1/+1
| | | | | | | | | | createContextARBVersions(..) GL Version Validation String or integer based GL version validation now happens in setGLFunctionAvailability(..) depending on the requested profile. Due to the 'strictMatch' argument the method fails early when unsatisfied also allowing to simplify createContextARBVersions(..) implementation.
* Fix Bug 658 (Mesa 9.0 3.1 Intel compat quirk, 3.1 core only) ; No ↵Sven Gothel2012-12-291-2/+4
| | | | | | | | | | | | | | | | | | | PROFILE_ALIASING compat -> core ; Fix setGLFunctionAvailability(..) failure path @ profile query - Add GLRendererQuirks.GLNonCompliant, marking a GL context/profile non compliant. Currently: 'Mesa DRI Intel(R) Sandybridge Desktop' && 3.1 compat profile - Fix Bug 658 (Mesa 9.0 3.1 Intel compat quirk, 3.1 core only) Detect case using new GLRendererQuirks.GLNonCompliant in setGLFunctionAvailability() and return 'false'. - No PROFILE_ALIASING compat -> core Use true core GL profiles / context if available to ensure proper API behavior across platforms due to different functionality. E.g. don't use GL3bc if GL3 is requested. - Fix setGLFunctionAvailability(..) failure path @ profile query Destroy temp context & zero result to cont. iterating through GL versions. This missing cleanup lead to returning the faulty GL context handle and it's mapping/usage.
* Adapt change of commit d93c5d23e304ea20e868595748f92a5bef4f5703 to unit test ↵Sven Gothel2012-12-291-2/+2
| | | | (GLCanvas realization point)
* adb-launch-main.sh: ANDROID_SDK_HOME -> ANDROID_HOMESven Gothel2012-12-271-2/+2
|
* Android build scripts: Fix env. name ANDROID_SDK_HOME -> ANDROID_HOMESven Gothel2012-12-272-20/+20
| | | | | | | | Intuitively I assumed ANDROID_SDK_HOME to be pointing to the SDK root dir, however this is not true: Semantics by Android tools are: ANDROID_SDK_HOME - Users ~/.android folder ANDROID_HOME - SDK root folder