summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes
Commit message (Collapse)AuthorAgeFilesLines
* Bug 1422: Use own deviceZoomScaleUp(..) disregarding higher-toolkit's ↵Sven Gothel2020-01-161-10/+144
| | | | | | | | | | | | | | | | | | | 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).
* Bug 1422: Emulate DPI Scaling on non-native DPI autoscale platforms (!MacOS)Sven Gothel2020-01-151-5/+43
| | | | | | | | | | | | | | | | | | | | | | | | 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);'
* Nativewindow Rectangle*: Cleanup up union(..), intersection(..): Return a ↵Sven Gothel2020-01-152-26/+21
| | | | | | new Rectangle instance (mutable) Also return 'this' for setter methods for chaining.
* Bug 1421, Bug 1358, Bug 969, Bug 672: Fix NEWT's coordinate conversion on ↵Sven Gothel2020-01-132-31/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* NativeWindow Point.set*(..): Return instance for scaling (chaining)Sven Gothel2020-01-121-3/+19
|
* Bug 1421: OSXUtil: Add GetLocation(..), simply returning the view's frame ↵Sven Gothel2020-01-061-0/+8
| | | | position
* Bug 1358: GLCanvas: Call new OSXUtil.SetWindowPixelScale(..) when GLCanvas ↵Sven Gothel2020-01-051-0/+6
| | | | | | gets realized on MacOS This fixes GLCanvas's High-DPI scaled size issue on MacOS of Bug 1358.
* Bug 1421, Bug 1358, Bug 969, Bug 672: SWTAccessor: Add ↵Sven Gothel2020-01-051-1/+74
| | | | get[Location|Size]InPixels(..) and getLocationOnScreen()
* Bug 1358: Add OSXUtil.GetWindowPixelScale(..)Sven Gothel2020-01-041-0/+8
| | | | | It is now possible to retrieve the pixel scale [NSWindow backingScaleFactor] after native creation by NEWT - as we have changed the lifecycly (all-in-one native method on AppKit)
* Merge remote-tracking branch 'xranby/master'Sven Gothel2019-12-041-4/+14
|\
| * VC4: Only load Broadcom EGL driver when guessVCIVUsedXerxes Rånby2019-12-041-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Broadcom VC IV can be used from both console and from inside X11 When used from inside X11 rendering is done on an DispmanX overlay surface while keeping an X11 nativewindow under as input. When Broadcom VC IV is guessed only the Broadcom DispmanX EGL driver is loaded. Therefore standard TYPE_X11 EGL can not be used.
* | Bug 1406: DRMUtil: Probe DRM device whether it has resources attached (and ↵Sven Gothel2019-12-041-2/+41
|/ | | | | | | | | | | | | | | | | | | | is the desired one) First issue was that the proper DRM file had to be queries, as Raspberry 4 may have two of them: <-- /dev/dri/dri0 /dev/dri/dri0 /dev/dri/by-path/platform-fec00000.v3d-card -> ../card0 /dev/dri/by-path/platform-soc:gpu-card -> ../card1 --> This patch attempts to probe all /dev/dri/card[0..99] using this arbitrary range. The test loop ends if: - drmOpenFile succeeds and drmModeGetResources delivers non-null value - the iterated probed file doesn't even exist - 100 files has been tested ;-)
* Bug 1156 - Implement DRM/GBM Support for JOGL(EGL) and NEWTSven Gothel2019-11-286-7/+593
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding new classes DRMLib (gluegen of drm + gbm), DRMUtil and DRMMode GBMDummyUpstreamSurfaceHook to new package jogamp.nativewindow.drm, allowing full awareness of DRM + GBM within NativeWindow for JOGL + NEWT. DRMMode replaces the previous native code of collecting drmMode* attributes: active connector, used mode, encoder etc and also supports multiple active connectors. DRMUtil handles the global static drmFd (file descriptor), currently only the GNU/Linux DRM device is supported. GBMDummyUpstreamSurfaceHook provides a simple dummy GBM surface. NativeWindow provides the new nativewindow_drm.so and nativewindow-os-drm.jar, which are included in most 'all' jar packages. build property: setup.addNativeEGLGBM -> setup.addNativeDRMGBM Changes NativeWindowFactory: - TYPE_EGL_GBM -> TYPE_DRM_GBM while keeping the package ID of '.egl.gbm' for NEWT (using EGL) - Initializing DRMUtil at initialization Changes EGLDrawableFactory: - Using native GBM device for the default EGL display creation instead of EGL_DEFAULT_DISPLAY. This resolves issues as seen in Bug 1402, as well in cases w/o surfaceless support. - GL profile mapping uses surfaceless when available for GBM, otherwise uses createDummySurfaceImpl (dummy GBM surface via GBMDummyUpstreamSurfaceHook) - createDummySurfaceImpl uses a dummy GBM surface via GBMDummyUpstreamSurfaceHook - DesktopGL not available with GBM, see Bug 1401 NEWT's DRM + GBM + EGL Driver - Using DRMLib, DRMUtil and DRMMode, removed most native code but WindowDriver swapBuffer - ScreenDriver uses DRMMode, however currently only first connected CRT. - WindowDriver aligns position and size to screen, positions other than 0/0 causes DRM failure - WindowDriver reconfigure n/a NEWT TODO: - DRM Cursor support (mouse pointer) - Pointer event handling
* Bug 1156: GBM: Bring up incl GL rendering (TODO: GBM working page flip / sync)Sven Gothel2019-11-231-0/+4
| | | | | | | | | | | | | | | | | - EGLSurface: Factor out 'eglCreate[Platform]WindowSurface' NEWT egl.gbm.WindowDriver -- Properly use GBM fourcc format and use as visualID for GBM surface creation and EGL config selection -- Create eglSurface within this class -- Hook up GBM/DRM page flip (not working yet, no visible artifacts - no swap) - ProxySurfaceImpl.surfaceSwap() call upstreamSurface's implementation if available TODO: 'Permission denied' calling: - drmSetMaster (optional) - drmModeSetCrtc - drmModePageFlip
* Bug 1156: EGL-GBM: Fix NativeWindowFactory native-window-type query ↵Sven Gothel2019-11-222-58/+72
| | | | | | | | | | | | | | | | | | according to Bug 1156 - Special files like '/dev/dri/card0' can't be tested via isFile(), use exists() Order for GNU/Linux (and other unices) IMHO is 1) Display Server (Vendor neutral) 1.1) running X11 display server (DISPLAY check enough?) 1.2) running WAYLAND display server (WAYLAND_DISPLAY check enough?) 2) Console Mode Vendor Neutral 2.1) GBM (how to check?) 3) Console Mode Vendor Specific 3.1) VCIV (how to check)
* Bug 1156: EGL-GBM: Fix Cleanup (Newt package relocation / hack default GBM)Sven Gothel2019-11-211-8/+8
| | | | Now: TYPE_EGL_GBM == ".egl.gbm"
* gbm/WindowDriver: make it compile and linkXerxes Rånby2019-11-211-1/+1
|
* detect gbm platform on linux when no other display server is runningErik De Rijcke2019-11-211-5/+43
|
* MacOS: Add more debug log detailsSven Gothel2019-11-211-0/+7
|
* Bug 1393: OSXUtil: Optionally inject Apple's 'Main Thread Checker'java11iosSven Gothel2019-09-091-2/+21
| | | | | | | | To allow proper testing of whether all AppKit calls are performed on its Main-Thread where required, we inject the libMainThreadChecker.dylib when property 'nativewindow.debug.OSXUtil.MainThreadChecker' is set. See <https://developer.apple.com/documentation/code_diagnostics/main_thread_checker?language=objc> Lib-Name: /Applications/Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib
* OSXUtil::IsMainThread() Utilize ThreadLocal storage flag avoiding ↵Sven Gothel2019-09-081-24/+19
| | | | unnecessary JNI calls
* Buig 1389: Fix SIGSEGV on OpenJDK11 on [NSApplicationAWT sendEvent:]Sven Gothel2019-09-083-5/+12
| | | | | | | | | | | | | | | | | | | | | | Culprit of the crash and the non propagated action on NSApp main-thread was _simply_ our OSXUtil_KickNSApp() 'kick alive' NSApplicationDefined NSEvent sent to the NSApp. Java11's NSApp code overrides sendEvent and handles NSApplicationDefined + subtype=ExecuteBlockEvent using the given data1 as a function pointer. 8-O ExecuteBlockEvent defined as 0, which we have sent. Simply passing subtype=8888 avoids this side-effect. Whether it is still required to KickNSApp() is another question. +++ Further, make code a bit more robuts regarding the offscreenSurfaceLayer at JAWTWindow invalidate. I.e. if still not detached, do the late cleanup there. This just in case the OSX Context callback to disassociate the drawable has been missed.
* Bug 1392: Simplify CapabilitiesFilter: Criteria -> Test, remove ↵Sven Gothel2019-09-071-20/+17
| | | | RemovalCriteria as all Test definitions may be used for anything.
* Bug 1392: Add CapabilitiesFilter and GLCapabilitiesFilter supporting diverse ↵Sven Gothel2019-09-071-0/+164
| | | | | | | | reusable [GL]CapabilitiesImmutable list filter To implement fix for Bug 1392, we have to remove certain GLCapabilitiesImmutable from the availability list. These filter provide a a clean reusable utility for the fix.
* Bug 1363: Java 11: Utilize UnsafeUtil.doWithoutIllegalAccessLogger(..) ↵Sven Gothel2019-09-043-53/+84
| | | | | | | | | | avoiding further unnecessary warnings Access to said internal non-exported methods is essential. See commit c5431f46b7bf64f109315ec78461859dd88f202a. Further added verbose DEBUG output where applicable.
* Bug 1363: Java 11: JAWTUtil: Use sun.awt.SunToolkit.awtLock/Unlock and ↵Sven Gothel2019-09-041-65/+120
| | | | | | | | | | | | | | | disableBackgroundErase (impl. semantics) Commit 13c6bbbde5ea476d60e0a2f04a5172d3302d0edd simply removed the AWT commonly used SunToolkit lock/unlock methods, which was incorrect. It lead to certain resources access collisions as access has to be synchronized using the same reentry lock across AWT and NativeWindow/JOGL. We utilize the new com.jogamp.common.util.UnsafeUtil of GlueGen commit 07c1885e9a3d1f3a3853414648c06fb3864bc69f to disable the IllegalAccessLogger while fetching the methods/fields and making them accessible. JAWUtil also hosts access to SunToolkit's disableBackgroundAccess(Component) aligning the code for GLCanvas, NewtCanvasAWT and AWTCanvas.
* Bug 1363: Java 11: Resolve unsupported JAWTUtil.getMonitorDisplayID(..)Sven Gothel2019-08-191-5/+11
| | | | | | | | | | | | | | | | | Previous commits removed access to OSX's GraphicsDevice.getCGDisplayID() on Java9+, avoiding illegal reflective access. Here we JAWTUtil.getMonitorDisplayID(..) simply returns null if Java9 or !OSX, so the sole NewtFactory caller falls back to the alternative working solution. Orig patch Wade Walker: This was used on Mac OS only to create a MonitorDevice in NewtFactoryAWT. But there was a fallback method for creating MonitorDevice, and testing with TestGearsES2GLJPanelAWT shows that the fallback method seems to give identical results on Mac, so changed to just use the fallback method (which is now the only method) everywhere. This gets rid of an illegal reflective access.
* Bug 1363: Java 11: Use getPixelScale standard method even on Mac under Java9+Sven Gothel2019-08-191-50/+50
| | | | | | | | | | Changed getPixelScale to use standard method, even on Mac Previously it used a Mac-specific method, but the new standard method of device.getDefaultConfiguration().getDefaultTransform() seems to work on Mac, so use it instead to avoid illegal reflective access warnings. Orig patch by Wade Walker.
* Bug 1363: Java 11: Don't use GraphicsDevice.getScaleFactor() on Java9+ ↵Sven Gothel2019-08-191-3/+16
| | | | | | | | | | | | [illegal reflective access] Use non-reflective method to get the pixel scale on Java9+ It's now possible to use GraphicsConfiguration.getDefaultTransform() instead of using reflection to get the pixel scale, which eliminates an illegal reflective access warning. Orig patch by Wade Walker
* Bug 1363: Java 11: Don't use sun.awt.SunToolkit.awtLock/Unlock on Java9+ ↵Sven Gothel2019-08-191-10/+15
| | | | | | | | | | | | | | | | [illegal reflective access] Avoid illegal reflective access to sun.awt.SunToolkit.awtLock/Unlock on Java9+ Apparently these give a performance benefit on X11 by avoiding taking the AWT global lock, and instead only taking a Java lock defined in sun.awt.SunToolkit. But this has thrown a warning since Java 9, and will soon be illegal. If a performance problem remains on X11, we'll need to find another solution. Orig patch by Wade Walker. This patch only skips utilizing said API on Java9+ while maintaining orig code path for Java8.
* NEWT iOS: Support translucent windowsSven Gothel2019-07-082-4/+4
| | | | | | | and remove the redColor default background (debug only). IOSUtil.CreateUIWindow(..) also gets its 'visible' attribute, to be true only for demo Hello1 code - false for intended Proxy Surface Hook.
* NEWT iOS: Support Multi-Touch Events, PixelScale, ..Sven Gothel2019-07-081-1/+1
| | | | | | | | | | | | | | | | | Note: Two subsequent commit will add some required change in the native UIWindow/UIView creation methods to actually make the NEWT view being displayed ;-) The demo 'com.jogamp.opengl.demos.ios.Hello' demonstrated a standard NEWT application running on iOS. Previous NativeWindow wrap-around demo is preserved in 'com.jogamp.opengl.demos.ios.Hello1'. Tested on ipad 11'inch arm64 and x86_64 simulation: - Using GearsES2 demo - PixelScale 1f, 2f and 0f - last two using max pixel scale - Touch w/ GearsES2 works: -- 1 finger rotate -- 2 finger drag -- 2 finger pinch-zoom gesture detection
* iOS / MacOS: PixelScale UpdateSven Gothel2019-07-083-18/+18
| | | | | | | | | | - IOSUtil/OSXUtil: Return float value and refine name to GetScreenPixelScale* - WindowDriver's updateMaxScreenPixelScaleByDisplayID(..) and updateMaxScreenPixelScaleByWindowHandle(..) will only update the maxPixelScale, as actual user pixelSize change should not be triggered here. A user pixelSize adaption to the changed underlying scale capabilities (e.g. switch monitor) should be supported by the implemented WindowDriver's: updatePixelScale(..) called by native code.
* iOS: Initial working commit supporting iOS (ipad pro 11)Sven Gothel2019-06-235-0/+481
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | using our OpenJFK 9 x86_64 and arm64 build. Test demo class is 'com.jogamp.opengl.demos.ios.Hello', residing in the new demo folder 'src/demos/com/jogamp/opengl/demos/ios/Hello.java'. This commit does not yet include a working NEWT specialization for iOS, but it shall followup soon. Instead this commit demonstrates JOGL operating on native UIWindow, UIView and CAEAGLLayer as provided by Nativewindow's IOSUtil. Test Video https://www.youtube.com/watch?v=Z4lUQNFTGMI +++ Notable bug: The FBO used and sharing the COLORBUFFER RENDERBUFFER memory resources with CAEAGLLayer to be displayed in the UIView seemingly cannot handle GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24 or GL_DEPTH_COMPONENT32 depth buffer - none at all (Device + Simulation). Therefor the default demo GLEventListener chosen here don't require a depth buffer ;-) This issue can hopefully be mitigated with other means than using a flat FBO sink similar to FBO multisampling.
* Bug 1358: 'Honor' SWT's projection of High-DPI Scaling (Reading hidden pixel ↵Sven Gothel2019-04-101-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | dimensions) Christian reported this bug and described multiple pathways. This change usese the following: - access to getClientAreaInPixels w/ fallback of - DPIUtil.autoScaleUp(getClientArea()) I hardly have tested this on Linux/GTK, even though I use a High DPI monitor, maybe just because of it and Eclipse _poor_ state of proper UI presentation. Christian: Please test this .. if buggy, reopen quick for release 2.4.0 SWT/GTK High-DPI is a PIA: - GDK_SCALE renders offscreen and scales the image (wow & ugly) - GDK_DPI_SCALE works at least on the fonts properly - swt.autoScale is pretty much like: What will be scaled? It scales some icons in Eclipse, not fonts and result in Eclipse looks horrible. Maybe I just made this patch to vent about this poor state of things. Notable: KDE looks great and uses DPI, firefox some GDK_DPI_SCALE equivalent (OK) One also wonders why there is only a single scale dimension, where DPI differs x/y! But enough of my rant :)
* Bug 1362: SWTAccessor: c -> cGTK for readabilitySven Gothel2019-04-051-19/+20
|
* Bug 1362: Enhancing SWT/GTK Support for GTK 2.90, SWT > 4.8 (?)Wade Walker2019-04-051-9/+40
|
* Bug 1370: Call from Main-Thread: NW's OSXUtil.CreateNSWindow0(..) and NEWT's ↵Sven Gothel2019-04-051-3/+8
| | | | | | | | | | | | | | | | | | | | | | WindowDriver.createWindow0(..) OSX 10.14.3 Mojave issues a WARNING: NSWindow drag regions should only be invalidated on the Main Thread! This will throw an exception in the future. The complaint about NativeWindow (NW)'s OSXUtil.CreateNSWindow0(..) might be valid, which does create a NS Window instance w/ NSView and framebuffer initialized. However, the complaint about NEWT's WindowDriver.createWindow0(..) is not, since the initialization incl framebuffer happened later on the main thread. Regardless, encapsulated both construction fully to run on the Main-Thread. +++ Originally the Main-Thread design spec was like: Must run on Main-Thread when or after making visible. Oh well.
* Bug 1367: Adapt to TempFileCache & TempJarCache ChangesSven Gothel2019-04-031-1/+1
|
* Merge pull request #90 from packet0/patch-1Sven Gothel2019-03-261-1/+2
|\ | | | | SWTAccessor: Cleanup disable debug messages
| * SWTAccessor: Cleanup disable debug messagespacket02015-08-111-1/+2
| |
* | Adding NativeWindowHolder extends NativeSurfaceHolder; API Doc for ↵Sven Gothel2019-03-201-0/+41
| | | | | | | | | | | | | | | | | | NEWTDemoListener NativeWindowHolder abstracts access to is-a or has-a parent component's NativeWindow like NewtCanvasAWT, NewtCanvasJFX and NewtCanvasSWT Adding API Doc for NEWTDemoListener.
* | JavaFX: Remove JFXAccessor redundancySven Gothel2019-03-191-15/+13
| |
* | JavaFX: Fix API doc of JFXAccessorSven Gothel2019-03-191-6/+6
| |
* | JavaFX: Adding JavaFX Support for NEWT utilizing native Window parenting via ↵Sven Gothel2019-03-193-1/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NewtCanvasJFX NewtCanvasJFX, a JavaFX Canvas Node, allows attaching a native NEWT Window to the JavaFX Node's native Window (if attached). The mechanism is similar to NewtCanvasAWT. Current implementation supports placing the NEWT Window into the JavaFX scene of the native window correctly, as well as the following different lifecycles - attach NewtCanvasJFX to already visible group->scene->window - attach NewtCanvasJFX to not yet visible or attached group->scene->window - attach NEWT Window before or after NewtCanvasJFX's visibility The above is covered by unit test: TestNewtCanvasJFXGLn This is the initial commit for JavaFX support and has been tested on - OpenJDK 8 + OpenJFX 8 - GNU/Linux X11
* | Bug 1290: Expand query whether BCM IV is being used, exclude '/dev/dri/card0'rcpulledSven Gothel2018-01-162-18/+78
| | | | | | | | Also refactor query to jogamp.nativewindow.BcmVCArtifacts
* | Merge pull request #96 from gohai/vc4-moduleSven Gothel2018-01-151-1/+3
|\ \ | | | | | | Change BCM VC IV detection to handle presence of vc4 DRI module
| * | Change BCM VC IV detection to handle presence of vc4 DRI modulegohai2016-02-101-1/+3
| | | | | | | | | | | | The recent Raspbian release comes with a vc4 kernel module that can be activated with a device tree overlay. In this case, we want to use the DRI & Mesa / Gallium3D driver instead of the BCM VC IV one, whose userspace library remains in /opt/vc.
* | | jogl: complete audit of code for unneeded calls to .intern()Harvey Harrison2015-12-071-8/+8
|/ / | | | | | | | | | | | | Completes task from Bug1059. These calls are not needed as the VM implicitly interns String constants when a class is loaded. Signed-off-by: Harvey Harrison <[email protected]>
* | X11Util.openDisplay: DEBUG: Show reusable and pending display countSven Gothel2015-11-151-4/+6
| |