summaryrefslogtreecommitdiffstats
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
* TestGLCanvasAWTActionDeadlock0[01]AWT: Disable 'restart' test on current ↵Sven Gothel2012-11-052-2/+4
| | | | | | (non AWT) thread - crashes on solaris (which is fine) Modifying AWT components shall always happen on AWT-EDT anyways.
* GLAutoDrawable: Refine API change of commit ↵Sven Gothel2012-11-051-4/+4
| | | | | | | | | | c002e04f848116922a1ed7bd96ead54961649bbd As suggested by Julien Gouesse, align 'enqueue(..)' method w/ 'invoke(..)': - public void enqueue(GLRunnable glRunnable); + public boolean invoke(boolean wait, List<GLRunnable> glRunnables);
* Analyzed OSX Deadlock w/ AWT Applet & CALayer: Andres Colubri's Test Case, ↵Sven Gothel2012-11-052-55/+127
| | | | | | | | | | | | | | | | | | | | | | Commit 77db6a5c22cb4a53cf911b4caf57127770c70968 [1] - The AWT/Applet test case on OSX utilized offscreen CALayer, which is correct. [2] - the GLEventListener.display(..) method calls Frame.setTitle(".."); which is correct, but freezes when called right after GLEventListener.init(..) BUG on OSX/CALayer: If frame.setTitle() is issued right after initialization the call hangs in at apple.awt.CWindow._setTitle(Native Method) at apple.awt.CWindow.setTitle(CWindow.java:765) [1.6.0_37, build 1.6.0_37-b06-434-11M3909] Happens w/ Oracle's JRE7u9 as well! Workaround: - Set 'justInitialized' flag in GLEventListener.init(..) - Clear 'justInitialized' flag in GLEventListener.display(..) at the end - Skip Frame.setTitle(..) in GLEventListener.display(..) if 'true == justInitialized' Somebody may send a bugreport to Oracle / OpenJDK.
* TestGLCanvasAWTActionDeadlock01AWT: Reproducing OSX deadlock variation, ↵Sven Gothel2012-11-041-0/+259
| | | | using Applet as component which provokes offscreen FBO layer.
* TestGLCanvasAWTActionDeadlock00AWT: Remove redundant argumentSven Gothel2012-11-041-3/+3
|
* TestGLCanvasAWTActionDeadlock01AWT -> TestGLCanvasAWTActionDeadlock02AWT; To ↵Sven Gothel2012-11-041-7/+7
| | | | add another intermediate unit test for analysis
* Adding Andres Colubri's Test Case (junit'fyed), which provokes a Deadlock on ↵Sven Gothel2012-11-042-0/+844
| | | | | | | | | | | | | | | OSX - Adding a similar one w/o deadlock and less framework bits. Andres Colubri reported a test case in the forum: <http://forum.jogamp.org/Thread-blocking-issue-with-AWT-but-not-NEWT-on-OSX-td4026674.html> Which is now included as TestGLCanvasAWTActionDeadlock01AWT. A similar w/ less framework bits and w/o dealock is also included as TestGLCanvasAWTActionDeadlock00AWT. A followup commit will incl. a fix after further analysis. A commit at this point where TestGLCanvasAWTActionDeadlock01AWT still freezes on OSX is done to be able to reproduce the bug and see the fix as a patch.
* GLAutoDrawable: Fix GLEventListener lifecycle and expose more user control ↵Sven Gothel2012-11-044-70/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (API Change) ; Added GLDrawableUtil A GLEventListener resides in two states, initialized and uninitialized. When added to a GLAutoDrawable, it is uninitialized. A first 'display()' will issue GLEventListener's 'init(..)' which renders it initialized. This is usually accompanied by 'reshape(..)' propagating the drawable's dimension. Destruction of the GLAutoDrawable will issue GLEventListener's 'dispose(..)' which renders it uninitialized. It turns our these means of GLEventListener controls are not sufficient in case the user requires to remove and add them during the lifecycle and rendering of their GLAutoDrawable host. GLAutoDrawable 'removeGLEventListener(..)' merely removes the GLEventListener from the list, but does not complete it's lifecycle, i.e. issues 'dispose(..)' if initialized to realease GL related resources. Hence the following essential API changes are made to complete the lifecycle: + public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove); disposing a single GLEventListener, allowing it's removal from the list being optional This is demonstrated via GLDrawableUtil.swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b), see below. ++++++++ Further more the following API changes were made to expose complete control of GLEventListener to the user: - public void removeGLEventListener(GLEventListener listener); + public GLEventListener removeGLEventListener(GLEventListener listener); The return value allows simple pipelining, and also delivers information whether the passed listener was actually removed. - public GLEventListener removeGLEventListener(int index) throws IndexOutOfBoundsException; + public int getGLEventListenerCount(); + public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException; Dropping the redundant removal by index, while adding count and get methods. + public boolean getGLEventListenerInitState(GLEventListener listener); + public void setGLEventListenerInitState(GLEventListener listener, boolean initialized); Allows retrieving and setting of listener states. All in all these API changes allows a user to experience all freedoms in dealing w/ GLEventListeners hosted by GLAutoDrawable impl. and shall be future proof. Note that we have avoided the Iterator pattern due to it's overhead of temporal objects creation. The simple indexed access allows us to implement each method as an atomic operation. +++++++++++ Further more a simple enqueue(..) method has been added, allowing to just enqueue a GLRunnable w/o provoking it's execution - as invoke(..) does. This method pleases a use case where GLRunnables are batched and shall be executed later on.. public boolean invoke(boolean wait, GLRunnable glRunnable); + public void enqueue(GLRunnable glRunnable); +++++++++++ Added GLDrawableUtil, exposes utility function to rearrange GLEventListener, modifiy GLAutoDrawable, etc. GLDrawableUtil.swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b) is tested and demonstrated w/ TestGLContextDrawableSwitchNEWT. Manually tested on X11, OSX and Windows.
* MacOSXCGLContext: Fix ShaderCode instantiation .. (duh!) ; Tested via ↵Sven Gothel2012-10-312-2/+7
| | | | reparenting TestParentingFocusTraversal01AWT
* Fix Unit Tests regarding commit 55f4405dbf9253e6ca686e44c50b2cfc1af7f3eb: ↵Sven Gothel2012-10-314-15/+16
| | | | Shader program name is valid if non-zero.
* Fix ProjectFloat (Bug 633): Adding missing offset of sliced buffer usage; ↵Sven Gothel2012-10-311-0/+109
| | | | | | reduce buffer usage (performance) in favor of float[]. Thomas De Bodt reported this error and provided the unit test.
* Add OSX CALayer OpenGL 3 (core) support: Derive pixelformat from parent ↵Sven Gothel2012-10-312-20/+30
| | | | | | | | (GL3), use GL3.2 compatible shader; Use VBO in general. Covered by: Auto unit tests: TestOffscreenLayer01GLCanvasAWT, TestOffscreenLayer02NewtCanvasAWT Manual: TestGearsES2AWT '-gl3 -layered'
* Shader: Add '#define texture2D texture' for GLSL >= 130 ; TestGearsES2AWT ↵Sven Gothel2012-10-318-16/+21
| | | | add forceGL3; TextureDraw01ES2Listener uses defaultShaderCustomization()
* TestInitConcurrent02NEWT: Disabled for auto unit test until further analysis ↵Sven Gothel2012-10-311-0/+12
| | | | - Windows/ATI driver crash
* Fix NEWT KeyEvent: Deliver keyChar w/ pressed and released; Deliver proper ↵Sven Gothel2012-10-3112-96/+402
| | | | | | | | | | | | | | | | | | | | | | modified flags and modifier-key events; Simplify Windows key handling Preface: Modifier-keys are SHIFT, CTRL, ALT and META and they have a matching modifier-bit. - Simplify Windows key handling - Employ MapVirtualKey(..) for virtual-key to character and scancode to virtual-key mappings, allowing to drop tracking of keyCode to keyChar in java code. This also removes the platform restriction of delivering keyChar at TYPED only. - Deliver keyChar w/ pressed and released - Due to the lift restriction on the Windows platform (see above), we can deliver keyChar w/ all key events on all platforms. - Deliver proper modified flags and modifier-key events All modifier-keys deliver pressed, released and typed events with their modifier-bit set. The above is covered by unit tests, which passed on X11, Windows and OSX (manual test run).
* TestNewtKey*: Don't test TAB (focus traversal, duh!); Add ↵Sven Gothel2012-10-304-15/+15
| | | | AWTRobotUtil.requestFocus(robot, ..) for kbd input on Windows (some 'confusion' w/ prev unit test runs)
* Fix AWTRobotUtil.keyType(..): 'c0' start count must be outside of retry ↵Sven Gothel2012-10-301-2/+5
| | | | loop; also wait a few ms after key action
* GLRendererQuirks.RequiresBoundVAO: Removed, it _is_ in the GL 3.2 core spec ↵Sven Gothel2012-10-292-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Setting up default VAO for all GL >= 3.2 core ctx. Refines commit 9b6448b1d54716fd455c0cad0c6133c0edeb3bb8 Due to GL 3.2 core spec: E.2. DEPRECATED AND REMOVED FEATURES (p 331) "There is no more default VAO buffer 0 bound, hence generating and binding one to avoid INVALID_OPERATION at VertexAttribPointer." More clear is GL 4.3 core spec: 10.4 (p 307): "An INVALID_OPERATION error is generated by any commands which modify, draw from, or query vertex array state when no vertex array is bound. This occurs in the initial GL state, and may occur as a result of BindVertexAr- ray or a side effect of DeleteVertexArrays." +++ I just have read (same spec) 2.10 (p 46/47): "An INVALID_OPERATION error is generated if any of the *Pointer commands specifying the location and organization of vertex array data are called while zero is bound to the ARRAY_BUFFER buffer object binding point, and the pointer argu- ment is not NULL." .. which only constraints the *Pointer command use to _VBO_, not forcing a VAO. +++
* TestNewtKeyEventAutoRepeatAWT: Wait for 'some' KeyEvents and check count; ↵Sven Gothel2012-10-292-3/+10
| | | | TestNewtKeyPressReleaseUnmaskRepeatAWT: Enable NewtCanvasAWT test
* Fix GLSL unit tests - Add GLSL version customization, fix one wrong 'HIGHP' ↵Sven Gothel2012-10-295-9/+16
| | | | usage
* GLSL Unit tests .. make them all GLSL version proofSven Gothel2012-10-2918-20/+87
|
* Complete Rename NEWT KeyEvent Unit tests, commit ↵Sven Gothel2012-10-294-8/+8
| | | | 85851c9839d620bcbbd07b6ca833f1a5901831cc
* Rename NEWT KeyEvent Unit tests to end w/ AWT, otherwise no AWT classes will ↵Sven Gothel2012-10-294-0/+0
| | | | be included in unit test run.
* GearsES2/RedSquareES2: Dump GLRendererQuirks at init.Sven Gothel2012-10-283-4/+6
|
* Minor edits FBObject/GearsObjectSven Gothel2012-10-281-6/+8
|
* Fix NEWT KeyCode: Basic KeyCode Validation on X11, Windows and OSXSven Gothel2012-10-282-0/+320
| | | | | | | - X11: Add VK_QUOTE mapping - OSX: Add single shift, ctrl alt key press; Fix mapping: Command -> Windows, Option -> ALT, add BACK_QUOTE and QUOTE.
* Fix Bug 631 and enhance 601: Handle multiple keys (pressed, released, types ↵Sven Gothel2012-10-273-4/+248
| | | | | | | | | | incl. auto-repeat) - Using keyCode (bit) maps to isPressed and isAutoRepeat, allowing use of multiple keys - Enhance unit test TestKeyEventOrderNEWT w/ injecting variations of 2 diff. keys - Manual tested on X11, Windows and OSX w/ and w/o auto-repeat
* Fix Bug 601 - Auto-Repeat Behavior: Adding unit tests for typed key order w/ ↵Sven Gothel2012-10-2614-27/+908
| | | | | | | | | and w/o auto repeat. Incl. fix for Windows. Auto-Repeat tests recognizes whether auto-repeat could be triggered by AWT Robot. The latter is not possible on Windows, hence manual testing was required on this platform. Impact: X11, Windows and OSX produce proper key sequence incl. auto-repeat modifier mask.
* ShaderCode: Add defaultShaderCustomization(..) to prelude shader source w/ ↵Sven Gothel2012-10-2613-80/+69
| | | | GLSL version and default precision (if GLES) - Used by GearsES2/RedSquare/PointDemo (Made GLSL version proof)
* FixedFuncPipeline: Require GLSL 1.20 (GL 2.1) due to GL driver bugs in OSX ↵Sven Gothel2012-10-233-3/+79
| | | | (gl_PointCoords n/a otherwise); Add FFP Emul point test in TestPointNEWT/PointDemoES1.
* FixedFuncPipeline GL_POINTS: Fix gl_PointSize (attribute data format), Add ↵Sven Gothel2012-10-226-0/+630
| | | | | | | | | | | | | | GL_POINT_SOFT and dist/fade attenuation (Adding basic POINT unit tests) gl_PointSize (and all other uniform array elems) was not propagated due to wrong usage of GLUniformData component param. Due to efficiency, we use vec4[2] now and #defines in shader to easy readability. GL_POINT_SOFT uses gl_PointCoord to determnine inside/outside circle position while adding a seam of 10% in/out. This almost matches 'other' implementations and gives a nice smooth circle. !GL_POINT_SOFT produces a proper square (billboard). Point-Vertex shader takes dist/fade attentuation into account.
* NEWT / BCM-VC-IV: Fix transparency according to given capabilitiesSven Gothel2012-10-191-0/+8
| | | | Tested manual w/ TestGearsES2NEWT on Raspberry Pi
* Adding unit tests for ImmModeSink and FixedFunctionPipeline (single & ↵Sven Gothel2012-10-1210-258/+669
| | | | combinations, plus texture usage)
* GLArrayData* VBO binding: Adding explicit bindBuffer(..) method, since VBO ↵Sven Gothel2012-10-121-4/+4
| | | | | | | | | is not more bound after enableBuffer(); Fix unit test (test VBO bound). Explicit bindBuffer(..) is required now, since enableBuffer() doesn't leave it bound. See fixed VBORegion* patch for use case, i.e. using a VBO index buffer for glDrawElements(). Complets commit 8582ece7dc7f65271b3184261697a542766d9864.
* TestSWTAccessor03AWTGLn: Add '-time <duration>' commandline optionSven Gothel2012-10-101-1/+7
|
* ImmModeSink: Fix bugs (use glBufferUsage, vboUsage, GL_POLYGON, GL_QUADS) ↵Sven Gothel2012-10-104-13/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and add API docs. (API Change) - Changed create*(..) factory methods (API Change) - Drop passing GL instance, not needed - allows creation of ImmModeSink as final field w/o GL context - Use 'glBufferUsage' to determine whether to use VBO or not ( 0 == glBufferUsage ) - Use glBufferUsage in glBufferData(..) call (oops) - Toggle vboUsage per object ( 0 == glBufferUsage ? nonVBO : VBO ) remove static VBO usage flag - Fix render mode - GL_POLYGON -> GL_TRIANGLE_FAN (not GL_LINES) - GL_QUADS -> Looped GL_TRIANGLE_FAN (is !GL2) in draw(..) w/ and w/o indices - Buffer usage - documented - allow creating sink w/ all components (vertices, color, normal and texCoords) bit render and grow only used parts. This allows proper usage of sink where it is not known which types are being used. - Added test case - Manually tested w/ Jake2 ES1 Jake2 uses the FFP immediate mode rendering, where we utilize this sink w/o rendering artifacts.
* UITestCase: Only print each display/reshape in verbose modeSven Gothel2012-10-101-2/+10
|
* FloatUtil/PMVMatrix/GLUniformData: Move impl. of FloatBuffer matrix ↵Sven Gothel2012-10-101-4/+68
| | | | toString(..) from PMVMatrix to FloatUtil and make it more generic; GLUniformData toString() also dumps it's matrices.
* TestInitConcurrent0[12]NEWT: Reduce test w/ 16 threads to 6 for ARM || ↵Sven Gothel2012-10-092-6/+18
| | | | | | | | | | | WINDOWS if not started from console Sadly it appears that w/ the ATI Catalyst driver, the TestInitConcurrent02NEWT w/ 16 concurrent threads brings down the JVM sometimes. This results in a locked singleton thread and distrubs the whole unit tests session. We are aware of the ATI Catalyst threading bug on Windows and Linux.
* Adding unit test for Bug 605 - WORKSFORME, i.e. no unwanted y-flip, so I can ↵Sven Gothel2012-10-063-27/+393
| | | | just assume it's the SW renderer, flipping.
* Refine ed7d5f2e3fc696d47b10c8d62a071643bf385588, set and restore FBO caps @ ↵Sven Gothel2012-10-051-20/+33
| | | | | | | setRealized(true/false) already, refine at initialize(true) Allowing to validate the on-/offscreen state after setRealized(true). Adding comment in GLFBODrawable.
* FBO/Offscreen: Use most simple GLCapabilities for GLFBODrawableImpl's ↵Sven Gothel2012-10-051-3/+4
| | | | | | | | | | | | | | | | | underlying dummy surface/drawable If stencil or MSAA has been selected, the underlying dummy drawable doesn't need to have this configuration, i.e. doesn't need to waste the resources. - Creation of the dummy surface/drawable uses a simple GLCapabilities - Requested FBO GLCapabilities is being passes down to the dummy drawable - GLFBODrawableImpl ctor leaves caps untouched - GLFBODrawableImpl.initialize(boolean realize) - realize == true: using the requested FBO caps and setting it in the parent dummy drawable - realize == false: restore the original caps of dummy drawable
* UITestCase.snapshot: Add Depth and Stencil bits to filenameSven Gothel2012-10-051-2/+4
|
* Fix Bug 572 (2nd time): GLCanvas.validateGLDrawable() @ display() and ↵Sven Gothel2012-10-052-2/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | reshape() ; GLCanvas.reshape() only if drawble valid ; GLCanvas.validateGLDrawable() also test isDisplayable() ; Fix size validation ; resizeOffscreenDrawable(..) don't validate 'safe' size 1x1 - GLCanvas.validateGLDrawable() @ display() and reshape() To help users using GLCanvas w/ having a realized GLCanvas/Drawable, validateGLDrawable() is also called at reshape(). This shall ensure a valid drawable after even a non AWT-EDT issued first setVisible(). - GLCanvas.reshape() only if drawble valid Otherwise offscreen reshape attempts would happen even on unrealized drawable, which is not necessary. - GLCanvas.validateGLDrawable() also test isDisplayable() To make sure the native peer is valid, also test isDisplayable() - Fix size validation Since we have experienced odd size like 0 x -41 test each component, i.e. 0 < width && 0 < height. This is done through all JOGL/NEWT components. - resizeOffscreenDrawable(..) don't validate 'safe' size 1x1 In case method is called w/ odd size, i.e. 0 x -41, the safe size 1x1 is used. However, we cannot validate this size. Dump WARNING if odd size is detected.
* Fix regression of commit a644d779ab19cb1d200ae4ba567b9c042c34b337, cannot ↵Sven Gothel2012-10-041-5/+5
| | | | | | compile FixedFuncHook due to removed 'isDirty()' - getModifiedBits() -> getModifiedBits(boolean clear)
* Update PMVMatrix/GLMatrixFunc API doc and refine PMVMatrix update / ↵Sven Gothel2012-10-043-3/+431
| | | | | | | | | | | | | | | | | | | | | | get-Mvi/Mvit-Matrix operation. (Minor API change) Using bitmask for requested Mvi and Mvit matrices, same as dirty-bits to ease matching and update operation. Update of Mvi and Mvit will be performed only if it's dirty-bit and request-bit set within update(). The individual dirty bit is cleared only if it's matrix update is performed. Update is also issued at get-Mvi/Mvit-Matrix operations to ensure proper values w/o update call w/o clearing the modified-bits. update() returns true if the Mvi or Mvit matrix got updated _or_ one of the modified bits is set. update() clears the modified-bits. Adding explicit getModifiedBits() to get and clear it's state. Adding unit test. Lots of API docs ..
* Workaround for Bug 623: Sporadic XCB assertion failures w/ ATI proprietary ↵Sven Gothel2012-09-302-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | driver and w/o native X11 locking The proprietary ATI X11 driver does not handle multi-threaded [GL] clients well, i.e. triggers an XCB assertion 'from time to time'. It almost seems like that the driver either: - aliases all display connections to it's connection name, i.e. server; or - utilizes a build-in display connection w/o locking, used for some reason +++ - X11Lib: Add QueryExtension(dpy, name) allowing early driver determination w/o GL - X11Util detects 'requiresGlobalToolkitLock' and 'markAllDisplaysUnclosable' via X11 extensions. In case certain ATI extensions are available, both are set to true. - X11GLXDrawableFactory: Dropped setting 'markAllDisplaysUnclosable', using X11Util's detection (see above). - New GlobalToolkitLock to satisfy certain driver restrictions (ATI's XCB multithreading bug) - NativeWindowFactory handles new property requiresGlobalToolkitLock, in which case the new GlobalToolkitLock is being used instead of ResourceToolkitLock. - JAWTUtil ToolkitLock locks GlobalToolkitLock 1st to match new 'requiresGlobalToolkitLock' property. - Document static method requirement of X11Util, GDIUtil and OSXUtil via marker interface ToolkitProperties - ToolkitLock: New method 'validateLocked()', allowing use to validate whether the device/toolkit is properly locked and hence to detect implementation bugs. See unit test class: ValidateLockListener
* Misc X11: Add GLX_MESA_swap_control; GLXExtensions (private); X11GLXContext ↵Sven Gothel2012-09-292-2/+4
| | | | commented out GLX_MESA_swap_control; native test of Mesa context-retarget bug, cannot reproduce yet.
* Adding Mesa Quirk 'NoSetSwapIntervalPostRetarget': SIGSEGV on ↵Sven Gothel2012-09-281-6/+16
| | | | | | | | | | | | setSwapInterval() after changing the context's drawable w/ 'Mesa 8.0.4' dri2SetSwapInterval/DRI2 (soft & intel) Analyzing 'TestGLContextDrawableSwitchNEWT' crash at setSwapInterval -> dri2SetSwapInterval after retargeting the context (new drawable association). Turns out Mesa's dri2SetSwapInterval may have a bug. +++ GLContext TRACE_SWITCH: Add drawable handle to debug/trace output.
* NEWT X11 ScreenMode: Ignore invalid rotation eventSven Gothel2012-09-281-13/+35
|