aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow
Commit message (Collapse)AuthorAgeFilesLines
* TextureIO: Support PNGTextureWriter w/ TextureData IntBuffer (via ↵Sven Gothel2014-02-131-2/+1
| | | | | | | | | | | | | | | PNGPixelRect and PixelFormatUtil) TextureData IntBuffer could be caused by AWT read-pixels but is not seamlessly supported via PNGPixelRect since the latter uses a hardcoded ByteBuffer. Add static PNGPixelRect.write(..) supporting IntBuffer to support this case for now. PNGPixelRect instances do not support any Buffer type to avoid a bloated implementation. PixelFormatUtil adds support for int32 pixel format conversion.
* Bug 973: NativeWindowFactory: Needs service provider interface (SPI) for TK ↵Sven Gothel2014-02-121-2/+2
| | | | specific implementations (Scaling)
* Bug 973: NativeWindowFactory: Needs service provider interface (SPI) for TK ↵Sven Gothel2014-02-121-4/+19
| | | | | | specific implementations (Scaling) Add FIXME note ..
* NativeWindowFactory.createWrappedWindow [WrappedWindow]: Using ↵Sven Gothel2014-01-313-11/+57
| | | | UpstreamSurfaceHookMutableSizePos to take position into account; WrappedWindow: invalidate and destroy - display device could be opened.
* Add NativeWindowFactory.getLocationOnScreen(NativeWindow nw) to retrieve the ↵Sven Gothel2014-01-311-0/+19
| | | | NativeWindow location on screen
* NativeWindowFactory: Add Support for creating a platform agnostic wrapped ↵Sven Gothel2014-01-303-0/+149
| | | | AbstractGraphicsDevice/NativeWindow
* Bug 952 - JAWTWindow.JAWTComponentListener's ctor() and detach() may ↵Sven Gothel2014-01-271-10/+21
| | | | | | | | | | | | | deadlock due to AWTTreeLock acquisition while add/remove AWT listener The AWTTreeLock is acquired by Component.removeHierarchyListener and as for _every_ AWT component, modifications shall happen on the AWT-EDT. IMHO the user shall offload AWT modifications to the AWT-EDT similar to what JOGL's GLCanvas and NEWTCanvasAWT does. However, since JAWTWindow also represents a NativeWindow instance we shall offload AWTTreeLock methods ourselves!
* Bug 948 - NVIDIA 331.38 (Linux X11) EGL impl. only supports _one_ EGL ↵Sven Gothel2014-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Display via eglGetDisplay(..) NVIDIA 331.38 (Linux X11) EGL impl. only supports _one_ EGL Display via eglGetDisplay. - Subsequent eglGetDisplay(..) calls fail. - Using the same 'global' egl-display does work though Remedy: Add 'GLRendererQuirks.SingletonEGLDisplayOnly' Detection of quirk is done as usual in GLContextImpl.setRendererQuirks(..), and EGLDrawableFactory passes the quirk, if detected, down to EGLDisplayUtil. The latter implements the singleton eglDisplay handle. EGLDisplayUtil: Cleaned up .. - EGLDisplayRef employs the reference handling incl. eglInitialize(..) and eglTerminate(), as well as the new singleton quirk. - Mark all internal methods 'private', to remove possible [untested] sideffects.
* EGLDisplayUtil.eglCreateEGLGraphicsDevice(..): Don't open() device implicit; ↵Sven Gothel2014-01-231-0/+12
| | | | EGLDrawableFactory.mapAvailableEGLESConfig(..): Clarify
* JAWTWindow DEBUG: Dump all JAVA_VERSION* informationSven Gothel2014-01-141-0/+3
|
* OSXMisc CALayer::FixCALayerLayout: Fix visible:=false case, i.e. don'r ↵Sven Gothel2014-01-131-5/+12
| | | | override cached visibleOpacity w/ forced zero when called twice
* JAWTWindow.JAWTComponentListener: Minor CleanupSven Gothel2014-01-131-5/+5
|
* Bug 937 - JAWTWindow: Unsatisfying Visibility ComputationSven Gothel2014-01-121-56/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Simplify JAWTComponentListener's HierarchyListener: - Don't interfere w/ Component's visibility anymore! This shall reduce sideeffects. Utilize 'isShowing' in each Component specialization, i.e. GLCanvas. - On SHOWING_CHANGED if a parent caused a change of the tracked components showing state, propagate it to the offscreen-layer! - Remove all other complicated states! GLCanvas, GLJPanel: - Instead of 'isVisible()' use 'showing state', since only the 'showing state' reflects 'true' visibility throughout the hierarchy. - Add HierarchyListener and track volatile showing state to be used instead of 'isVisible'. Using a cached showing state is more efficient than quering 'isShowing()' all the time! NewtCanvasAWT: - Use 'isShowing()' instead of 'isVisible(), see above
* Misc Cleanup: JAWTWindow: Reusing visible in HIERARCHY listener; Remove ↵Sven Gothel2014-01-112-20/+13
| | | | obsolete 'getPrivateGraphicsConfiguration()'
* [Jogl|Nativewindow|Newt]Common: Align all ↵Sven Gothel2014-01-115-138/+195
| | | | | | | | | | | *Common_GetJNIEnv()/_ReleaseJNIEnv() Methods and Usage / Check arguments .. Since we still don't use inter-module native code sharing, align the JNIEnv get/release methods and usage. Most beneficary here is OSX and the GLDebugMessageHandle, both managed the JVM handle on their own - removed now. Also ensuring that *Common_init(..) is called for all modules on all platforms.
* X11: Harden usage of 'XGetWindowProperty(..)' and 'XGetVisualInfo' - Add ↵Sven Gothel2014-01-111-19/+17
| | | | missing XFree(..) calls and argument checks.
* PixelRectangle.GenericPixelRect: hashCode() impl. didn't set volatile ↵Sven Gothel2014-01-091-0/+1
| | | | hashCodeComputed := true (always re-computes hash code - duh!)
* Bug 935: NEWT PointerIcon: Utilize Toolkit Agnostic PixelFormat and ↵Sven Gothel2014-01-083-29/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conversion Utilities (Allowing 'arbitrary' PointerIcon data input) Commit fe28bc125429b38cdcd016746081f4a6d521c6fd added the notion of toolkit agnostic PixelFormat and conversion utilities, utilized and further tested by this patch. +++ - PointerIcon is a PixelRectangle and hence holds the decoded data. This allows on-the-fly conversion if required as well as recreation w/o PNG re-decoding. - Using array-backed PointerIcon data where possible, allowing better performance when converting PixelFormat etc. - NEWT Display adds 'createPointerIcon(final IOUtil.ClassResources pngResource...' method to support agnostic PointerIcon creation. - NEWT Display adds methods to allow users to avoid PixelFormat and Buffer NIO type forced conversion: - PixelFormat getNativePointerIconPixelFormat() - boolean getNativePointerIconForceDirectNIO() +++ PNGImage -> PNGPixelRect Deleted: com.jogamp.opengl.util.texture.spi.PNGImage Added: com.jogamp.opengl.util.PNGPixelRect (We hope nobody was using PNGImage directly since it was a service-plugin for TextureIO) PNGPixelRect is a PixelRectangle PNGPixelRect actually is implemented OpenGL agnostic, however - since our PNGJ support lives under package 'jogamp.opengl.util.pngj' it cannot be moved up (yet). PNGPixelRect now handles all PixelFormat for the target format and also added support for grayscale+alpha (2 channels). The latter is force-converted to RGB* - similar to paletted. Further more, PNGPixelRect allows simply passing an OutputStream to write the PNG data. Used by: TextureIO and NEWT +++ - OffscreenSurfaceLayer's setCursor(..) uses the agnostic PixelRectangle instead of a PNG resource. - AWTMisc uses the PixelRectangle to produce the AWT Cursor and converts it to the required format. Hence same pixels are used for NEWT and AWT pointer/cursor icon. - TestGearsES2Newt and NewtAWTReparentingKeyAdapter 'tests' iterate over 3 custom PointerIcon when pressed 'c'. - JOGLNewtAppletBase uses the new custom PointerIcon 'newt/data/crosshair-lumina-trans-32x32.png', which is included in NEWT (213 bytes only). -
* Bug 935: NEWT PointerIcon: Add Toolkit Agnostic PixelFormat and Conversion ↵Sven Gothel2014-01-083-0/+763
| | | | | | | | | | Utilities (Allowing 'arbitrary' PointerIcon data input) To allowing 'arbitrary' PointerIcon data input, i.e. via raw pixels we need to define an agnostic PixelFormat and required conversion utilities. The latter is not hw accelereated (toolkit agnostic), but this shall be expected and satisfying for small amount of 'pixels'.
* Bug 935: NEWT PointerIcon/Visibility: Perform JAWTWindow's ↵Sven Gothel2014-01-052-18/+26
| | | | | | | OffscreenLayerSurface PointerIcon/Visibility tasks async on AWT-EDT setCursor(..) and hideCursor(..) must happen on the AWT-EDT w/o blocking, otherwise we may deadlock the NEWT-EDT.
* NativewindowCommon_init: Add define STDERR_TO_FILE (default undefined) to ↵Sven Gothel2014-01-051-0/+7
| | | | redirect stderr to file jogamp_stderr.log (Useful for Applets)
* Bug 935: NEWT Windows Window-Icon: Use WNDCLASSEX w/ Small/Big Default Icons ↵Sven Gothel2014-01-053-9/+19
| | | | | | | | (NativeWindow GDI / NEWT ) .. this allows using the icon definition of WNDCLASSEX instead of setting them at CreateWindow0(..). - NativeWindow GDIUtil/RegisteredFactory uses WNDCLASSEX and Small/Big Defailt Icons
* Bug 935: NEWT OSX PointerIcon/Pointer-Visibility: Impl. ↵Sven Gothel2014-01-043-0/+85
| | | | | | | | | | OffscreenLayerSurface (OSX CALayer) w/ JAWTWindow Path Add setCursor(..) and hideCursor() to OffscreenLayerSurface interface, impl. in JAWTWindow w/ AWT. This allows an OSX NEWT Window using CALayer (i.e. NewtCanvasAWT) to have setPointerIcon(..) and setPointerVisible(..) functionality!
* Bug 934, Bug 935: NEWT: Add support for custom Application/Window and ↵Sven Gothel2013-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Pointer Icons - Utilizing JOGL's PNG decoder for all icons, if available. - Application/window icons: - Providing default application/window icons in 16x16 and 32x32 size - NewtFactory.setWindowIcons(..) or property 'newt.window.icons' maybe used to override default icons. - Using icons at application/window instantiation - Display.PointerIcons: - NativeWindow Win32 WindowClass no more references a default cursor in favor of fine grained cursor control [in NEWT] - Display provides create/destroy methods, where display destruction also releases open PointerIcon references. - Window.setPointerIcon(..) sets custom PointerIcon - Implemented Platforms - X11 - Windows - OSX - Manual Test: TestGearsES2NEWT (Press 'c')
* Bug 928 - JAWTWindow's JAWTComponentListener _not_ attached and original ↵Sven Gothel2013-12-181-8/+14
| | | | | | | | | | | | | | | | | | visibility state not restored @ detach Commit ebed9f0322e2a2279a525e04ee3875c9034a7f45 (fix for Bug 906) causes a regression to fix for Bug 816, Bug 849 and Bug 889 (OSX CALayer Positioning and JAWTWindow visibility). The commit adds the JAWTComponentListener instance 'jawtComponentListener' to the component before it's assignment (duh!). +++ Further more, detaching the JAWTComponentListener shall restore the component's original 'local visibility state', which might got overridden by it's 'hierarchyChanged' implementation. +++
* Bug 907 - Refine DummyDispatchThread (DDT) Handling: Proper OO integration ↵Sven Gothel2013-11-296-174/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | in RegisteredClass; Safe DDT Post/WaitForReady handling and error cases ; ... Proper OO integration of DDT in RegisteredClass - DDT is optional to RegisteredClass[Factory], i.e. NEWT without DDT and DummyWindow with DDT. - Using native type DummyThreadContext per DDT passed as DDT handle to java referenced in RegisteredClass - Passing DDT handle to related native methods, if not null use DDT - otherwise work on current thread. The latter impacts CreateDummyWindow0 and DestroyWindow0. Safe DDT Post/WaitForReady handling and error cases ; ... - Wait until command it complete using a 3s timeout - Terminate thread if errors occur and throw an exception +++ Discussion: DDT Native Implementation Due to original code, the DDT is implemented in native code. Usually we should favor running the DDT from a java thread. However, since it's main purpose is _not_ to interact w/ java and the native implementation has less footprint (performance and memory) we shall be OK w/ it for now - as long the implementation IS SAFE.
* Bug 907 - Fix regression of 'cleanup' Commit ↵Sven Gothel2013-11-281-0/+1
| | | | 52c95c19dbd69a7fc6b307d2b2db357ceb43ddf5
* Bug 907 - Cleanup Commit e9c711a86aa05f4f24c69972532833f5a98911a3Sven Gothel2013-11-282-128/+125
| | | | | | | | | | | | | | | | | | | | | | | | Cleanup Commit e9c711a86aa05f4f24c69972532833f5a98911a3: - Fix while loop in SendCloseMessage (native) - static 'threadid' must be volatile - Whitespace - Redundancy - CreateDummyWindow - Scope (java, move JNI funcs back to private) - Remove [invalid] pointer usage (native) - ThreadParam's threadReady and hWndPtr shall not be pointers - invalid - No need to use a threadReady pointer. - Validate threadid (native) TODO: - Make 'native dispatch thread' optional - Store 'native dispatch thread' in window class
* Bug 907 - Initial patch allowing Jogl to respond to other applications that ↵Randolf Schultz2013-11-282-14/+194
| | | | try to retrieve window names
* Bug 672 (NewtCanvasSWT): Reuse SWTAccessor.isOS_TYPE ; Impl ↵Sven Gothel2013-11-251-4/+4
| | | | | | | | | | | | | | | | | | | | | NW.getLocationOnScreen(..) for X11 and Windows ; Allow unit test to run on all platforms. - Reuse SWTAccessor.isOS_TYPE (public now) - Impl NW.getLocationOnScreen(..) for X11 and Windows reusing existing native code - Allow unit test to run on all platforms. Note: NewtCanvasSWT unit tests require a 'wait for realized' while SWT dispatching. Otherwise the 'sash unit test' will fail since realiziation happens later, at least on X11. Hence extended AWTRobotUtil.waitForRealized(..) to use a 'waitAction' which is used here w/ special SWT dispatch Runnable. AWTRobotUtil.waitForRealized(..) operates on time-delta instead of iteration-counter, allowing above 'waitAction' Runnable. AWTRobotUtil.waitForRealized(..) removed 2nd 'glad.isRealized()' loop ..
* AWTWindowClosingProtocol: Hold Window reference impl. is listening to to ↵Sven Gothel2013-11-231-17/+14
| | | | properly removeClosingListener() (and replace boolean state)
* 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
|