aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
* Bug 1468 - SIGSEGV on use after free when destroying NEWT Window/Display via ↵Sven Gothel2023-10-023-3/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a native dispatch'ed event like key/mouse/touch input SIGSEGV on use after free of native X11 Display* at XEventsQueued in DisplayDriver.DispatchMessages0. This potentially happens when an application destroys the NEWT Window/Display from an action being called directly from DisplayDriver.DispatchMessages0 (itself), i.e. keyboard or mouse input. DisplayDriver.DispatchMessages0 stays in the event loop and the next XEventsQueued call causes a SIGSEGV due to already deleted display driver connection and hence invalid native X11 Display*. This issue also exist for other Windowing System drivers, where the native (dispatch) method sticks to a loop and still (re)uses the window or display handle. One is WindowsWindow, where touch events are looped, but such handler could have closed the window. Querying the status of a window / display instance before dispatching is not be good enough - resource could already be GC'ed, so we also would need to query jobject status - would imply an addition Java callback +++ This fix: Having the Java callbacks return a boolean with the value Window.isNativeValid(). This way the dispatch logic - can bail out right away w/o using the resource anymore - must be reviewed by myself due to changed Call{Void->Boolean}*(..) invocation change. This review shall resolve potential similar issues. +++ Tested on X11/Linux/GNU, Windows and MacOS with new TestDestroyGLAutoDrawableNewtAWT, which tests all destruction invocation variants.
* Bug 1431: Fix NewtCanvasAWT resize on X11, broken since commit ↵Sven Gothel2023-09-292-0/+240
| | | | | | | | | | | | | | | | | | | | | ad38d1559854985b1131e5b6c7274a392b5bc265 Commit ad38d1559854985b1131e5b6c7274a392b5bc265 introduced XTranslateCoordinates(..) to savely validate the client-space window position against the parent (root). Totally missing in this change was the NEWT child window case since it always used the root-window as the destination. This change tracks the parent-window (valid parent Window or NULL) within the JavaWindow struct and either uses the parent-window if available or the root-window for XTranslateCoordinates(..). This results in the proper client-space position. Validated against - TestGearsES2NewtCanvasAWT - TestBug1431NewtCanvasAWT on Debian 12 w/ Java17.
* Graph Font Tests: Fix missing codepoint -> GlyphID conversionSven Gothel2023-09-243-3/+3
|
* Bug 1462 - Graph Font: Add name + codepoint to ID and Glyph mapping plus ↵Sven Gothel2023-09-242-11/+9
| | | | | | | | | traversing through all Glyphs See UISceneDemo03 new Button(options.renderModes, fontSymbols, " "+fontSymbols.getUTF16String("pause")+" ", buttonWidth, buttonHeight); // pause Unicode codepoint symbol is also contained in FontGlyph
* GraphUI Test: FontViewListener01: Align to FontView01 .. fix invsible ↵Sven Gothel2023-09-202-28/+33
| | | | GlyphShape by adding a BoxLayout w/ Center and parent Group w/ GridLayout FillCenter
* Bug 1452 - Decouple math functionality to 'com.jogamp.math' to be toolkit ↵Sven Gothel2023-09-2052-296/+280
| | | | | | | | | | | | | | | | | | | | agnostic (PMVMatrix, Matrix4f, Vec4f, ..) Math functionality (PMVMatrix, Matrix4f, Vec4f, ..) - shall be used toolkit agnostic, e.g. independent from OpenGL - shall be reused within our upcoming Vulkan implementation - may also move outside of JOGL, i.e. GlueGen or within its own package to be reused for other purposed. The 'com.jogamp.opengl.util.PMVMatrix' currently also used to feed in GLUniformData via the toolkit agnostic SyncAction and SyncBuffer shall also be split to a toolkit agnostic variant. An OpenGL PMVMatrix specialization implementing GLMatrixFunc can still exist, being derived from the toolkit agnostic base implementation. +++ Initial commit .. compile clean, passing most unit tests.
* FloatUtil.isEqual(..): Rename raw {isEqual->isEqualRaw}(a,b) varianr w/o ↵Sven Gothel2023-09-032-37/+37
| | | | | | EPSILON; Add isEqual(a,b) w/ default EPSILON; Use it where applicable Also add isEqual2(a,b) w/o corner cases (NaN, Inf) used for comparison in Graph Outline, OutlineShape and later GraphUI Shape.
* GraphUI Scene: Pass sampleCount in ctor variant and refine API doc, clip to ↵Sven Gothel2023-09-031-2/+1
| | | | [1..8]; Add clarity in Region; Demos CommandlineOptions adds actual graphAASamples set and utilized
* PMVMatrix.gluPerspective(): Redfine angle in radians instead of degrees ** ↵Sven Gothel2023-09-028-14/+20
| | | | | | | | API Change ** Since this is an extra implementation of PMVMatrix and not of GLMatrixFunc, we shall use the default ISO dimension avoiding conversion. This alsi redefined Graph's RegionRenderer.reshapePerspective() angle definition from degrees to radians
* Add TestVec3f01NOUI: This test shall be enhanced, only priliminary angle ↵Sven Gothel2023-08-271-0/+137
| | | | tests for now
* TestSWTAccessor02NewtGLWindow: Use lambda for SWTAccessor.invokeOnOSTKThread(..)Sven Gothel2023-08-231-4/+5
|
* Bug 1310: Detect missing glViewport(..) on Windows before ↵Sven Gothel2023-08-181-2/+24
| | | | | | | | | | | | | | | | | GLEventListener.reshape(..) when re-adding GLJPanel When re-adding GLJPanel on Windows glViewport() is not called through - GLJPanel.Updater.display() - GLDrawableHelper.reshape() - GLDrawableHelper.setViewportAndClear() Instead the following sequence is called due to sendReshape == false: - GLJPanel.Updater.display() - GLDrawableHelper.display() ** missing glViewport(..) ** This bug is not visible on X11 or MacOS since the glViewport is only set to a different user value on Windows ...
* Animator*: Add ctor variants passing modeBits directly, i.e. enable/disable ↵Sven Gothel2023-08-1339-673/+731
| | | | AWT rendering thread support. Adopt it in tests and demos
* FontViewListener01/TestTextRendererNEWT21: Use 30 pixelPerCell (total w/ ↵Sven Gothel2023-08-121-10/+21
| | | | gap) for test case to compare pixel-by-pixel
* Test Bug1310: Remove and re-add a GLJPanel from its Swing parent (working)Sven Gothel2023-08-071-0/+246
| | | | Also tested with Sofr-HiDPI on Linux using GDK_SCALE=2
* Graph: Simplify RegionRenderer API by exposing common RenderState methods ↵Sven Gothel2023-08-028-28/+22
| | | | (and fwd 'em to RenderState aggregate)
* Graph RegionRendered.init(..): Disable renderer (and shader programs etc) to ↵Sven Gothel2023-08-011-2/+1
| | | | avoid side-effects. Usually called @ GLEventListener.init(..)
* HiDPI: Revise AWT GLCanvas/GLJPanel ScalableSurface: No setSurfaceScale(), ↵Sven Gothel2023-05-152-2/+211
| | | | | | | | | | | have AWT toolkit define pixelScale only (simplification) This aligns with Glenn's initial AWT patch commit e5e7514d649cd7dd28bbb8e04b72338dc09c2c83, i.e. removing redundancies... Tested on Linux, Windows and MacOS w/ GLCanvas, GLJPanel and GLWindow using pixelScale values: - Linux: 1, 2 - Windows: 1, 1.25, 2 - MacOS: 1, 2
* HiDPI: Complete testing on Windows (AWT, NEWT, AWT+NEWT): AWT pixel scale ↵Sven Gothel2023-05-142-4/+10
| | | | propagated properly to our AWT GLCanvas and NEWT
* HiDPI AWT/NEWT: Propagate AWT enforced pixelScale via setSurfaceScale() ↵Sven Gothel2023-05-142-12/+705
| | | | blocking native change by monitor-pixelScale (Windows, X11)
* HiDPI: TestGearsES2NEWT: Show MonitorDevice properties, validating pixelScaleSven Gothel2023-05-131-0/+5
|
* GraphUI Working GridLayout w/ and w/o cell-size and alignment; Added BoxLayout.Sven Gothel2023-04-291-2/+3
|
* Graph GLRegion/TextRegionUtil: Enhance pre-determination of buffer-size, ↵Sven Gothel2023-04-205-8/+11
| | | | | | | | | | increase default initial 16->64 (unsued) - Region.countOutlineShape(..) now returns unpatched 3*triangle value for indices, avoiding grow - TextRegionUtil.addStringToRegion() uses countStringRegion(..) per default - Added GLRegion.create(.., OutlineShape) for convenience, using Region.countOutlineShape(..) - Refined API doc -
* GraphUI Test: Have TestTextRendererNEWT21's FontViewListener01 use 8mm/cell ↵Sven Gothel2023-04-181-1/+1
| | | | | | to match old screenshots for regression test. No rendering regressions w/ last Graph changes found.
* GraphUI Padding: Use CSS alike ctor semantics, hence swizzle ctor argumentsSven Gothel2023-04-181-1/+1
|
* Graph + GraphUI: Consolidate Vertex: Drop SVertex and factory, use Vec[234]f ↵Sven Gothel2023-04-182-3/+4
| | | | | | | | | | | instead of float[] and remove unused VectorUtil methods After Matrix4f consolidation and proving same or better performance on non array types, this enhances code readability, simplifies API, reduces bugs and may improve performance. GraphUI: - Have RoundButton as a functional class to make a round or rectangular backdrop, i.e. impl. addShapeToRegion() via reused addRoundShapeToRegion()
* GraphUI Demo/Test: FontView[Listener]01: Use 10 'mmPerCell', Monitor ↵Sven Gothel2023-04-141-6/+24
| | | | resolution independent for display same size.
* GraphUI Tests: Add TestTextRendererNEWT21 using FontViewListener01 (like ↵Sven Gothel2023-04-142-0/+458
| | | | FontView01 demos) rendering a grid of each glyph for better validation for many fonts and renderModes/sampleCount
* Graph Unit Tests: Minor edits: Wait for GLRunnable done on screenshot, ...Sven Gothel2023-04-143-3/+6
|
* Matrix4f.mapWin*(): Drop unused temp matrices, map*() returns false on ↵Sven Gothel2023-04-096-80/+174
| | | | | | | | | | | | | | | | | | | | | | | | invPMv null; PMVMatrix: Make Mvi, Mvit optional at ctor, add user PMv and PMvi - used at gluUnProject() .. Matrix4f.mapWin*() variants w/ invPMv don't need temp matrices, they also shall handle null invPMv -> return false to streamline usage w/ PMVMatrix if inversion failed. PMVMatrix adds user space common premultiplies Pmv and Pmvi on demand like Frustum. These are commonly required for e.g. gluUnProject(..)/mapWinToObj(..) and might benefit from caching if stack is maintained and no modification occured. PMVMatrix now has the shader related Mvi and Mvit optional at construction(!), so its backing buffers. This reduces footprint for other use cases. The 2nd temp matrix is also on-demand, to reduce footprint for certain use cases. Removed public access to temporary storage. +++ While these additional matrices are on demand and/or at request @ ctor, general memory footprint is reduced per default and hence deemed acceptable while still having PMVMatrix acting as a core flexible matrix provider.
* PMVMatrix rewrite using Matrix4f, providing SyncMatrix4f* for GLUniformData; ↵Sven Gothel2023-04-0740-1039/+727
| | | | | | | | | | | | | | | | | Utilize Vec3f, Recti, .. throughout API (Matrix4f, AABBox, .. Graph*) Big Easter Cleanup - Net -214 lines of code, despite new classes. - GLUniformData buffer can be synced w/ underlying data via SyncAction/SyncBuffer, e.g. SyncMatrix4f + SyncMatrices4f - PMVMatrix rewrite using Matrix4f and providing SyncMatrix4f/Matrices4f to sync w/ GLUniformData - Additional SyncMatrix4f16 + SyncMatrices4f16 covering Matrix4f sync w/ GLUniformData w/o PMVMatrix - Utilize Vec3f, Recti, .. throughout API (Matrix4f, AABBox, .. Graph*) - Moved FloatUtil -> Matrix4f, kept a few basic matrix ops for ProjectFloat - Most, if not all, float[] and int[] should have been moved to proper classes - int[] -> Recti for viewport rectangle - Matrix4f and PMVMatrix is covered by math unit tests (as was FloatUtil before) -> save Passed all unit tests on AMD64 GNU/Linux
* Matrix4f Perf: Enhance invert(), Drop (test) load on Matrix4f.mul(Matrix4f) ↵Sven Gothel2023-04-053-98/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for fair and realistic numbers - Both mul() ops faster than FloatUtil Enhanced invert() of Matrix4f* and FloatUtil: Use 1f/det factor for burst scale. Enhanced Matrix4f.invert(..): Use factored-out mulScale() to deliver the scale, giving a good 10% advantage on aarch64 and amd64. Brings Matrix4f.invert(..) on par w/ FloatUtil, on aarch64 even a 14% advantage. +++ TestMatrix4f02MulNOUI added an additional Matrix4f.load() to the mul(Matrix4f) loop test, which surely is an extra burden and not realistic as the mul(Matrix4f, Matrix4f) and FloatUtil pendants also don't count loading a value. Matrix4f.mul(Matrix4f) shall be used to utilize an already stored value anyways. Matrix4f.mul(Matrix4f) didn't really exist in FloatUtil. Same is true for Matrix4f.invert(), re-grouped order, i.e. pushing the non-arg variant last. +++ Revised performance numbers from commit 15e60161787224e85172685f74dc0ac195969b51 AMD64 + OpenJDK17 - FloatUtil.multMatrix(a, a_off, b, b_off, dest) is considerable slower than all - Matrix4f.mul(a, b) roughly ~10% faster than FloatUtil.multMatrix(a, b, dest) - Matrix4f.mul(b) roughly ~18% faster than FloatUtil.multMatrix(a, b, dest) (*) - Matrix4f.invert(a) roughly ~ 2% faster than FloatUtil.invertMatrix(..) - Matrix4f.invert() roughly ~ 4% slower than FloatUtil.invertMatrix(..) (*) - Launched: nice -19 scripts/tests-x64.sh RaspberryPi 4b aarch64 + OpenJDK17 - FloatUtil.multMatrix(a, a_off, b, b_off, dest) is considerable slower than all - Matrix4f.mul(a, b) roughly ~ 9% faster than FloatUtil.multMatrix(a, b, dest) - Matrix4f.mul(b) roughly ~14% faster than FloatUtil.multMatrix(a, b, dest) (*) - Matrix4f.invert(a) roughly ~14% faster than FloatUtil.invertMatrix(..) - Matrix4f.invert() roughly ~12% faster than FloatUtil.invertMatrix(..) (*) - Launched: nice -19 scripts/tests-linux-aarch64.sh (*) not a true comparison in feature, as operating on 'this' matrix values for one argument, unavailable to FloatUtil. Conclusion - Matrix4f.mul(..) is considerable faster! - Matrix4f.invert(..) faster, esp on aarch64 And additional Matrix4fb tests using float[16] similar to FloatUtil also demonstrates less performance compared to Matrix4f using dedicated float fields.
* TestAWTCardLayoutAnimatorStartStopBug532: Suppress warningsSven Gothel2023-04-051-1/+10
|
* Math: Complete Matrix4f w/ Vec[234]f and adopt it throughout Quaternion, ↵Sven Gothel2023-04-0513-408/+3218
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ray, AABBox, Frustum, Stereo*, ... adding hook to PMVMatrix Motivation was to simplify matrix + vector math usage, ease review and avoid usage bugs. Matrix4f implementation uses dedicated float fields instead of an array. Performance didn't increase much, as JVM >= 11(?) has some optimizations to drop the array bounds check. AMD64 + OpenJDK17 - Matrix4f.mul(a, b) got a roughly ~10% enhancement over FloatUtil.multMatrix(a, b, dest) - Matrix4f.mul(b) roughly ~3% slower than FloatUtil.multMatrix(a, b, dest) - FloatUtil.multMatrix(a, a_off, b, b_off, dest) is considerable slower than all - Matrix4f.invert(..) roughly ~3% slower than FloatUtil.invertMatrix(..) RaspberryPi 4b aarch64 + OpenJDK17 - Matrix4f.mul(a, b) got a roughly ~10% enhancement over FloatUtil.multMatrix(a, b, dest) - Matrix4f.mul(b) roughly ~20% slower than FloatUtil.multMatrix(a, b) - FloatUtil.multMatrix(a, a_off, b, b_off, dest) is considerable slower than all - Matrix4f.invert(..) roughly ~4% slower than FloatUtil.invertMatrix(..) Conclusion - Matrix4f.mul(b) needs to be revised (esp for aarch64) - Matrix4f.invert(..) should also not be slower ..
* Graph FontScale: Simplify names, fix API doc and add unit testSven Gothel2023-03-285-4/+66
|
* Graph Font: Rename getBBox*() -> getBounds*() to preserve a common semantic nameSven Gothel2023-03-271-2/+2
|
* Graph: Cleanup Vertex.Factory referencing: Only bind to OutlineShape and use ↵Sven Gothel2023-03-213-4/+4
| | | | | | | its default. GraphUI: Always use default. Graph RegionRenderer, its RenderState as well as GraphUI's Scene don't need to have knowledge of Vertex.Factory, which is only used within OutlineShape and its 'inner geom workings'.
* API doc cleanup, add + refine math testsSven Gothel2023-03-1913-11/+547
| | | | API doc
* Graph: Make RenderState a composition of RegionRenderer, which also creates ↵Sven Gothel2023-03-1510-83/+44
| | | | and destroys it. Dropping this also from user (complexity).
* Graph: Have RegionRenderer.reshapeNotify(..) track x/y as well (vieport); ↵Sven Gothel2023-03-141-1/+1
| | | | GraphUI.Scene using RegionRenderer's viewport (no duplicate)
* TextureSequence (API Change): Use setTextureLookupFunctionName(..) ↵Sven Gothel2023-03-141-1/+7
| | | | explicitly to set the name upfront, clarifying workflow. Impl: ImageSequence + GLMediaPlayerImpl
* Graph: Add GLRegion creation w/ pre-calculating its buffer sizes; ↵Sven Gothel2023-03-132-20/+4
| | | | | | TextRegionUtil: Use pre-calc'ing buffer sizes for GLRegion; TextRendererGLELBase: Fix temp AffineTransform usage
* Move png assets (NEWT icons + GLMediaPlayer dummy/test) to simple classpath, ↵Sven Gothel2023-03-131-2/+4
| | | | allowing access w/o jars. TODO: Test Android.
* Cleanup Demos: Move demos to jogl-demos.jar (here Graph + AudioVideo), ready ↵Sven Gothel2023-03-1161-12233/+5
| | | | for easy deployment and test w/ junit/ant
* GraphUI: Promote API to JOGL via graphui.jar or within any jogl-all*.jar (WIP)Sven Gothel2023-03-1027-2686/+112
| | | | | | | | | | Root package is 'com.jogamp.graph.ui.gl', i.e. a sub-package of Graph denoting UI and OpenGL usage. Implementation will stay small, hence relative files size costs are minimal. Source and build is in parallel to nativewindow, jogl and newt and has a dependency to all of them. The NEWT dependencies are merely the input listener ..
* GraphUI: Revision: Simplify resource handling via SceneUIController, add ↵Sven Gothel2023-03-097-297/+818
| | | | general functionality in UIShape (drag, ..)
* Adopt to RegionRenderer.init(..) dropped unused renderModes argumentSven Gothel2023-03-096-6/+6
|
* Rename NonFSAAGLCapabilitiesChooser -> NonFSAAGLCapsChooser (too long)Sven Gothel2023-03-083-6/+6
|
* TestTextRendererNEWT20: Cover Graph-VBAA, Graph-MSAA, FSAA, NONE .. (have ↵Sven Gothel2023-03-083-21/+76
| | | | proper filenames for screenshots)
* Apply NonFSAAGLCapabilitiesChooser in NEWTGLContext (tests only). TODO: ↵Sven Gothel2023-03-083-2/+10
| | | | Consider applying it in default chooser?