summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/jogamp
Commit message (Collapse)AuthorAgeFilesLines
* Bug 1421: Minor commentingSven Gothel2020-01-061-2/+1
|
* Bug 1358: MacOS NEWT WindowDriver / NewtCanvasSWT High-DPI:Sven Gothel2020-01-041-7/+14
| | | | | | | | | | | | | | | | | Even w/ commit fb211581fefc994d1458a2a74801dfb937170f39, propagating the SWT pixelScale to NEWT-Child, hasPixelScale was never updated via updatePixelScale() through native callback [NSView viewDidChangeBackingProperties]! [NSView viewDidChangeBackingProperties] not being called on [created] child windows (NewtCanvasSWT) confused the overal pixelScale state, i.e. no hasPixelScale update via updatePixelScale(..). This change explicitly queries OSXUtil.GetWindowPixelScale(handle) (commit e6d53e29f05a6928192f6c4a988b2aa558be8d65)for: 1) updateMaxScreenPixelScaleByWindowHandle(..), which now updates the actual hasPixelScale after native creation and for 2) setSurfaceScale(..), which directly calls updatePixelScale(..) with the queried actual pixelScale instead of relying on the native callback [NSView viewDidChangeBackingProperties].
* Bug 1393: MacOS: getLocationOnScreen w/ JAWT Parent: Use parent's unblocking ↵Sven Gothel2020-01-021-1/+13
| | | | | | | | | | | | | | | 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 1156: Seperate DRM/GBM NEWT native library from main head NEWT native ↵Sven Gothel2019-12-2511-12/+32
| | | | | | | | | | | | | | | | library DRM/GBM is enabled for Linux in general. Nativewindow's 'nativewindow_drm' DRM/GBM native library is already seperated. NEWT get its 'newt_drm' DRM/GBM native library. NEWT's main head native library is renamed from 'newt' -> 'newt_head' and is earmarked for further seperation similar to Nativewindow's. At least a 'newt_wayland' will probably followup when support is added. Goal is to remove DRM/GBM dependency for Linux X11 operation as well as removing X11 dependency for Linux DRM/GBM operation.
* Bug 1156: NEWT WindowDriver: Handle case with requested ↵Sven Gothel2019-12-091-2/+2
| | | | CapabilitiesImmutable not being GLCapabilitiesImmutable
* Bug 1156: NEWT Window: Better handling of fixed console case: Not resizable ↵Sven Gothel2019-12-0911-26/+68
| | | | | | | | | | | | | | | | | | | | | | | 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 1393: Apply 12eed5d38616d23b6e8e2e5b497dfc2f54d90c90 to IOS, avoiding ↵Sven Gothel2019-12-081-4/+6
| | | | AppKit/EDT deadlock for parent screen location lookup
* Bug 1393: Resolve EDT + AppKit Deadlock with native parenting: Fetch parent ↵Sven Gothel2019-12-081-4/+6
| | | | screen position directly w/o locking.
* NEWT WindowImpl: Wording in commentSven Gothel2019-12-081-1/+1
|
* Bug 1156: DRM/GBM NEWT: Clarify drmModeSetCrtc(..)'s x/y parameter and ↵Sven Gothel2019-12-071-110/+53
| | | | | | earmark spanning across monitors drmModeSetCrtc(..)'s x/y parameter are the surface's offset to be scanned out from one CRT!
* Bug 1410: Fix NEWT PointerIcon Lifecycle (destroy and clean references @ ↵Sven Gothel2019-12-062-10/+35
| | | | | | | | | | | closing) Commit d5ba4cae824087879a4857e20961a95da04eaebb clarified and simplified the lifecycle of a PointerImpl instance, i.e. drop its resurrection in PointerImpl.validateHandle() in favor of a hard exception. This caused detection of subsequent PointerImpl lifecycle issues, as instances were not fully destroyed on Display closing and references not null'ed in Display and Screen instances.
* Fix regression of commit 2b899a55e365aa03aeb234187600526777c1a9acSven Gothel2019-12-061-1/+1
| | | | This bug never allowed a PointerIconImpl to be destroyed via PointerIconImpl.destroy()
* Bug 1409: GNU/Linux DRM Console: Clear stdin before exit and don't act on ↵Sven Gothel2019-12-051-0/+7
| | | | | | | | | stdin in vsync-wait-loop User input during test from the console will also end up in stdin of the console after the java application has been closed. This is not only annoying, but also a security concern, as the input gets executed if containing a CR. Further, the vsync-wait-loop shall ignore stdin.
* PointerIcon new instances are always valid ..Sven Gothel2019-12-052-7/+15
| | | | Move native handle check to pre-destruction call in PointerIconImpl.destroyOnEDT(..), unifying single destruction and all.
* LinuxKeyEventTracker: Factor out 'sendKeyEvent(..)' call with null check.Sven Gothel2019-12-051-12/+12
|
* Bug 1156: NEWT DRM/GBM PointerIcon: Use hotX/hotY drmModeSetCursor2(..), ↵Sven Gothel2019-12-053-27/+30
| | | | hence pass PointerIconImpl through
* Bug 1408: NEWT DRM/GBM WindowDriver: Adding glFinish() before ↵Sven Gothel2019-12-041-0/+1
| | | | | | | eglSwapBuffers(..) just in case .. This is the poor man's SYNC: glFenceSync () with glWaitSync(). However, this change did not resolve Bug 1408. Earmarked to be removed!
* Bug 1408: NEWT DisplayImpl PointerIcon: Property 'newt.disable.PointerIcon' ↵Sven Gothel2019-12-041-1/+7
| | | | disables PointerIcon usage in general.
* Bug 1408: NEWT DRM/GBM DisplayDriver: Add device locking/unlocking ↵Sven Gothel2019-12-042-9/+44
| | | | decoration for PointerIcon operations
* NEWT: Align DisplayImpl.createPointerIcon(..) behavior; ↵Sven Gothel2019-12-042-32/+16
| | | | | | | | | | | | | | | | PointerIconImpl.validatedHandle() shall not create native resource. Semantic cleanup for clarity and equal behavior Align DisplayImpl.createPointerIcon(..) behavior - return null handle of createPointerIconImplChecked(..) shall be accepted, no exception for neither of the two creation methods. PointerIconImpl.validatedHandle() shall not create native resource. - throws exception if handle is null (about to be used) - no native creation shall happen here. Display.PointerIcon.validate(): Removed, not used.
* Bug 1156, Bug 1406: NEWT DRM/GBM WindowDriver.surfaceSwap(): Pass ↵Sven Gothel2019-12-041-10/+20
| | | | swapInterval to optionally skip VSYNC if 0
* Bug 1156: LinuxKeyEventTracker, LinuxMouseTracker: Robostness (+NEWT fix)Sven Gothel2019-11-306-41/+65
| | | | | | | | commit 453f80e38bcb0945e7eac27a5917dce9bdc6446b added disabling the tracker, however the NEWT usage didn't cover all mouse tracker null pointer. Further, let's initialize and spawn off the threads only at first getSingleton() call not at class initialization earlier.
* Bug 1156: LinuxKeyEventTracker, LinuxMouseTracker: Adding property to ↵Sven Gothel2019-11-302-14/+42
| | | | | | | | | | | disable each LinuxKeyEventTracker also disable the eventX reading by default, but can be enabled via new property. The 'return bug' (crash due to underlying console) is indeed not occuring when using a VT w/o running console application underneath. As Xerxes showed, one may use chvt to a free known VT or openvt.
* Bug 1156: LinuxKeyEventTracker: Add '/dev/input/by-path/*-event-kbd' and ↵Sven Gothel2019-11-291-42/+75
| | | | more documentation
* Bug 1156: DRM/GBM: Add full PointerIcon (Cursor) SupportSven Gothel2019-11-294-39/+201
| | | | | | | | | | | | DRM allows 64x64 pixel cursor images, using GBM_FORMAT_ARGB888 only. Notable: GBM_FORMAT_ARGB888 == PixelFormat.BGRA8888 Having fixed mouse and keyboard input with previous commit, the demo com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT shows via key press - i -> pointer visible/invisible - c -> pointer icon change
* Bug 1156: LinuxKeyEventTracker: Fix 64bit InputEvent and attempt to only use ↵Sven Gothel2019-11-292-54/+123
| | | | | | | | | | | | | keyboard event files The time structure on 64bit machines uses two 8 byte long values instead of two 4 bytes int values on 32bit machines. The insufficient read on 64bit machines caused an IllegalArgument exception. This fix considers 32 or 64 bit operation. Class renamed: LinuxEventDeviceTracker -> LinuxKeyEventTracker, as it tracks key events specifically. Now the EventDeviceManager tries to only use /dev/input/by-id/*-event-kbd keyboard event files, which reduces the handling on kbd event files only.
* Bug 1156 - Implement DRM/GBM Support for JOGL(EGL) and NEWTSven Gothel2019-11-283-91/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-233-23/+86
| | | | | | | | | | | | | | | | | - 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: GBM: Fixing native GBM code, surviving initializationSven Gothel2019-11-222-10/+16
|
* Bug 1156: NEWT: NewtFactory.getCustomClass(..) RobustnessSven Gothel2019-11-223-15/+3
| | | | | getCustomClass(..) shall throw all required exceptions upstream. Previous essential NEWT driver exception information got suppressed if failing, only disclosed in debug mode.
* Bug 1156: EGL-GBM: Cleanup Code & Replace Newt GBM implementationSven Gothel2019-11-216-270/+467
| | | | | | GBM driver is now under egl/gbm subpackage and has been replaced by bcm_vc_iv boilerplate. Native code is reentrant capable and cleaned up. TODO: EGLDisplayUtil work with SharedResourceRunner
* gbm/WindowDriver: make it compile and linkXerxes Rånby2019-11-211-4/+6
|
* add native gbm implementation for drm and gbm initialization.Erik De Rijcke2019-11-212-134/+4
|
* add gbm java & build modificationsErik De Rijcke2019-11-213-0/+398
|
* Bug 1393: MacOS: Wait for window position setting on main-thread (blocking)Sven Gothel2019-11-211-17/+4
| | | | Also issue the orderFront0 call within createWindow1 (aligned with IOS code)
* Bug 1393: MacOS: Implement AppKit EDTUtil operating solely on main-threadSven Gothel2019-09-162-1/+362
| | | | | | Introducing boolean property 'newt.macos.useAppKitEDTUtil', which defaults to 'false'. If enabled, the new AppKitEDTUtil is being used, operating on the AppKit main thread. This is used to ease debugging Bug 1393, minimizing thread context switches.
* NEWT Cleanup: WindowImpl: Drop unused 'defer' argument (state change only): ↵Sven Gothel2019-09-104-16/+11
| | | | insetsChanged + insetsVisibleChanged
* NEWT Cleanup: WindowImpl::visibleChanged(ZZ): Remove unused 'defer' ↵Sven Gothel2019-09-1010-32/+32
| | | | argument. Method only changes state.
* Bug 1393: MacOS/iOS: Issue updateSizePosInsets0 async to AppKit Main-ThreadSven Gothel2019-09-092-5/+22
| | | | | | Additionally, setPointerIcon0 must also be made async on AppKit (instead of wait), we have to assume/hope the user won't pull the PointerIconImpl instance in-between ;-) Hence removing the comment regarding the lifecycle.
* Bug 1393: Run orderFront0(=setVisible) async off-thread on AppKit after sync ↵Sven Gothel2019-09-092-36/+49
| | | | | | | | | | | | | | | | | AppKit NSWindow creation MacOS 10.14.6 + OpenJDK11U produces occasional freezes on AppKit Main Thread Latest manual tests after resolving Bug 1389 disclosed a few occasional freezes using NEWT + Java11. These are related to probable AWT changes since Java8, as these do not occur with Java8. Fix: Spun off orderFront0(=setVisible) async off-thread on AppKit after sync AppKit NSWindow creation. This fix also aligns the macos createWindow code with the new simplified ios implementation, see commit 004c67c73a0309158c30929cd0d6513e23f34803
* Bug 1363: Java 11: JAWTUtil: Use sun.awt.SunToolkit.awtLock/Unlock and ↵Sven Gothel2019-09-041-58/+4
| | | | | | | | | | | | | | | 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-3/+3
| | | | | | | | | | | | | | | | | 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.
* NEWT iOS WindowDriver: Remove unused orig UIWindow/UIView creation pathSven Gothel2019-07-081-48/+0
| | | | See commit 004c67c73a0309158c30929cd0d6513e23f34803
* NEWT iOS WindowDriver: native UIWindow/UIView creation changeSven Gothel2019-07-081-13/+56
| | | | | | | | Astonishingly, the original code path doesn't show up the CAEAGL View/Layer (only the red test background) even though t is 1:1 equal to this alternative calls. Keeping the original path intact for future validation, another round of hours of analysis. The original code path will be removed in the next commit.
* NEWT iOS: Support Multi-Touch Events, PixelScale, ..Sven Gothel2019-07-081-2/+16
| | | | | | | | | | | | | | | | | 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-084-38/+47
| | | | | | | | | | - 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.
* NEWT WindowImpl.doPointerEvent: Use native short[] for pNamesSven Gothel2019-07-083-16/+13
| | | | | | and not int[], this avoid copying in case given pNames are normalized. This is benecifical for X11, Windows and the upcoming iOS touch/pointer support.
* iOS: Initial working commit supporting iOS (ipad pro 11)Sven Gothel2019-06-234-0/+1554
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 1370: Call from Main-Thread: NW's OSXUtil.CreateNSWindow0(..) and NEWT's ↵Sven Gothel2019-04-051-20/+23
| | | | | | | | | | | | | | | | | | | | | | 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
|