summaryrefslogtreecommitdiffstats
path: root/src/nativewindow
Commit message (Collapse)AuthorAgeFilesLines
* Nativewindow/NEWT: Fix C Return StatementSven Gothel2013-11-171-1/+1
|
* Fix GLIBC > 2.4 dependency regression of commit ↵Sven Gothel2013-11-171-0/+3
| | | | | | | 613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d Commit 613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d introduced 'memcpy' usage in Xmisc.c which could create a GLIBC > 2.4 dependency. Include GlueGen's glibc-compat-symbols.h to remove such dependency.
* Bug 906 - JAWTWindow Component- and HierarchyListener must be detached at ↵Sven Gothel2013-11-161-34/+61
| | | | | | | | | | JAWTWindow.destroy() - GLCanvas Recreation Case In case a JAWTWindow owner recreates itself, destroying JAWTWindow must detach the Component- and HierarchyListener from the AWT component! Test TestBug816GLCanvasFrameHoppingB849B889AWT shows properly detaching listener at jawtWindow destruction.
* Fix Bug 889 [Related: Bug 816, Bug 849, Bug 729] - GLCanvas disappear when ↵Sven Gothel2013-11-101-10/+21
| | | | | | | | | moves between two JFrame When JAWTWindow's visibility tracker updates component's local visibility, it should read it's local visibility state instead 'trusting' the passed state. Make JAWTWindow's visibility tracker DEBUG output more brief for readability.
* Bug 899: Validate whether we propagate WNDPROC as retrieved from ↵Sven Gothel2013-11-102-2/+17
| | | | | | | | | | | | | 'getDummyWndProc0()' in RegisteredClassFactory - Result: Yes we do. GDI.initSingleton() dummyWindowClassFactory RegisteredClassFactory[moduleHandle 0x13f3e0000, _dummyWindow_clazz, wndProc 0x6c101de6, shared[refCount 0, class null]] GDI.CreateDummyWindow() dummyWindowClassFactory RegisteredClassFactory[moduleHandle 0x13f3e0000, _dummyWindow_clazz, wndProc 0x6c101de6, shared[refCount 1, class RegisteredClass[handle 0x13f3e0000, _dummyWindow_clazz0]]] GDI.CreateDummyWindow() dummyWindowClass RegisteredClass[handle 0x13f3e0000, _dummyWindow_clazz0] ++ Note: The RegisteredClassFactory mechanism is used for NEWT Windows as well.
* NativeWindow *GraphicsDevice: Align constructors to simplify call hierarchy ↵Sven Gothel2013-11-062-21/+5
| | | | for analysis.
* JNI Code: Call DeleteLocalRef(..) manually.Sven Gothel2013-11-051-0/+1
|
* Bug 888 - Validate CPU Runtime Performance: ↵Sven Gothel2013-11-041-0/+15
| | | | | | | | | | | | | | | | | | | | X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(..) X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(..) ran over all FB configs and for each it grabbed native config values separately. Fetching them in bulk mode saves around 7% of this function's cost. Also reuse XRenderPictFormat instance for 'XRenderDirectFormat XRenderFindVisualFormat(..)' call, saving a few NIO creation cycles w/ StructAccessor. Biggest savior is X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationFBConfig()'s fast path w/o chooser and usable 1st FBConfig. Here we only issue 'GLXFBConfig2GLCapabilities(..)' on the first valid entry. Test w/ 50 X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationFBConfig() invocations: - pre change: 1.708 ms - post change: 650 ms Time is no spent almost solely on native glXChooseFBConfig (546ms).
* Fix Bug 878 - JAWTWindow's HierarchyListener doesn't set component visible ↵Sven Gothel2013-10-311-11/+15
| | | | | | | | | | | | | | | | | | | (again) on 'addNotify(..)' - GLCanvas in JtabbedPane disappear Regression of commit e33e6374e0be0454f7e9732b5f897f84dbc3c4dc (Fix for Bug 729 and Bug 849) ! +++ JAWTWindow's HierarchyListener doesn't set component visible (again) on 'addNotify(..)' It only renders the component invisible after removeNotify() which is performed implicit anyways .. Case java.awt.event.HierarchyEvent.DISPLAYABILITY_CHANGED shall perform similar as our java.awt.event.HierarchyEvent.SHOWING_CHANGED impl. +++ Tested on Gnu/Linux X11 and OSX incl. re-test Bug 729 and Bug 849 unit tests.
* Merge remote-tracking branch 'hharrison/master'Sven Gothel2013-10-252-8/+3
|\
| * jogl: remove clone() method that only throws ExceptionsHarvey Harrison2013-10-201-5/+0
| | | | | | | | | | | | | | | | | | | | commit: a4e3f241cfba55e407c68eba91ffcc4beb0758b5 (Analysis of glXMakeCurrent freeze on ATI fglrx 8.78.6; Misc ..) Removed 'implements Clonable' from NamedDisplay, which means Object.clone() will always throw CloneNotSupportedException. Kill clone(). Signed-off-by: Harvey Harrison <[email protected]>
| * jogl: replce more unneeded String() constructionHarvey Harrison2013-10-201-3/+3
| | | | | | | | Signed-off-by: Harvey Harrison <[email protected]>
* | MacOSXJAWTWindow.CALayer DEBUG: Only Dump AWT location-on-screen if property ↵Sven Gothel2013-10-231-2/+16
|/ | | | | | | | | | DEBUG_CALAYER_POS_CRITICAL is explicitly set. - DEBUG_CALAYER_POS_CRITICAL = nativewindow.debug.JAWT.OSXCALayerPos Since AWT's location-on-screen query can cause an AWT deadlock, which is the sole purpose of our custom lock-free impl, don't enable it's DEBUG output w/ default DEBUG flags.
* jogl: avoid creating a second String object, one is enoughHarvey Harrison2013-10-185-5/+5
| | | | | | | One String is already being built, passing it to new String() is just wasteful as the temp String can be returned just as easily. Signed-off-by: Harvey Harrison <[email protected]>
* jogl: add missing @Override annotationsHarvey Harrison2013-10-1745-1/+94
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* jogl: remove all trailing whitespaceHarvey Harrison2013-10-1783-1089/+1089
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Add efficient set(..all..) to Dimension, Insets, Point and Rectangle of ↵Sven Gothel2013-10-166-30/+34
| | | | NativeWindow's util types.
* AWTPrintLifecycle.setupPrint(..): Add optional tileWidth and tileHeight, ↵Sven Gothel2013-10-151-11/+19
| | | | allowing user to set custom tile size for performance evaluation/tweak
* Cleanup DirectDataBufferInt: Fix type ; Remove unsused local varsSven Gothel2013-10-151-5/+1
|
* NativeWindow/OSX: Fix RunOnThread/RunLater - Properly determine 'forkOnMain' ↵Sven Gothel2013-10-072-10/+13
| | | | via onMain && ( isOnMain || 0 < delay )
* Bug 729, Bug 849: Honor JAWTWindow's [parent] visibility stateSven Gothel2013-10-061-26/+96
| | | | | | | | | | | | JAWTWindow snoops HierarchyEvents for SHOWING_CHANGED to track local component's visibility state as well as it's global visibility state. The later is determined by it's parent's visibility change. If 'removeNotify()' is called, component's visibility is reset to it's local visibility state. Fixes OSX CALayer component's visibility if parent's visibility changes (Bug 729). Fixes continuous GL rendering if parent is invisible (Bug 849).
* Bug 729: OSX CALayer invisible needs to have opacity 0 to not show hidden ↵Sven Gothel2013-10-061-5/+8
| | | | | | | | component. Completes commit 3b02a219b1b9e446e87df1beb7da4266f74824fa See unit test: TestBug816OSXCALayerPos03AWT
* Bug816 OSX CALayer: getLocationOnScreenNonBlocking(..) stop traversing at ↵Sven Gothel2013-10-051-0/+4
| | | | | | | | | | top-level heavyweight Window, fixes [J]Dialog use case. Top-level heavyweight Window's position is it's position on screen, hence stop traversing. Thx to Emmanuel Puybaret for pointing this out. Adding Dialog and JDialog unit tests as inspired by Emmanuel Puybaret.
* Bug 729: OSX CALayer shall honor the Component's visibility stateSven Gothel2013-10-054-40/+57
| | | | | | | | | | | | | A once visible CALayer (GLCanvas) must be able to become invisible w/o destruction, e.g. as required by CardLayout's switching cards. See unit test for Bug 532: 'TestAWTCardLayoutAnimatorStartStopBug532' Out native 'fixCALayerLayout(..)' takes the visible state as tracked by JAWTWindow's ComponentListener and sets our CALayer (root and sub) hidden state accordingly. Now MacOSXJAWTWindow's layoutSurfaceLayerImpl(..) always calls down to 'fixCALayerLayout(..)' due to update the visibility state.
* Bug 816 (OSX CALayer pos): Add detailed description (pseudo code) to ↵Sven Gothel2013-10-032-3/+21
| | | | JAWTUtil.JAWT_OSX_CALAYER_QUIRK_LAYOUT
* Bug 816 (OSX CALayer pos): Fix location on 'inner CALayer' calculationSven Gothel2013-10-033-21/+43
| | | | | | | | | | | | | | | | | | | | | | | | | 'inner CALayer' is the outter AWT Window client space (content). +++ Pseudo-Code: p0 = c.locationOnScreen(); p0 -= c.getOutterComp.getPos(); p0 -= c.getOutterComp.getInsets(); Where 'locationOnScreen()' is: p0 = 0/0; while( null != c ) { p0 += c.getPos(); } +++ JAWTWindow.getLocationOnScreenNonBlocking(..) validated against AWT's Component.getLocationOnScreen() - OK for all use-cases. (Validation enabled w/ DEBUG) All unit tests manually validated on OSX 10.7 w/ jdk7u40.
* Bug 816: Clarify JAWT_OSX_CALAYER_QUIRK_* semantics, add ↵Sven Gothel2013-09-284-15/+58
| | | | JAWT_OSX_CALAYER_QUIRK_LAYOUT
* Fix Bug 816: JAWTWindow.getLocationOnScreenNonBlocking(..) shall use ↵Sven Gothel2013-09-272-11/+31
| | | | | | | | | | | | | | | | | | | | | | | | JRootPane for last position offset; AWTMisc.getInsets(..) add special JRootPane case. Please note that we use JAWTWindow.getLocationOnScreenNonBlocking(..) to determine the location on the screen 'only' b/c we cannot allow AWT to aquire the tree-lock! The latter would be the case if using AWT's 'getLocationOnScreen()'. If anybody has a more reliable implementation to achieve the same .. please provide your patch! The following fix has been performed to fix the last issue w/ vZome. - JAWTWindow.getLocationOnScreenNonBlocking(..) shall use JRootPane for last position offset - w/ vZome, the frame's position was 0/0 (invalid), instead JRootPane's position is good. Use JRootPane's position and stop traversing here (LW top-level). - AWTMisc.getInsets(..) add special JRootPane case. + * Exception is JRootPane. + * Return it's parent's Window component's insets if available, + * otherwise return JRootPane's insets.<br> + * This is due to <i>experience</i> that <i>some</i> JRootPane's + * do not expose valid insets value. -
* Bug 816: Fix JAWTWindow's getLocationOnScreenNonBlocking(); Derive CALayer ↵Sven Gothel2013-09-275-126/+230
| | | | | | | | | | | | | | | | | | | | | | | position from AWT component's location on screen. Track fixedFrame size of root CALayer; Add Split layout to unit test, add [manual] Applet tests. - Fix JAWTWindow's getLocationOnScreenNonBlocking() Skip JRootPane while traversing up to root Container. JRootPane would duplicate the top-level container's offset (Window insets). - Derive CALayer position from AWT component's location on screen. Add Split layout to unit test, add [manual] Applet tests. AWT >= 7u40: - AWT position is top-left w/ insets, where CALayer position is bottom/left from root CALayer w/o insets. - Use getLocationOnScreenNonBlocking() to get location-on-screen w/o insets. - Native code: flip origin AWT < 7u40 still uses fixed position 0/0 for root and sub layer. - Track fixedFrame size of root CALayer - MyCALayer: - Override layoutSublayers to validate root and sub-layer pos/size - Override setFrame to use fixedFrame, if set (similar to MyNSOpenGLLayer) - Add Split layout to unit test, add [manual] Applet tests. - Thx to 'jimthev' and 'Manu' for providing Applet unit tests
* DirectDataBufferInt: createBufferedImage(..) use BufferedImage type value ↵Sven Gothel2013-09-271-24/+83
| | | | | | | | | | | | | | | | | | | | | instead of component-count, support all int types ; Add type 'BufferedImageInt' preserving the custom image-type, add note about TYPE_CUSTOM - createBufferedImage(..) use BufferedImage type value instead of component-count, support all int types - Support all integer data image-type, hence we need to pass image-type instead of component count (collision). - Also pass 'properties' to allow configuring all BufferedImage parameters (just in case) - Return BufferedImageInt to allow user to query the used image-type, see below. - Add type 'BufferedImageInt' preserving the custom image-type, add note about TYPE_CUSTOM - Simply extends BufferedImage w/ custom image-type, since BufferedImage's type is TYPE_CUSTOM due to our custom storage type (see API doc comment). Unit tests: - Testing all integer image-type's in - TestTiledPrintingGearsSwingAWT - TestTiledPrintingNIOImageSwingAWT - Disable all AA print-hints, all AWT text visible on X11. Probably has a regression on Windows / OSX .. TBD.
* OSXMisc.c: Fix compilation error w/ java6's jint definition (probably clang ↵Sven Gothel2013-09-251-2/+2
| | | | | | as well) Regression of commit 4b5435c68c3f12d62dadb395957362eceacfb25c
* Bug 816: Fix OSX CALayer 'quirks' for AWT 1.7.0_40 - See JAWTUtil ↵Sven Gothel2013-09-245-75/+205
| | | | | | | | | JAWT_OSX_CALAYER_QUIRK_SIZE and JAWT_OSX_CALAYER_QUIRK_POSITION. - Provide quirk bits for OSX CALayer depending on used JVM/AWT and act accordingly. - TestBug816OSXCALayerPosAWT: Add resize by frame
* Add 'DirectDataBufferInt' supporting NIO based BufferedImagesSven Gothel2013-09-161-0/+238
| | | | | | | | | | - Contains convenient method to create an NIO backed BufferedImage 'BufferedImage createBufferedImage(int width, int height, int numComponents, Point location)' Standalone test TestTiledPrintingNIOImageSwingAWT 'prints', i.e. renders offscreen, the Frame into - a traditional array-backed BufferedImage - an NIO-backed backed BufferedImage
* Updating doc AWTPrinting.txtSven Gothel2013-09-151-1/+0
|
* Fix AWT printing issues w/ overlapping and/or non-opaque contents ; Change ↵Sven Gothel2013-09-151-0/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AWTPrintLifecycle's lifecycle - AWTPrintLifecycle: - Should decorate: PrinterJob.print(..), instead of within Printable.print(..) { .. container.printAll(..); .. } This is due to AWT print implementation, i.e. AWT will issue Printable.print(..) multiple times for 'overlapping' or non-opaque elements! - Move from javax.media.opengl.awt -> com.jogamp.nativewindow.awt - Make _interface_ AWT agnostic, i.e. remove Graphics2D from 'setup(..)' - Add 'int numSamples' to 'setup(..)' to determine the number of samples - AWTTilePrinter: - Use double precision when scaling image-size and clip-rect, then round them to integer values. Otherwise AWT will use the bounding box for the clipping-rectangular. - Clip negative portion of clip-rect, this removes redundant overpaints, as well as increasing the tile count due to the increased clipping-size. - Clip the image-size in the tile-renderer according to the clip-rect. - DEBUG_TILES: Dump tiles to file - Use sub-image of final BuffereImage instead of adding another clipping region. This might increase performance if no clip-rect has been set. TODO: TestTiledPrintingGearsSwingAWT overlapping tests exposes a 'off by one' bug of the first layer's background! Note: The GL content seems to be correct though - maybe it's simply an AWT rounding error ..
* Add support for clang ; Use __APPLE__ predefined macroSven Gothel2013-09-131-1/+1
|
* Fix some JavaDoc and API doc (reference) bugs ..Sven Gothel2013-09-082-0/+7
|
* Test: Don't resize frame, tweek print-matrix; AWTPrintLifecycle: Add scale ↵Sven Gothel2013-09-081-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and convenient AWT container traversal context; GLCanvas/GLJPanel properly handle existing MSAA and req. AA; - Test: Don't resize frame, tweek print-matrix - Use scaleComp72 to scale the frame to fit on page, i.e. global print matrix - Use scaleGLMatXY = 72.0 / glDPI to locally scale on the GL drawable as being passed to AWTPrintLifecycle.setup(..) - Hence frame stays untouched/stable, no need for 'offscreen' print test, which is removed. - AWTPrintLifecycle: Add scale and convenient AWT container traversal context Use a simple decoration for all AWTPrintLifecycle impl. components within a container: final AWTPrintLifecycle.Context ctx = AWTPrintLifecycle.Context.setupPrint(frame, g2d, scaleGLMatXY, scaleGLMatXY); try { } finally { ctx.releasePrint(); } - GLCanvas/GLJPanel properly handle existing MSAA and req. AA; - GLCanvas: Workaround bug where onscreen MSAA cannot switch to offscreen FBO, i.e. stay 'onscreen' - GLJPanel: Use new offscreen FBO if MSAA is requested and not yet used. - GLJPanel.Offscreen.postGL(): always swapBufer(), was missing for !GLSL swapping Results GLCanvas / GLJPanel: - Good scaling - Stable behavior / visibility - High DPI mode works
* Fix Bug 810: Adding Julien Gouesse's fix while moved the new ↵Sven Gothel2013-09-021-17/+13
| | | | 'addNativeJarLibsJoglCfg(..)' to GlueGen, commit c0ead6fa10280f8076704726d59f482b183fd77e
* NativeWindow API Doc: Fix layout / Add version.Sven Gothel2013-07-171-55/+39
|
* Remedy for Bug 782: Issue Debug.initSingleton() or Debug.debug(..) before ↵Sven Gothel2013-07-173-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | calling 'PropertyAccess.isPropertyDefined(propName, default)' through Debug class. Calling 'Debug.isPropertyDefined(propName, default)' may be 'optimized' to 'PropertyAccess.isPropertyDefined(propName, default)', which would skip the modules Debug's class initialization. Iff that happens, an AccessControlException may happen, due to requesting an insecure property, since modules own Debug class has not been added it's trusted prefixes from within it's init block yet. This seems to be a bug of the JVM .. to me, however .. the above description is the only able to explain the issue at hand. +++ Fix calls Debug class own static methods, either Debug.initSingleton() or Debug.debug(), before calling 'isPropertyDefined(propName, default)'. +++ Also mark Debug class static methods final! +++
* StringBuffer -> StringBuilderSven Gothel2013-07-152-2/+2
|
* NEWT MonitorMode test cases: Add X11 XRandR commandline reset to ↵Sven Gothel2013-07-091-1/+4
| | | | | | | | UITestCase's AfterClass if available (X11). In case a MonitorMode test case fails, force XRandR reset '-s 0 -o normal' at end of test class if X11. Unit Test: TestScreenMode00cNEWT
* Add Comparable<?>: Point*, Dimension*, Rectangle*, SurfaceSize* and ↵Sven Gothel2013-06-307-5/+105
| | | | | | | | | | | MonitorMode* ; Sort List<MonitorMode> in descending order to be well determined. Add Comparable<?>: Point*, Dimension*, Rectangle*, SurfaceSize* and MonitorMode*: - Compare square values - See API doc for order of special semantics (flags, rotation, ..) Sort List<MonitorMode> in descending order to be well determined: - Removes order by native mode id, give user a reliable natural order.
* Refine cb7118fc875b6722803e4b11d5681671962a8d3a: Unify get next/prev focus ↵Sven Gothel2013-06-241-21/+10
| | | | component method.
* Fix NewtCanvasAWT focus traversal for Java7 (Take 2): Commit ↵Sven Gothel2013-06-231-0/+39
| | | | | | | | | | | | 70bf3a4ec44504b86294a332255aaae8d2e86bf4 was not sufficient. Commit 70bf3a4ec44504b86294a332255aaae8d2e86bf4 did not work out on Windows. Solution now gathers the next or previous 'to be focused' component, using the FocusTraversalPolicy of the visible/focusable/enabled container. Then we simply request it's focus. Works w/ Java7 on Linux and Windows.
* Fix Bug 761 (part 1/2): Move GLDrawableFactory.shutdownHook -> ↵Sven Gothel2013-06-231-23/+75
| | | | | | | | | | | | | | | | | | NativeWindowFactory.shutdownHook, the latter handles customShutdownHooks for NativeWindow, JOGL and NEWT. Unifying our shutdown mechanism is required to provide a controlled shutdown sequence. NativeWindowFactory is chosen to be the new central entry point, since it is the lowest denominator (common module). - Move GLDrawableFactory.shutdownHook -> NativeWindowFactory.shutdownHook Reverse the shutdown dependency for clarity and availability to all modules, i.e. NEWT may not know about JOGL. Remove the 'gamma' shutdown hook, instead simply call GLDrawableFactoryImpl.resetDisplayGamma() before destroy. NativeWindowFactory.shutdownHook handles customShutdownHooks for NativeWindow, JOGL and NEWT - Modules can register their shutdown runnable at head or tail of list. - Allows controlled shutdown across all modules.
* X11Util: Fix comment on markAllDisplaysUnclosable semantics, add 'final', ↵Sven Gothel2013-06-231-8/+8
| | | | reorder globalLock/isJVMShuttingDown branch/sync
* AWTGraphicsConfiguration: Allow null capsRequested; NewtCanvasAWT: Avoid NPE ↵Sven Gothel2013-06-151-1/+5
| | | | @ addNotify() w/o newtChild
* Support specifying the X11 default display with a system propertyMaik Riechert2013-06-131-1/+2
| | | | | | | | | Usually, the environment variable DISPLAY is used to define the default display under X11. There are cases where the default display has to be defined or overridden programmatically. For those cases, the new system property nativewindow.x11.display.default can be used (as environment variables can't be changed in Java). Its semantics are identical to the DISPLAY environment variable.