| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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
|
|
|
|
|
|
| |
native header and code files)
Part-1 in commit e96aeb6e9acd2b1435f5fad244a1488e74a3a6d6
|
|
|
|
| |
Add 64-bit nativeHandle (Windows HMONITOR), add PixelScale for Windows
|
|
|
|
| |
(Windows 10)
|
| |
|
| |
|
|
|
|
| |
deadlock)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"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).
|
|
|
|
| |
sporadic crashes)
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
nativewindow and the android specific jogl parts (make d8 'dex'ing' happy)
|
|
|
|
| |
used (52 for Java8)
|
| |
|
|
|
|
|
| |
jvm11: --illegal-access=warn
jvm17: --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.java2d=ALL-UNNAMED
|
| |
|
|
|
|
| |
java.desktop/sun.java2d', preparation for potential future Java17+ Jar Module
|
|
|
|
| |
java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.java2d=ALL-UNNAMED
|
| |
|
|
|
|
| |
else they crash.
|
|
|
|
| |
scripts/tests-osx-aarch64.sh
|
| |
|
| |
|
|
|
|
| |
Java-1.8 API.
|
| |
|
|
|
|
|
|
| |
main thread, deferred w/o wait (MacOS >= 13)
updateContextRegister() stays in current thread.
|
| |
|
|
|
|
|
| |
See commits 9e8a24933e9f396406f895ec137d18aefb1c2fe8
and 348d2ab9a20a3b339e2cb1ff4250c3de76c79c2a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
blocking
Set NSOpenGLContext's NSView via [NSOpenGLContext setView:]
on the main-thread as enforced since XCode 11 using SDL macosx10.15, using Runnable SetNSViewCmd.
This operation must be performed async w/o blocking to allow
other tasks locking the NativeSurface on main-thread to complete.
Further, since [NSOpenGLContext setView:] acquired the CGLContext lock,
it can't be locked until this task has been completed.
Worst case scenario for a late [NSOpenGLContext setView:] issuance
might be corrupt initial frame(s) displayed.
Since all concurrent locking is performed within JOGL,
the unlocked CGLContext window risk is only academic.
However, if native 3rd party toolkits take share control,
we might have a situation.
+++
SetNSViewCmd is issued @ makeCurrent() now as opposed to createContext(..)
and associateDrawable(true). The latter was actually late as well,
as it also happened after makeCurrent when updating the drawable
association. It also missed setting a null NSView when detached!
release() will also set a null NSView if called after associateDrawable(false).
SetNSViewCmd will only be issued if the NSView has been changed,
i.e. first makeCurrent() or changing the drawable.
If issued, makeCurrent() will not lock the underlying CGLContext
and hence allow SetNSViewCmd to perform - see above.
+++
NSViewDescriptor class structure replaces the less convenient method 'getNSViewHandle(..)',
exposing all collected drawable characteristics as fields.
NSViewDescriptor also respects a ProxySurface's OPT_UPSTREAM_SURFACELESS mode,
which results in not using any underlying NSView - similar to OPT_UPSTREAM_WINDOW_INVISIBLE.
This change ensures that all surfaceless GL operations will not use any NSView.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Thanks to Phil Jordan, who is debating certain build issues of JOGL with me,
we figured that certain generated header files ended up in the wrong build folder.
E.g. on GNU/Linux, jogamp_nativewindow_windows_GDI.h ended up in build-x86_64/nativewindow/gensrc/native/drm/
This happens due to the new java11 way of generating header files using javac.
Per default, all referenced files are being compiled and header files were generated
in this case for all of them using the given '-h location' argument.
Since nativewindow generates headers for the new drm functionality first (where available),
all headers of all included referenced classes ended up in this drm build location.
Subsequent javac was skipped 'thanks' to the already existing class files ;-)
This patch disables implicit class file creation when explicitly generating headers only
using the javac argument '-implicit:none'.
This is done for the whole JOGL project (nativewindow, jogl and newt).
Other JogAmp modules should not be concerned due to the lack of overspecific
platform parts ..
|
|
|
|
|
|
|
|
|
|
| |
libraries for testing
Used for testing Bug 1422 on Windows via qemu-kvm
using Mesa 19.3.2 <https://github.com/pal1000/mesa-dist-win/releases>.
Here I dropped the native libs to C:\temp and moved the C:\Windows\System32\OpenGL32.dll
out of sight by renaming it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
native DPI toolkit aware platforms (Linux, Windows)
NEWT + NewtCanvasAWT:
Maybe create "interface ScalableSurface.Upstream {
void pixelScaleChangeNotify(final float[] curPixelScale, final float[] minPixelScale, final float[] maxPixelScale); }"
to allow downstream to notify upstream ScalableSurface implementations like NEWT's Window to act accordingly.
+++
AWT GLCanvas: Add remark where to add the potential pixel scale.
|
|
|
|
| |
input if not visible.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compensation like 'DPIUtil.useCairoAutoScale()'
We can't use DPIUtil's 'autoScaleUp(..)' method on non-native DPI scaling platforms
as it uses a scale-factor of 1f if the higher toolkit compensates, i.e. 'DPIUtil.useCairoAutoScale()'.
Since NEWT uses X11 and GDI directly, which are not DPI scale-aware,
we have to drop the semnatics of 'DPIUtil.useCairoAutoScale()'
and merely use the actual 'deviceZoom'.
This was proposed by Marcel Au in the first place.
At least I understand these semantics by now.
+++
Additionally NewtCanvasSWT.SWTNativeWindow needs to return the 'deviceZoomScaleUp(..)'
values for returning its size in window- and pixel-units (surface).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commenting on child-window orderOut
Actual small change is to have child-NSWindow to use '[myWindow orderWindow: NSWindowAbove relativeTo:..'
instead of 'orderFront' in creation and use the simple 'orderFront' to set a top-level NSWindow visible.
Adding comment why we can't use 'orderOut' on child-NSWindow setting it invisible,
this is due to OSX 10.7 changes and testing detaching the child-window from its parent
causes havoc w/ SWT at least.
Hence we only issue 'mWin orderWindow: NSWindowOut relativeTo:..]' and the result is
having the child-NSWindow below the application.
This in turn will make it visible again when moving the application around,
as this child-NSWindow will no more follow the position.
Suggestion is to have this 'fake invisible' child-NSWindow to be moved
out of the overal viewport (all screens).
|
|
|
|
| |
independent UI interaction coding
|
|
|
|
|
|
| |
deadlocks on OSX and Windows
Essentially same code path as NewtCanvasSWT
|
|
|
|
|
|
| |
(its a property!)
Missed the SWT headless unit tests altogether ;-)
|
|
|
|
| |
pattern
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Due to issues on MacOS, added the src.zip for MacOS as well.
|
| |
|
|
|
|
|
|
| |
TestGLCanvasSWTNewtCanvasSWTPosInTabs (2/2)
Complete merging unit tests.
|
|
|
|
| |
regardless of High-DPI
|
|
|
|
| |
layout using NewtCanvasSWT on MacOSX with High-DPI Retina
|
|
|
|
| |
cross-compilation 32bit on 64bit
|
| |
|