aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/jogamp
Commit message (Collapse)AuthorAgeFilesLines
* 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-082-4/+10
| | | | | | | | | | | | | | | | | | | | | | 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 1363: Java 11: Utilize UnsafeUtil.doWithoutIllegalAccessLogger(..) ↵Sven Gothel2019-09-042-42/+69
| | | | | | | | | | 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.
* 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-232-0/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-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
|
* Bug 1290: Expand query whether BCM IV is being used, exclude '/dev/dri/card0'rcpulledSven Gothel2018-01-161-0/+76
| | | | Also refactor query to jogamp.nativewindow.BcmVCArtifacts
* X11Util.openDisplay: DEBUG: Show reusable and pending display countSven Gothel2015-11-151-4/+6
|
* Bug 1232 - NEWT Translucent Decorated Windows Not Working On Windows >= 8 ↵Sven Gothel2015-10-011-1/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Lack of Aero / Blur ) Adopting new undocumented user32.dll Windows >= 8 API: - SetWindowCompositionAttribute / AccentState See: - <https://github.com/riverar/sample-win10-aeroglass/blob/master/MainWindow.xaml.cs> - <http://withinrafael.com/adding-the-aero-glass-blur-to-your-windows-10-apps/> - <http://undoc.airesoft.co.uk/user32.dll/SetWindowCompositionAttribute.php> - <http://undoc.airesoft.co.uk/user32.dll/GetWindowCompositionAttribute.php> +++ Cleaning up WindowsDWM.h, use on header file (in stub_includes) for GlueGen and implementation. +++ Merge java implementation within GDIUtil.DwmSetupTranslucency(..), to be utilized by NEWT and JOGL. NEWT issues GDIUtil.DwmSetupTranslucency(..) at creation and when toggling decoration. Toggling decoration on Win >= 8 leads to lost of translucency when returning to decorated window. On Win 7, this may work .. but is also buggy. +++ Followup patch is needed for NEWT to _not_ clear the background!
* Bug 1232 - NEWT Translucent Decorated Windows Not Working On Windows >= 8 ↵Sven Gothel2015-09-261-0/+26
| | | | | | | | | | | | (Lack of Aero / Blur ) - Wrap GDI::DwmIsCompositionEnabled() in GDIUtil, so it always returns true if Windows >= 8 (even if not manifested) - Nothing we seem to be able to do about the lack of Aero, i.e. blur effect of decorated windows - Undecorated windows work well though ..
* Bug 1211: Hardening Condition-Wait from Spurious-Wakeups and unintended ↵Sven Gothel2015-09-151-22/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InterruptedException(s) Below is an updated list of Condition-Wait classifications as described in Bug 1211. This list includes recent changes on GlueGen regarding this Bug 1211. A followup commit will address the unit tests. - Noncancelable + Persistent-Wait - GLMediaPlayerImpl.StreamWorker thread (changed) - pauses thread in case of intr - Cancelable + Persistent-Wait: - LFRingbuffer.getImpl(..) - LFRingbuffer.waitForFreeSlots(int) - SyncedRingbuffer.getImpl(..) - SyncedRingbuffer.waitForFreeSlots(int) - FunctionTask.invokeOnNewThread(..) (changed) - RunnableTask.invokeOnNewThread(..) (changed) - SharedResourceRunner.run() - SharedResourceRunner.doAndWait() (changed) - SharedResourceRunner.start() (changed) - SharedResourceRunner.stop() (changed) - GLMediaPlayerImpl.StreamWorker ctor (changed) - GLMediaPlayerImpl caller thread actions do*() (changed) - AndroidGLMediaPlayerAPI14.getNextTextureImpl(..) (changed) - DisplayImpl.enqueueEvent(..) (changed) -> Persistent-Wait -> Cancels wait and NEWTEvent -> dispatchMessage(NEWTEventTask): always notifyCaller! - GLDrawableHelper.invoke(..) (changed) - DefaultEDTUtil.waitUntilIdle() (changed) - DefaultEDTUtil.waitUntilStopped() (changed) - DefaultEDTUtil.invokeImpl(..) (changed) - DefaultEDTUtil.NEDT.run(..) (changed) - AWTEDTUtil.waitUntilStopped(..) (changed) - AWTEDTUtil.invokeImpl(..) (changed) - AWTEDTUtil.NEDT.run(..) (changed) - SWTEDTUtil.invokeImpl(..) (changed) - SWTEDTUtil.waitUntilStopped(..) (changed) - SWTEDTUtil.NEDT.run(..) (changed) - GLWorkerThread.invokeAndWait(..) - GLWorkerThread.start() (changed) - GLWorkerThread.WorkerRunnable.run() (changed) - Animator.run() (changed) - AnimatorBase.finishLifecycleAction() (changed) - OSXUtil.RunOnMainThread(..) (changed) - SingletonInstanceServerSocket.Server.shutdown() (changed) - SingletonInstanceServerSocket.Server.start() (changed) - com.jogamp.audio.windows.waveout.Mixer.shutdown() (changed) - Extending/Using InterruptSource.Thread (changed) - DefaultEDTUtil.NEDT - AWTEDTUtil.NEDT - SWTEDTUtil.NEDT - GLWorkerThread.thread - Mixer.FillerThread - Mixer.MixerThread - Using InterruptSource.Thread (changed) - TempFileCache - LauncherTempFileCache - Animator.thread - SingletonInstanceServerSocket.Server.serverThread Deprecated: - FunctionTask.invoke(..) (changed) -> on current thread, no wait -> deprecated - RunnableTask.invoke(..) (changed) -> on current thread, no wait -> deprecated
* Bug 1212 - OSX: Crash using CALayer at UnsetJAWTRootSurfaceLayer0(..) w/ ↵Sven Gothel2015-09-011-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Java 1.8.0_60 - OSX 10.10.5 - Java 1.8.0_60 Crash using CALayer at UnsetJAWTRootSurfaceLayer0(..) as called within MacOSXJAWTWindow.invalidateNative() (caller: destroy()) on the MainThread. It has been observed that the JAWT_SurfaceLayers protocol instance 'surfaceLayers' has been pulled beforehand. 'surfaceLayers' is fetched from the locked JAWT instance via JAWT_DrawingSurfaceInfo's platformInfo. It now seems required to retain the instance at GetJAWTSurfaceLayersHandle0 and release it at UnsetJAWTRootSurfaceLayer0 to keep it alive. +++ Manually executed 'ant junit.run' on OSX, no failures or errors.
* Bug 1210 - Use manual impl. XRenderFindVisualFormat instead of buggy ↵Sven Gothel2015-08-311-5/+7
| | | | | | | | | | | | | | | | | | | | generated version - XRenderDirectFormat XVisual2XRenderMask(..): - Move from JOGL's X11GLXGraphicsConfiguration -> Nativewindow X11GraphicsConfiguration - Always use manual impl. of XRenderFindVisualFormat Additionally: - Add X11GraphicsConfiguration.XVisualInfo2X11Capabilities(..) allowing to properly setup the resulting Capabilities instance as used in X11GraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(..) - XVisualInfo: - Add 'String toString()' - 'XVisualInfo create(XVisualInfo s)' uses source buffer size! - XGetVisualInfo: Use returned buffer-capacity/count for element-size and also bail out if count<=0
* Bug 1181 - JOGL WebStart Applications using GLCanvas/AWT may Deadlock by two ↵Sven Gothel2015-07-273-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | AWT-EDT on Java >= 1.8.0_45 Root cause: - AWT Toolkit global Lock Our locking scheme (AWT-EDT-1): - Surface Lock - sun.awt.SunToolkit.awtLock() - Component.getGraphicsConfiguration() -> synchronized(Component.getTreeLock()) Other AWT-EDT-2 by Webstart: - synchronized(Component.getTreeLock()) - sun.awt.SunToolkit.awtLock() Results in a deadlock. Solution: - Issue Component.getGraphicsConfiguration() before awtLock(), where Component.getGraphicsConfiguration() is being used to detect possible reconfiguration. - Also use updated AWTGraphicsConfiguration's GraphicsConfiguration if no 'new' detection is required.
* Bug 1148 - OSX MonitorDevice: Use unique and native deviceID instead of indexSven Gothel2015-03-212-15/+14
| | | | | | | | | | | | | Adopt to bug 1147, commit 2c88b6dfd4eb7e2cd9a50fa48e08ecafc980931a. Using the native unique deviceID makes monitor identification more robust. This also allows us simplify displayID -> NSScreen-idx -> MonitorDevice into displayID -> MonitorDevice and to survive a primary monitor change.
* Bug 1130 - Add Mapping from AWT Component -> NEWT [Screen, MonitorDevice]Sven Gothel2015-02-172-0/+92
| | | | | | | | | | | | | | | | | | | | | | | The mapping AWT Component -> NEWT [Screen, MonitorDevice] shall allow generic AWT applications to utilize NEWT's MonitorDevice information like physical monitor-size and DPI. - AWT-Component -> NEWT-Display: - NewtFactoryAWT.createDisplay - AWT-Component -> NEWT-Screen: - NewtFactoryAWT.createScreen - AWT-Component -> NEWT-MonitorMode: - NewtFactoryAWT.getMonitorDevice - NewtFactoryAWT.getMonitorDevice - If OSX, utilizing OSX's AWT Component -> MonitorDevice-Index mapping - Otherwise using the coverage to identify MonitorDevice See TestGearsES2GLJPanelAWT 'GetPixelScale', demonstrating the mapping while pressing 'p' (cached MonitorMode) and pressing SHIFT-'p' (non-cached MonitorMode).
* NativeWindow: Refactor getLocationOnScreenSafe(..) and ↵Sven Gothel2015-02-172-3/+58
| | | | getLocationOnScreenNonBlocking(..) from JAWTWindow -> AWTMisc (to be reused)
* Bug 682 - Relocating javax.media.opengl.* -> com.jogamp.opengl.* (Part 1)Sven Gothel2015-02-0232-117/+117
| | | | | | | | | sed -i 's/javax\.media\.opengl/com\.jogamp\.opengl/g' `grep -Rl "javax\.media\.opengl" src` sed -i 's/javax\.media\.nativewindow/com\.jogamp\.nativewindow/g' `grep -Rl "javax\.media\.nativewindow" src` sed -i 's/javax\/media\//com\/jogamp\//g' `grep -Rl "javax/media/" src` sed -i 's/javax\/media\//com\/jogamp\//g' `grep -Rl "javax/media/" doc` Manually edited all occurences within make/**
* Bug 1120 - Refine HiDPI Support ( Part-2 ) (API CHANGE)Sven Gothel2015-01-275-200/+212
| | | | | | | | | | | | | | | | | | | | | | - Use float[2] for pixel-scale. Utilize simple integer rounding: int-pixel-units = (int) ( int-window-units * pixel-scale + 0.5f ) - Provide minimum and maximum allowed pixel-scale values to be set by platform, supporting generic pixel-scale validation. - Remove 'OSXUtil.GetPixelScale(final RectangleImmutable r, final int[] screenIndexOut)', implementation for all platforms would cause huge redundancy of Screen and MonitorDevice code (duplication of NEWT). - instead, add 'float[2] pixelScale' to NEWT's MonitorDevice - Detect change of pixel-scale and propagate accordingly. This allows GLCanvas, GLJPanel and NewtCanvasAWT instances to be dragged between monitor devices w/ different pixel-scale. - OSX: Handle native triggered reshape events off-thread to avoid EDT congestion due to locked window when consuming deferred events on EDT.
* Bug 1120 - Add OSXUtil.GetPixelScale(final RectangleImmutable r, final int[] ↵Sven Gothel2015-01-231-0/+55
| | | | screenIndexOut) ( Part-1 )
* Bug 1068 - Use GenericUpstreamSurfacelessHook for all ↵Sven Gothel2015-01-231-92/+0
| | | | createSurfacelessImpl(..) implementations
* Bug 1068, 1096: Unify EGL surface related code in EGLSurface; Add notion of ↵Sven Gothel2014-12-073-1/+130
| | | | | | | | | | | | | | | | | | | | | 'Surfaceless Upstream Surface' Preparation for Bug 1068: GLContext creation and makeCurrent without default framebuffer - Unify EGL surface related code in EGLSurface - EGLWrappedSurface -> EGLSurface, which utilizes a more straight forward foreign upstream surface (X11, GDI, ..) to EGL mapping. This also addresses Bug 1096, i.e. EGL Cleanup. - Add notion of 'Surfaceless Upstream Surface' - Add surfaceless 'fake' upstream surface hooks: - EGLUpstreamSurfacelessHook - X11UpstreamSurfacelessHook Utilizing the ProxySurface option bit 'OPT_UPSTREAM_SURFACELESS' signaling usage of 'no surface'. - Add GLDrawableFactoryImpl.createSurfacelessImpl(..)
* Bug 1107 - Refine PixelFormat, GLPixelBuffer and ↵Sven Gothel2014-12-061-19/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DirectDataBufferInt/BufferedImageInt - PixelFormat Refine definition allowing complete format conversion by its attributes instead of static 'knowledge'. - PixelFormat has_a *new* PixelFormat.Composition - PixelFormat.Composition contains all pixel component layout information as required for inspection and conversion. Component names are enumerated via PixelFormat.CType. - PixelFormatUtil.convert(..) utilizes generic conversion based on PixelFormat.Composition rather static type mapping. However, a int32 RGBA static conversion is still supported for performance. Utilizes Bitstream for varying pixel component bit-width. - Complete w/ hashCode() and equals(..) - GLPixelBuffer - Take 'pack' mode into account when determine GLPixelAttributes, i.e. on GLES pack=true (e.g. glReadPixel) only RGBA is guaranteed to work. Hence querying GLPixelAttributes requires the GLProfile, PixelFormat and pack mode. - Complete GLPixelAttributes conversions from PixelFormat or GL format/data-type, while taking GL data-type into account, as well as pack-mode. - Complete w/ hashCode() and equals(..) - SingletonGLPixelBufferProvider queries singleton GLPixelBuffer via - PixelFormat.Composition hostPixelComp, - GLPixelAttributes pixelAttributes, - boolean pack which comprise a unique key, allowing the implementation to utilize a hash map. This is implemented in AWTSingletonGLPixelBufferProvider. This allows distinct singleton GLPixelBuffer for different host PixelFormat (conversion) and GLPixelAttributes (depending on GLProfile). - Removes field 'componentCount' which was 'hacked in' to pass information about an optional host memory layout. Implementations utilizing conversion, e.g. AWTGLPixelBuffer, can implement GLPixelBufferProvider's 'PixelFormat.Composition getHostPixelComp(final GLProfile glp, final int componentCount)' and manage such implementation details, see use-case GLJPanel. - DirectDataBufferInt/BufferedImageInt: Expose underlying NIO ByteBuffer - AWTMisc.createCursor(..) uses DirectDataBufferInt.BufferedImageInt exposed NIO ByteBuffer, allowing to use generic PixelFormatUtil.convert(..).
* Use ExceptionUtils.dumpStack(..) instead of Thread.dumpStack()Sven Gothel2014-10-263-4/+8
|
* NativeWindow's ToolkitLock TRACE_LOCK: Show more usable detailsSven Gothel2014-10-074-13/+28
|
* Bug 1036: NVidia's Windows Driver Threaded optimization: Alternative ↵Sven Gothel2014-07-301-0/+6
| | | | affinity mask setting on all threads of process - Didn't work (disabled)
* Bug 1024: Add fallback for native-jar-file location via classpathSven Gothel2014-07-112-34/+22
| | | | Adapt to GlueGen commit f5c48efcf546ba4e08e197ccced6df83b57e1755
* Findbugs: Use <NumberType>.valueOf(..) instead of 'new <NumberType>(..)'Sven Gothel2014-07-081-1/+1
|
* Findbugs.increment_volatile: Use AtomicInteger or add comment that operation ↵Sven Gothel2014-07-081-7/+7
| | | | is safe!
* Findbugs.synchronization: Fix double-check w/o volatile; Remove redundant ↵Sven Gothel2014-07-081-1/+1
| | | | synchronized from setter
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-0329-198/+205
| | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Fix 'typo' in messages: 'Catched' -> 'Caught'Sven Gothel2014-06-282-2/+2
|
* Adapt to GlueGen commit c3054a01990e55ab35756ea23ab7d7c05f24dd37 (compount ↵Sven Gothel2014-06-171-1/+1
| | | | call-by-value extension), utilizing native JVMUtil_NewDirectByteBufferCopy(..)
* Fix Bug 1019 - Remedy of Bug 691 causes 'access/modify after free' and ↵Sven Gothel2014-06-122-67/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | crashes the app The 'magic' MyNSOpenGLContext::dealloc (MacOSXWindowSystemInterface-calayer.m) of force destroying the underlying CGLContextObj of it's associated NSOpenGLContext as introduced as a remedy of Bug 691 is plain wrong. It was added in commit f6e6fab2a7ddfb5c9b614cb072c27ff697629161 to mitigate the experience behavior of delayed GL context destruction when creating/destroying them multiple times as exposed in unit test TestGLCanvasAddRemove01SwingAWT. While this 'hack' worked for some reason on some OSX versions, it caused a 'access/modify after free' issue exposed under some circumstances and crashes the application. The actual culprit of the delayed GL context destruction is different. The offthread CALayer detachment and hence final destruction issued on the main-thread is _not_ issued immediately due to some referencing holding by NSApp. Issuing an empty event on the NSApp (thread) will wake up the thread and release claimed resources. This has been found while realizing that the GL context are released if the mouse is being moved (duh!). This issue is also known when triggering stop on the NSApp (NEWT MainThread), same remedy has been implemented here for a long time.
* Bug 741 HiDPI: Add ScalableSurface.getNativeSurfaceScale(..) to compute ↵Sven Gothel2014-06-092-17/+20
| | | | | | | | | | | | | | surface DPI ; Add NEWT Window.getPixelsPerMM(..) to query surface DPI With HiDPI and surface scale, we need knowledge of the native surface's pixel-scale matching the monitor's pixel-per-millimeter value. Preserving the queried native pixel-scale and exposing it via ScalableSurface.getNativeSurfaceScale(..) to compute surface DPI. Add NEWT Window.getPixelsPerMM(..) to query surface DPI. Surface DPI is demonstrated in GraphUI's GPUUISceneGLListener0A .. and TestRulerNEWT01, etc ..
* Bug 741 HiDPI: Simplify ScalableSurface (2): Add request pixelScale API ↵Sven Gothel2014-06-083-11/+12
| | | | | | | | | | | | | | | | | | | entry, fixed NewtCanvasAWT use-case We require the requested pixelScale in NewtCanvasAWT if the NEWT window (child) is not yet realized, so the JAWTWindow can receive the request, since realized/current pixelScale is still 1. Remove return value (requested pixel scale): - public int[] setSurfaceScale(final int[] result, final int[] pixelScale); + public void setSurfaceScale(final int[] pixelScale); Add API hook to query requested pixel scale: + int[] getRequestedSurfaceScale(final int[] result); Unique name for get[Current]*: - public int[] getSurfaceScale(final int[] result); + public int[] getCurrentSurfaceScale(final int[] result);
* Bug 741 HiDPI: Simplify ScalableSurface [set|get]SurfaceScale(..) spec, ↵Sven Gothel2014-06-083-7/+12
| | | | | | | | | | | | which also fixed JAWTWindow getSurfaceScale() issue on Windows Let setSurfaceScale(..) return the validated requested values and getSurfaceScale(..) always the current values. This removes complication and solves a bug w/ JAWTWindow on Windows, where we used 'drawable' as an indicator for 'previous locked' state. The latter is not true since on Windows 'drawable' is set to null in unlock, getWindowHandle() should be taken instead.
* Bug 741 HiDPI: Add ScalableSurface interface to get/set pixelScale w/ full ↵Sven Gothel2014-06-084-6/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OSX impl. Add ScalableSurface interface - To set pixelScale before and after realization - To get pixelScale - Implemented on: - NEWT Window - Generic impl. in WindowImpl - OSX WindowDriver impl. - Also propagetes pixelScale to parent JAWTWindow if offscreen (NewtCanvasAWT) - AWT WindowDriver impl. - JAWTWindow / OSXCalayer - AWT GLCanvas - AWT GLJPanel - NEWTCanvasAWT: - Propagates NEWT Window's pixelScale to underlying JAWTWindow - WrappedSurface for pixelScale propagation using offscreen drawables, i.e. GLJPanel - Generic helper in SurfaceScaleUtils (nativewindow package) - Fully implemented on OSX - Capable to switch pixelScale before realization, i.e. native-creation, as well as on-the-fly. - Impl. uses int[2] for pixelScale to support non-uniform scale. Test cases: - com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT - com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT - com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT - com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT - Press 'x' to toggle HiDPI - Commandline '-pixelScale <value>' - Added basic auto unit test (setting pre-realization)
* Minor: API-Doc / DEBUG Typo, GDISurface: Make fields privateSven Gothel2014-06-083-4/+4
|
* UpstreamSurfaceHook: Add 'NativeSurface getUpstreamSurface()' (from ↵Sven Gothel2014-06-081-2/+3
| | | | EGLUpstreamSurfaceHook) to generalize ProxySurfaceImpl.getUpstreamSurface()
* Bug 741 HiDPI: Add new NativeSurfaceHolder interface to GLDrawable and ↵Sven Gothel2014-06-061-0/+4
| | | | | | | | | | | | | | NativeWindow; [AWT|SWT]NewtEventFactory use NativeSurfaceHolder as source, fixes pixel unit conversion - Add new NativeSurfaceHolder interface to GLDrawable and NativeWindow, allowing NativeSurface access (pixel unit conversion) A NativeSurfaceHolder is e.g.: - NativeWindow (is-a) - NEWT [GL]Window - GLDrawable (has-a) - [AWT|SWT]GLCanvas - [AWT|SWT]NewtEventFactory use NativeSurfaceHolder as source, fixes pixel unit conversion
* Bug 741 HiDPI: [Core API Change] Bring back get[Width|Height]() in ↵Sven Gothel2014-05-272-6/+6
| | | | | | | | | | | NativeWindow, i.e. getWindow[Width|Height]() -> get[Width|Height]() We have distinguished pixel- and window units in commit f9a00b91dcd146c72a50237b62270f33bd0da98e and introduced NativeWindow.getWindow[Width|Height]() and NativeSurface.getSurface[Width|Height](). To have a unique naming scheme, we could rename all method using 'Window', but for simplicity and since there will be no 'semantic override' just use the simple version.