summaryrefslogtreecommitdiffstats
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
* Graph: Path2D -> self-contained Path2D (w/ Iterator) fixed; OutlineShape: ↵Sven Gothel2023-02-065-19/+360
| | | | | | Add Path2F addPath(..), emphasize required Winding.CW GPURegionGLListener01 used by TestRegionRendererNEWT01 covers Path2F CCW and CW (reverse add) methods.
* Graph: Fix Region/Text Renderer: Add RegionRenderer enable/disable for ↵Sven Gothel2023-02-053-0/+11
| | | | blending stubs in display (Mesa3D results are otherwise broken)
* Graph: TestTextRendererNEWT01: No VBAA sample-count on MSAA test, fixed ↵Sven Gothel2023-02-051-6/+13
| | | | window size 1024x640
* Graph: TestTextRendererNEWT00: Alin w/ other tests, add DEPTH_TEST and allow ↵Sven Gothel2023-02-051-2/+13
| | | | custom window size
* Graph: Complete move jogamp.graph.plane to public com.jogamp.graph.planeSven Gothel2023-02-043-8/+3
|
* NEWT Soft-PixelScale (p7): get{Global->}PixelScaleEnv(..): Support per ↵v2.4.0Sven Gothel2023-01-311-2/+4
| | | | | | | | | | | | | | | | | monitor values w/ QT_SCREEN_SCALE_FACTORS syntax, use for X11 Per-monitor values are parsed if value is not a float and stored in a given Map<String,float[2]>, parallel to a detected global_pixel_scale_xy. The per-monitor value syntax matches QT_SCREEN_SCALE_FACTORS, i.e. the regular expression '(<string>=<float>;)+', e.g. QT_SCREEN_SCALE_FACTORS='DP-1=1.25;DP-2=1.25;HDMI-1=1.25;' The per-monitor value is preferred and on X11 stored within the MonitorDevice, matching the MonitorDevice's name. The following env-var names are searched on X11: "QT_SCREEN_SCALE_FACTORS", "QT_SCALE_FACTOR", "GDK_SCALE", "SOFT_SCALE"
* NEWT Soft-PixelScale (p6): Implement Soft-PixelScale for X11 and Windows ... ↵Sven Gothel2023-01-313-6/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (working state) Both: - Using Soft-PixelScale mode, i.e. converting all given window-units to pixel-units for native GDI/X11 ops - Using scaled pixel-sized surface - Adjusting NEWT's Monitor's window-unit viewport value to pixel-scale For X11: - Using global scale factor from environment variable, either: "GDK_SCALE", "QT_SCALE_FACTOR" or "SOFT_SCALE". The latter is for testing only. See https://wiki.archlinux.org/title/HiDPI For Windows: - Using actual monitor's pixel-scale via native SHC API (Shellscaling API, shcore.dll) Misc: - SurfaceScaleUtils.getGlobalPixelScaleEnv() reads a float value from given env names, first come, first serve - MonitorModeProps.streamInMonitorDevice(..): Add `invscale_wuviewport` argument to scale wuvieport for soft-pixel-scale - TestGearsNEWT: Enhance GL2 demo to be suitable for manual tests, this since my Windows KVM machine doesn't support ES2 - TestGLContextDrawableSwitch10NEWT: Add a few more test constraints .. working Tested: - Manually on a Windows virtual machine (KVM) using - 2 virtualized 'Video QXL' cards and - and 'remote-viewer' to see the 2 monitors since `Virtual Machine Manager` build-in doesn't support - remote-viewer spice://localhost:5917 - Manually on a Linux machine w/ SOFT_SCALE - Both, X11 and Windows - Place window on each monitor - Move window across monitors w/ pixel-scale change (or not) - TODO: Test and fix utilization with AWT, i.e. NewtCanvasAWT
* NativeWindow: Add getBounds() (moved from NEWT Window) and getSurfaceBounds()Sven Gothel2023-01-311-3/+14
|
* GDIUtil: Add GetMonitor*() variants incl. PixelScale; NEWT MonitorDevice: ↵Sven Gothel2023-01-291-2/+5
| | | | Add 64-bit nativeHandle (Windows HMONITOR), add PixelScale for Windows
* TestDisplayLifecycle01NEWT: Invisible window might have been moved away ↵Sven Gothel2023-01-232-5/+21
| | | | (Windows 10)
* Execute AWT's Frame.setTitle() on AWT-EDT if already visible (avoid rare ↵Sven Gothel2023-01-223-13/+35
| | | | deadlock)
* TestSharedContextVBOES2SWT3: Remove unused importSven Gothel2023-01-221-1/+0
|
* Workaround MacOS + SWT 4.26: java.lang.NullPointerException: Cannot invoke ↵Sven Gothel2023-01-224-67/+143
| | | | | | | | | | | | | | | | | | | | | | | | | "org.eclipse.swt.internal.cocoa.NSGraphicsContext.saveGraphicsState()" because "context" is null On MacOS 12+ and SWT 4.26 while not using AWT (-Djava.awt.headless=true, -XstartOnFirstThread), we recently get the following Exception from SWT (suppressed): java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.internal.cocoa.NSGraphicsContext.saveGraphicsState()" because "context" is null at org.eclipse.swt.widgets.Widget.drawRect(Widget.java:764) at org.eclipse.swt.widgets.Canvas.drawRect(Canvas.java:170) at org.eclipse.swt.widgets.Display.windowProc(Display.java:6287) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:5565) at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5965) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(NSApplication.java:92) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3983) at com.jogamp.opengl.test.junit.util.SWTTestUtil$WaitAction$1.run(SWTTestUtil.java:52) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:183) at org.eclipse.swt.widgets.Display.syncExec(Display.java:5250) at com.jogamp.opengl.test.junit.util.SWTTestUtil$WaitAction.run(SWTTestUtil.java:63) at com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2SWT3.test02AsyncEachAnimator(TestSharedContextVBOES2SWT3.java:376) This is not observed if running using AWT (-Djava.awt.headless=false).
* AWTRobot.getClickTimeout(): NEWT Case: Return maximum(AWT, NEWT), otherwise ↵Sven Gothel2023-01-222-18/+43
| | | | we see click-count 2 on MacOS 12
* Test MouseAdapter: Use volatile qualifier to avoid reading too old valuesSven Gothel2023-01-222-6/+6
|
* Minor auto formatting: @Override, ..Sven Gothel2023-01-224-5/+38
|
* TestSharedContextVBOES2NEWT5: Try harder having the objects destroyed and ↵Sven Gothel2023-01-211-1/+7
| | | | | | taken from the GLContextShareSet map The objects were more sticky on my MacOS 12 x86_64 machine, this double GC w/ sleep 100ms resolved it.
* Test: Linux: Disable automatic tests (TBD, WIP)Sven Gothel2023-01-181-17/+31
|
* Test: MacOS: Disable automatic tests (TBD, WIP)Sven Gothel2023-01-183-0/+47
|
* Test*NewtEventModifiers*: Ensure SWT is initialized before AWTSven Gothel2023-01-175-25/+66
|
* SWTTestUtil: Add WaitAction2, using the EDTUtil to dispatch the ↵Sven Gothel2023-01-162-6/+43
| | | | display.readAndDispatch() wait action (experimental)
* SWT+AWT: Ensure SWTAccessor gets called before AWT initialization on GTK/X11 ↵Sven Gothel2023-01-161-8/+51
| | | | to avoid "cannot register existing type 'GdkDisplayManager'" and subsequent SIGSEGV
* TestNewtCanvasSWTGLn: Only dispose canvas1 at end of test, if not yet ↵Sven Gothel2023-01-161-16/+29
| | | | disposed (manual test case)
* Fix TestBug1398Deadlock02AWT: Missed adaption of unit test to AWTRobotUtil & ↵Sven Gothel2020-06-151-2/+3
| | | | | | GLTestUtil changes when 'front porting' Thanks to Julien Gouesse reminding me of this issue.
* Bug 1398: Adding test case of commit f33681bbeeb459af4de81331d6d9241d8c9a75deSven Gothel2020-04-061-0/+151
|
* Add missing SWTTestUtil, missed in commit ↵Sven Gothel2020-03-061-0/+64
| | | | 36ca7245653b1a0897f2070b9acbe0f0898f5949
* Bug 1398: Ensure CGLContext lock will be acquired before leaving user ↵Sven Gothel2020-03-053-161/+212
| | | | | | | | | | | | | | | | | | | | | | | | makeCurrent() call Command SetNSViewCmd sets NSOpenGLContext's NSView via [NSOpenGLContext setView:] on the main-thread as enforced since XCode 11 using SDK macosx10.15, see Bug 1398. This command is injected into OSX's main-thread @ NSOpenGLImpl.makeCurrent(long) only if required, i.e. issued only for a newly bound NSView and skipped for surface-less or offscreen 'surfaces'. This operation must be performed w/o blocking other tasks locking the NativeSurface on main-thread to complete. Since [NSOpenGLContext setView:] acquires the CGLContext lock on the main-thread, it can't be locked by the calling thread until this task has been completed. Command issuer NSOpenGLImpl.makeCurrent(long) will not acquire the CGLContext lock if this command is pending. contextMadeCurrent(true) cures the potential unlocked CGLContext by issuing a whole GLContext.release() and GLContext.makeCurrent() cycle while waiting for this command to be completed in-between. This GLContext cycle also ensures an unlocked NativeSurface.getLock() in-between, allowing potentially blocked other tasks on the main-thread to complete and hence this queued command to execute. Notable test provoking critical multithreading issues is com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT. Notable test exposing issues with an unlocked CGLContext is com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLShaderState02NEWT.
* OSX/SWT Testing: Drop using 'com.jogamp.newt.util.MainThread' enforcing ↵Sven Gothel2020-03-0415-348/+361
| | | | | | | | | | | | | | | | | | | default test behavior SWT and OSX's UI TK have their strict threading policy we require to comply with, e.g. see Bug 1398 lately. It doesn't help using our own MainThread vehicle to move the unit test on the OS main thread, as this removes potential causes of deadlocks - which we intend to find and resolve. This patch removed using MainThread altogether from our ant unit testing recipe as well from our manual test scripts. Unit tests are no more executed on the 'main thread'. SWT tests are patched to comply with SWT's UI threading policy. We also catch violations within NewtCanvasSWT and our SWT GLCanvas to provide same behavior on all platforms.
* TestSharedContextVBOES2*3: Properly validateBuffers and setSyncObjects(..) ↵Sven Gothel2020-02-243-2/+17
| | | | in concurrent async test case.
* Bug 1422: Emulate DPI Scaling on non-native DPI autoscale platforms (!MacOS)Sven Gothel2020-01-154-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | Bug 1422 shows that it seems to be desired to emulate DPI scaling where the native toolkit does not implmement the same. On GTK, DPIUtil.mapDPIToZoom (int dpi) reads: double zoom = (double) dpi * 100 / 96; int roundedZoom = (int) Math.round (zoom); return roundedZoom; While having dpi calculated as: dpi = 96 * GDK.gdk_monitor_get_scale_factor(monitor); Well, this seems to exist to allow 96 dpi fixed layout to 'look' OK on high-dpi screens. However, you get in trouble if you layout high-dpi aware, i.e. using percentages etc. There is one exception: If DPIUtil.useCairoAutoScale() is true, scalingFactor is 1f and hence the scaling emulation dropped. 'DPIUtil.setUseCairoAutoScale((sx[0]*100) == scaleFactor || OS.isGNOME);'
* TestGLCanvasSWTNewtCanvasSWTPosInTabs: Only use 1 Animator to easy example codeSven Gothel2020-01-151-24/+14
| | | | | Otherwise one would want to pause the Animator instance for the hidden GLWindow, otherwise such animator with zero visible drawables will become a CPU hog.
* Bug 1421: Conclude OSX: Forward SHOW and HIDE events to NewtCanvasSWT ↵Sven Gothel2020-01-151-2/+50
| | | | | | | instances if 'below notification threshold' 'below notification threshold' here is simply being a child SWT Control of like a Composition or SashForm etc where these events won't get propagated.
* NewtCanvasSWT Tests: Add NEWTDemoListener giving weight to toolkit ↵Sven Gothel2020-01-132-0/+21
| | | | independent UI interaction coding
* TestSWTAccessor02NewtGLWindow: Setup SWT EDTUtil for NEWT, avoiding ↵Sven Gothel2020-01-131-38/+30
| | | | | | deadlocks on OSX and Windows Essentially same code path as NewtCanvasSWT
* Bug 1421, Bug 1358, Bug 969, Bug 672: Fix NEWT's coordinate conversion on ↵Sven Gothel2020-01-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | MacOS (fixes NewtCanvasSWT on SWT positioning) Newt's OSX Window consist out of NSView wrapped up within its own NSWindow. It's position is being set via its NSWindow's client-area position on screen (frame), which we derive from NSView's client-area position. When NEWT reparents into a new 'window', on OSX it uses the parent's NSView and its NSWindow to attach its own NSView and NSWindow as a subview and childwindow. SWT's OSX implementation uses NSView's for each Compositor, but an individual NSWindow is only established for the Shell (Window). An oversight in Nativewindow and NEWT's coordinate translation: 'top-left view <-> top-left screen' by missing the 'view <-> window' translation caused this whole issue. The oversight occured as NEWT's 'view <-> window' translation had no impact due to its 1-view to 1-window mapping. Fixing the coordinate translation resolves the mess for SWT and for potential other toolkits on OSX. NewtCanvasSWT behaves same on OSX as on X11 etc finally.
* Bug 1421: Tackle wrong position of TabFolder, SashForm etcSven Gothel2020-01-061-44/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getClientArea() on MacOS produces a 'difficult' result regarding the position, which usually is returned as zero. Using a zero position issues the bug w/ SashForm, where the offset doesn't seems to be covered by the native NSView nor an SWT parent Composition. Then using the getLocation() as is (i.e. the view's frame position) may also cause issues with the TabFolder, as it includes the tab's trimming. Here the native NSView 's position includes the tab's trimming, gladly the parent (TabFolder or a Composition)'s clientArea includes this offset. Therefor, as a testbed - on OSX, getClientArea2(..) returns - position: getLocation() - getParent().getClientArea().position - size: getSize() This at least works OK'sh using - no special layout parent - TabFolder - SashForm ++++ Unit test TestGLCanvasSWTNewtCanvasSWTPosInTabs: Adding 'addComposite' to test matrix. 'addComposite' wraps our GLCanvas or NewtCanvasSWT into a Composite instead of adding it directly into the layouting parent. It demonstrates an issue with the new test 'test32_NewtCanvasSWTTabSashGLWComp', i.e. the NewtCanvasSWT is shown on the left as the SashForm's offset is being dropped. Summary: - No more issues with High-DPI pixelScale observed! - GLCanvas is being most well layouted, no issues in tests - NewtCanvasSWT may show severe positioning issues -> test32_NewtCanvasSWTTabSashGLWComp - NewtCanvasSWT always shows a small positioning offset into the lower-right corner w/ overlapping - NewtCanvasSWT overall positioning is not perfectly understood - NewtCanvasSWT misses to hide the NEWT child when changing tabs in TabFolder
* Bug 1421, Bug 1358, Bug 969, Bug 672: Deleting merged tests (obsolete)Sven Gothel2020-01-062-734/+0
|
* Bug 1421, Bug 1358, Bug 969, Bug 672: Generalization of test case ↵Sven Gothel2020-01-061-110/+389
| | | | | | TestGLCanvasSWTNewtCanvasSWTPosInTabs (2/2) Complete merging unit tests.
* Bug 1421, Bug 1358, Bug 969, Bug 672: Generalization of test case ↵Sven Gothel2020-01-052-69/+118
| | | | | | | | | | | | | TestGLCanvasSWTNewtCanvasSWTPosInTabs (1/2) Testing the TabFolder and a SashForm in the 2nd tab covering both SWT layout use cases on both out SWT support classes SWT GLCanvas and NewtCanvasSWT. Merging TestBug1421NewtCanvasSWTPosInTabs + TestBug672NewtCanvasSWTSashFormComposite into TestGLCanvasSWTNewtCanvasSWTPosInTabs. TestBug672NewtCanvasSWTSashFormComposite exposes that SWT GLCanvas still requires work for proper High-DPI scaling on OSX!
* Bug 1421: NewtCanvasSWT child on layouted SWT parent only occurs on MacOS, ↵Sven Gothel2020-01-051-5/+7
| | | | regardless of High-DPI
* Bug 1421: Demo wrong NEWT Child window position within an SWT TabFolder ↵Sven Gothel2020-01-051-0/+238
| | | | layout using NewtCanvasSWT on MacOSX with High-DPI Retina
* Bug 1393: MacOS: getLocationOnScreen w/ JAWT Parent: Use parent's unblocking ↵Sven Gothel2020-01-021-9/+9
| | | | | | | | | | | | | | | specialization On MacOS, commit 12eed5d38616d23b6e8e2e5b497dfc2f54d90c90 replaced all parent.getLocationOnScreen(..) calls with OSXUtil.GetLocationOnScreen(parentHandle, ..) avoiding the EDT + Appkit Deadlock with native parenting. On MacOS AWT and JAWT are using offscreen CALayer since Java >= 1.7.0, therefor the MacOSXJAWTWindow's native window handle can't be used to gather the screen position via OSXUtil. However, the JAWT Window specialization MacOSXJAWTWindow implements a non-locking code-path and we can decide to use it by querying the general interface OffscreenLayerOption.
* Bug 1312: GLContextShareSet: Utilize WeakIdentityHashMap for shareMap and ↵Sven Gothel2019-12-313-5/+282
| | | | | | | | | | | | its destroyedShares Picking up Tom Nuydens suggestion to utilize a WeakIdentityHashMap instead of a IdentityHashMap, allowing destroyed GLContext to be removed from the GLContextShareSet through the GC. TestSharedContextVBOES2NEWT5 demonstrates the use-case, having one master context and several slaves being spawn off, killed and new sets to be spawn off. Here the GLContextShareSet shall not hard-reference the destroyed and user-unreferenced context, but allowing the system to GC 'em.
* Gears* tests: Obey verbose flagsSven Gothel2019-12-312-16/+41
|
* Bug 1156 Regression (Bug 1417): Probe whether 'eglGetPlatformDisplay(..)' is ↵Sven Gothel2019-12-251-0/+1
| | | | | | | | | | | | | | | | | | available before using commit f4281b5ee80d7674134bfee357695a98382884a3 for Bug 1156 (DRM/GBM) introduced the call to 'eglGetPlatformDisplay(..)' for known EGL-platforms. However, 'eglGetPlatformDisplay(..)' is only available for EGL versions >= 1.5 or 'eglGetPlatformDisplayEXT(..)' if EGL extension 'EGL_EXT_platform_base' is available. This patch adds a singular EGL version probe and a secondary extension fallback test at first call using EGL_NO_DISPLAY on both EGL_VERSION and EGL_EXTENSION eglQueryString(..) calls. If 'eglGetPlatformDisplay*(..)' is not available, simply use 'eglGetDisplay(..)'. This regression also impacted Bug 1417 (Android bringup using current SDK + NDK), i.e. disabled most Android devices as their EGL version is often 1.4.
* Bug 852: TestCPUSourcingAPINEWT Reference the bug entry and add a little ↵Sven Gothel2019-12-091-0/+5
| | | | reminder
* Bug 1416 - Allow EGLDrawableFactory re-creation after shutdown() - be functionalSven Gothel2019-12-093-5/+35
| | | | | | | | | | TestShutdownCompleteNEWT revealed that EGLDrawableFactory won't be properly re-created within subsequent GLProfile/GLDrawableFactory initSingleton() after a GLProfile.shutdown() call. Hence after the shutdown() call, subsequent GLProfile have no EGLDrawableFactory available and hence may not have a default device existent in case no desktop-factory is available. Allow EGLDrawableFactory to be re-created after a shutdown().
* Bug 1156: NEWT Window: Better handling of fixed console case: Not resizable ↵Sven Gothel2019-12-091-2/+8
| | | | | | | | | | | | | | | | | | | | | | | and not repositionable. Our two fixed size and position console cases 'bcm.egl' and 'egl.gbm' (drm.gbm) only operate in a console like fullscreen mode. We should earmark and expose this behavior, as well as handle it by not waiting for a position / size and not attempting to change position and size. Reducing WindowImpl.minimumReconfigStateMask to bare minimum values: STATE_MASK_VISIBLE | STATE_MASK_FOCUSED; New WindowImpl.mutableSizePosReconfigStateMask extends WindowImpl.minimumReconfigStateMask, representing previous values: STATE_MASK_VISIBLE | STATE_MASK_FOCUSED | STATE_MASK_FULLSCREEN | STATE_MASK_RESIZABLE | STATE_MASK_REPOSITIONABLE; All WindowDriver implementations previously using WindowImpl.minimumReconfigStateMask are now using WindowImpl.mutableSizePosReconfigStateMask but the explicit console driver named above. I would have liked to add the STATE_BIT_FULLSCREEN to the current stateMask to notify this semantics, however this would have lead to more code changes as our fullscreen mode assumes to be 'on top' of the normal mode. Here the normal mode is essentially fullscreen and no back/forth fullscreen setting is useful or allowed. Therefore, both fixed size & position console driver won't expose themselves as being in fullscreen mode.
* Bug 1415: MacOS: Disable multiple Window creation on ExclusiveContextThread ↵Sven Gothel2019-12-082-0/+15
| | | | in test case
* Bug 1415: ExclusiveContextBase00+10: Utilize one Animator per Window for ↵Sven Gothel2019-12-082-185/+248
| | | | | | | clean ExclusiveContextThread No, this does not resolve the issue - but is the proper test case. ExclusiveContextBase10 also gets the preVis test.