aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
Commit message (Collapse)AuthorAgeFilesLines
* NEWT Display: Issue EDTUtil.start() at runOnEDTIfAvail(..) even if on EDT, ↵Sven Gothel2013-10-097-39/+39
| | | | | | | | | | | | | | | | | which is to be stopped. This case appears on e.g. OSX/CALayer (offscreen) reparenting using recreation (onscreen <-> offscreen), i.e. display destroy/create is performed on EDT. Misc Cleanup: - Rename EDTUtil: restart() -> start() - Rename Display: validateEDT() -> validateEDTStopped() - Simplify Display.setEDTUtil(..): Remove need for redundant 'newEDTUtil' local var. - Simplify Display.runOnEDTIfAvail(..): edtUtil is never null
* NEWT/OSX (Bug 836): Only WindowDriver.initWindow0(..) operation on ↵Sven Gothel2013-10-091-8/+13
| | | | | | main-thread must be synchronized (wait-until-done) - Leave WindowDriver.close0(..) w/o sync
* NEWT/OSX (Bug 836): Lifecycle operations performed on main-thread must be ↵Sven Gothel2013-10-072-38/+48
| | | | | | | | | | | | | synchronized (wait-until-done) Wait-until-done (main thread): - WindowDriver.close0(..) - WindowDriver.initWindow0(..) Otherwise a re-queued operation (i.e. CALayer attachment) will mixup the order .. Experienced w/ fullscreen exit.
* NEWT/Fullscreen (Bug 836): Exit re-parenting fullscreen w/ ↵Sven Gothel2013-10-072-22/+33
| | | | | | | | | | | | | | | [invisible-exit-visible] (-> like reparent); Always force focus; X11: Always use ALWAYSONTOP. - Remove unused 'fullscreenUseSpanningMode' state - Exit re-parenting fullscreen w/ [invisible-exit-visible] (-> like reparent) solves X11 issue, where the NEWT window doesn't 'return to it's parent'. Probably also fixes Bug 836! - Always force focus when enter and exit FS - X11: Always use ALWAYSONTOP No reason to behave different (spanning and normal-fs)
* Bug 816/848: Cleanup test applet layout/size ; Note Bug 848: Not ↵Sven Gothel2013-10-041-3/+3
| | | | reproducible after restart of OSX test machine!
* AWT Printing: releasePrint() issue reshape from AWT-EDT; GLJPanel: Issue ↵Sven Gothel2013-09-281-1/+0
| | | | 'handleReshape' if panelSize/awtSize mismatch, otherwise 'sendReshape' and exception if offscreen size doesn't match panelSize.
* Fix AWT Printing: Use delegated GLDrawable's size for tile-size instead of ↵Sven Gothel2013-09-281-2/+5
| | | | | | | | | AWT-GLAD's size, since the latter uses AWT's component size. .. the AWT component size could have been modified after setupPrinting(..). The AWT-GLAD getWidth() and getHeight() is implemented by AWT's component and hence may not reflect the actual GLDrawable size while printing.
* TileRenderer*: TileRendererNotify -> TileRendererListener w/ clarifying ↵Sven Gothel2013-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | functionality (reshapeTile(..), ..); Only process GLEventListener impl. TileRendererListener; attachToAutoDrawable -> attachAutoDrawable, etc. -TileRendererNotify -> TileRendererListener - Added methods: - void reshapeTile(TileRendererBase tr,int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight); - void startTileRendering(TileRendererBase tr); - void endTileRendering(TileRendererBase tr); allowing to clarify user code and API specification, i.e. TR only processes GLEventListener which impl. TileRendererListener. This also allows simplifying the API doc, while having a more descriptive reshape method focusing solely on tile rendering. Further more, the start/end TR methods allow certain GL related actions while the context is current before and after iterating through the tiles. This is even used for RandomTileRenderer (one tile only), to allow to reuse same TileRendererListener for diff TRs. - Fix language, attach and detach usage was vice versa. We do attach an GLAutoDrawable to a TR - attachToAutoDrawable -> attachAutoDrawable - detachFromAutoDrawable -> detachAutoDrawable - Adapted unit tests.
* Bug 816: Fix OSX CALayer 'quirks' for AWT 1.7.0_40 - See JAWTUtil ↵Sven Gothel2013-09-242-4/+8
| | | | | | | | | 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
* Fix Bug 840: DefaultEDTUtil.restart() shall only reuse ThreadGroup (tg) is ↵Sven Gothel2013-09-221-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | not destroyed, otherwise use current thread's tg. With jdk7u40, when re-launching a NEWT applet (JOGLNewtApplet1Run), i.e. via browser back and forth, the following exception happens: java.lang.RuntimeException: java.lang.IllegalThreadStateException at com.jogamp.newt.awt.applet.JOGLNewtApplet1Run.init(JOGLNewtApplet1Run.java:218) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.IllegalThreadStateException at java.lang.ThreadGroup.addUnstarted(Unknown Source) at java.lang.Thread.init(Unknown Source) at java.lang.Thread.<init>(Unknown Source) at jogamp.newt.DefaultEDTUtil$NEDT.<init>(DefaultEDTUtil.java:280) at jogamp.newt.DefaultEDTUtil.restart(DefaultEDTUtil.java:91) at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:231) at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:1758) at jogamp.newt.WindowImpl.setUndecorated(WindowImpl.java:1477) at com.jogamp.newt.opengl.GLWindow.setUndecorated(GLWindow.java:278) at com.jogamp.newt.awt.applet.JOGLNewtApplet1Run.init(JOGLNewtApplet1Run.java:188) ... 3 more This is due to 7u40's changed ThreadGroup (tg) lifecycle, i.e. the tg is destroyed. In such case, DefaultEDTUtil.restart() shall use the current threads tg.
* AWTTilePainter.setupGraphics2DAndClipBounds(): Use 'Shape getClip()'; Use ↵Sven Gothel2013-09-191-9/+15
| | | | | | | | | | | | | | | | double precicion clip bounds 'all the way'; Explicitly scale image and clip w/ current scaled transform. - Use 'Shape getClip()' Don't assume Rectangle2D, but use Shape's getBounds2D() - Use double precicion clip bounds 'all the way' Remove rounding error on clip bounds w/ start value, which was _not_ using doubles. - Explicitly scale image and clip w/ current scaled transform. Instead of abusing Graphics2D's clip shape to scale image size and clip-area, explicitly use transform both bounding boxes into transformed space, scale space and transform out (inversion). A possible NoninvertibleTransformException will be thrown while Graphics2D has not been modified.
* AWT Printing: Move init-test of setupPrint(..) to AWT-EDT Runnable ; ↵Sven Gothel2013-09-171-23/+27
| | | | GLJPanel: Attempt to initialize if not done yet (similar to GLCanvas)
* Fix AWT printing issues w/ overlapping and/or non-opaque contents ; Change ↵Sven Gothel2013-09-151-37/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ..
* AWTTilePainter: Fix null clip-rect (consider scaling); Fix non GL-oriented ↵Sven Gothel2013-09-131-1/+1
| | | | drawable, skip vertical flip and use 1:1 y-coord.
* AWT Printing: AWTTilePainter needs to handle null clip!Sven Gothel2013-09-101-1/+1
|
* AWTPrintLifecycle: Add DEFAULT_PRINT_TILE_SIZE (512); Remove unused imports.Sven Gothel2013-09-081-2/+1
|
* NewtCanvasAWT: Implement AWTPrintLifecycle and hence support for AWT printing.Sven Gothel2013-09-081-2/+164
| | | | | | | | | Note: Same bug existing as w/ GLCanvas, i.e. 'GLDrawableUtil.swapGLContextAndAllGLEventListener(gladPre, gladNew)': If 'gladPre' is onscreen and using MSAA (on NV/GLX), the ctx cannot be made current in it's new 'gladNew' location. Same workaround applied, i.e. use onscreen drawable while printing.
* Fix Bug 810: Adding Julien Gouesse's fix while moved the new ↵Sven Gothel2013-09-021-19/+13
| | | | 'addNativeJarLibsJoglCfg(..)' to GlueGen, commit c0ead6fa10280f8076704726d59f482b183fd77e
* Animator/GLWindow: Catch 'ThreadDeath/Throwable' and dump info in DEBUG mode ↵Sven Gothel2013-09-021-0/+4
| | | | (cosmetic change only); Typo in comment; TestSharedContextListNEWT2: Stop animator.
* GLWindow: Shorten API-doc referencesSven Gothel2013-08-301-4/+6
|
* MouseEvent API doc: Add W3C PointerEvent ReferenceSven Gothel2013-08-101-0/+3
|
* Remedy for Bug 782: Issue Debug.initSingleton() or Debug.debug(..) before ↵Sven Gothel2013-07-174-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | 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! +++
* Redefine: isGLES3Compatible() and isGL4ES3(), i.e. allow GL4ES3 usage in ↵Sven Gothel2013-07-161-16/+54
| | | | | | | | | case proper ES3_compat is given. isGLES3Compatible() and isGL4ES3() of GLBase _and_ GLContext includes [ GL >= 4.3, GL >= 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]. Tested GL 'aliasing' w/ TestGLProfile01NEWT, i.e. isGL*() and getGL*().
* StringBuffer -> StringBuilderSven Gothel2013-07-152-3/+3
|
* Add Support for GL 4.3 (Bug 716) and ES 3.0 (Bug 717)Sven Gothel2013-07-151-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ES3 / GL4.3: - Update all EGL, GLX, WGL and GL (desktop and mobile) khronos headers to latest version. - GL3/gl3* -> GL/glcorearb* - Explicitly preserve ES2_compatibility and ES3_compatibility in header, most extension grouping was removed in new headers. - Always load all GLHeader to ensure proper extension association across all profiles. - Unified method signatures - Added GL_EXT_map_buffer_range to core - Using common 'glMapBufferImpl(..)' for all glMapBuffer(..) and glMapBufferRange(..) impl. - Init necessary fields of GL instances via 'finalizeInit()' called by reflection, if exist. This allows removing initialization checks, i.e. for all buffer validations. - BuildStaticGLInfo: Can handle new GL header structure, i.e. one CPP extenstion block incl. define + funcs. - GLJavaMethodBindingEmitter: Simply print the - No GL duplication due to new intermediate interfaces, see below - OO lineare inheritance (Added GL2ES3, GL3ES3 and GL4ES3 intemediates): GLBase - GL - GL2ES2 - GLES2 GLBase - GL - GL2ES2 - GL2GL3 - [ GL2, GL3 ] GLBase - GL - GL2ES2 - GL2ES3 - GL3ES3 - [ GL3 ] GLBase - GL - GL2ES2 - GL2ES3 - GL3ES3 - GL4ES3 - [ GLES3, GL4, .. ] - Expose 'usable' intermediate interfaces GL3ES3 and GL4ES3 in GLBase/GLProfile/GLContext via is*() and get*(). - GLContext*: - isGL3core() is true if [ GL4, GL3, GLES3 ] (added GLES3) - Added ctxProfile argument to allow handling ES versions: - getMaxMajor(..), getMaxMinor(..), isValidGLVersion(..) and decrementGLVersion(..) - mapGLVersions(..) prepared for ES ARB/KHR validation - EGLContext checks ES3 (via old ctx's GL_VERSION) - ExtensionAvailabilityCache adds GL_ES_Version_X_Y for ES. - Prelim tests w/ Mesa 9.1.3 GL Version 3.0 (ES profile, ES2 compat, ES3 compat, FBO, hardware) - OpenGL ES 3.0 Mesa 9.1.3 [GL 3.0.0, vendor 9.1.3 (Mesa 9.1.3)] - TODO: - Use KHR_create_context in EGLContext.createContextARBImpl(..) - More tests (Mobile, ..) +++ Misc: - GLContext*: - Complete glAllocateMemoryNV w/ glFreeMemoryNV.
* NEWT EDTUtil: Exposed weakness of EDTUtil usage due to usage of ↵Sven Gothel2013-07-0916-262/+367
| | | | | | | | | | | | | | | | | | | | | WeakReference, i.e. higher retention of Display instances. - WeakReference Change 99479bf3197cde8e89c5b499d135417863d521c7 - Refines commits: feb352145af1643a57eaae99c0342e6f5e0f2a2e dec4b02fe4b93028c85de6a56b6af79601042d6e 433e3914324b90c910b018bb7d9d80e814c67123 Reviews EDTUtil API and usage: - less confusing / more determined EDTUtil API - EDTUtil's thread shall only be reset and started when required (-> lazy) - EDTUtil's instance in Display shall be handled thread safe w/o extra blocking - EDTUtil's implementations (Default, SWT and AWT) shall be aligned / similar as much as possible Further note: SWT's EDTUtil (NewtCanvasSWT) shall not use a reused Display instance due to it's custom SWTEDTUtil. We may need to disable the ref. cache if custom EDTUtil (setEDTUtil) is intended (used).
* Fix SWTEDTUtil regression caused by ↵Sven Gothel2013-07-055-39/+67
| | | | | | | | | | | | dec4b02fe4b93028c85de6a56b6af79601042d6e, ensuring EDT is running for reused Display instances. Refine EDTUtil semantics of: - reset() - waitUntilStopped() AWTEDTUtil/SWTEDTUtil: Properly signal !running when shutdown SWTEDTUtil: Take SWT isDisposed() into account.
* NEWT Display.create: If reusing an existing instance, ensure EDT is running!Sven Gothel2013-07-051-4/+5
|
* GLWindow.shutdownRenderingAction: If on anim thread, simply stop ourselves ↵Sven Gothel2013-07-051-10/+15
| | | | (non-blocking)
* NEWT WindowImpl: Add little GCed / windowList-size stats at addWindow2ListSven Gothel2013-07-041-1/+5
|
* DefaultEDTUtil: If EDT is not started and task is null and wait intended, ↵Sven Gothel2013-07-041-1/+4
| | | | use nullTask ensuring to wait until EDT started.
* Fix NPE - Regression of commit 99479bf3197cde8e89c5b499d135417863d521c7Sven Gothel2013-07-041-1/+3
|
* NEWT: Using WeakReferences for global cache of Display, Screen and Window ↵Sven Gothel2013-07-045-80/+164
| | | | | | | | | | | | | instances; Removing ref. at API destroy() is wrong ; Allow GC to clear .. - Removing ref. at API destroy() is wrong - Since all instances can be recreated, removing ref at destroy() is simply wrong. - Keep weak references until GC collects, i.e. user does not claim them anymore. - Safe for Display, since it holds it's EDT thread. - Window/Screen .. if user abandons reference .. nothing we can do here. - Allow GC to clear .. No need to hold ref loonger than user.
* X11Window FullScreen: Toggle _NET_WM_BYPASS_COMPOSITOR not only for ABOVE .. ↵Sven Gothel2013-07-041-2/+2
| | | | but also for FULLSCREEN WM state.
* Revisit Bug 770 and Bug 771: Only use FLAG_IS_FULLSCREEN_SPAN if required; ↵Sven Gothel2013-07-047-82/+135
| | | | | | | | | | | | | At MonitoMode change, reset fullscreen if FLAG_IS_FULLSCREEN_SPAN is supported. - Bug 770: Only use FLAG_IS_FULLSCREEN_SPAN if required - If X11 WindowDriver _and_ virtual-screen-size > fullscreenViewport, - else we still use _NET_WM_STATE_FULLSCREEN on X11! - Bug 771: At MonitoMode change, reset fullscreen if FLAG_IS_FULLSCREEN_SPAN is supported - Since we may still use _NET_WM_STATE_FULLSCREEN on X11: - Pause fullscreen at monitorModeChangeNotify(..) - Resume fullscreen at monitorModeChanged(..)
* Remove deprecated methods.Sven Gothel2013-07-041-27/+0
| | | | | | | | | - Quaternion.isEmpty() - Texture.dispose(GL) - GLContext.getGLVersionMajor() / ..Minor() - GLContextImpl.bindPbufferToTexture() / releasePbufferFromTexture() - MouseEvent.getWheelRotation() -
* Revise commit 4c34f5980bddcdc84b10cb3bcbb96b365b9d471e (Bug 767): TAB, BS ↵Sven Gothel2013-07-032-13/+20
| | | | | | | | | and CR/ENTER are printable for NEWT KeyEvent and font handling. Fix regression. - Original behavior was treating CR/ENTER them as printable, lets keep it this way. - KeyEvent: Query these 3 whitespaces upfront, no need to incl. them in 'nonPrintableKeys'. - Fix regression: Native VK_ENTER was not change in commit 4c34f5980bddcdc84b10cb3bcbb96b365b9d471e.
* WindowImpl.consumeKeyEvent: Reduce DEBUG println and show println after ↵Sven Gothel2013-07-032-8/+10
| | | | propagating event to show whether it has been consumed.
* Fix Bug 767: TAB + BS are considered 'printable' - Compromise of 'editor' ↵Sven Gothel2013-07-021-9/+14
| | | | view and 'font-definition' view. ENTER not. Fix ENTER code: 0xa -> 0xd !
* Fix Bug 768 / NEWT Windows: Use layout dependent keySymbol, if independent ↵Sven Gothel2013-07-021-0/+3
| | | | keyCode is 0.
* Fix Bug 770 and 771Sven Gothel2013-07-023-140/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug 770: X11Window.c: - Request focus _before_ enabling EWMH flags (fullscreen or above) after resize and temporary invisibility. This actually allows us to keep the focus after resize and repositioning! - Set _NET_WM_BYPASS_COMPOSITOR implicit analog to _NET_WM_STATE_FLAG_ABOVE - Clean up _NET_WM_* flag names, avoiding name space collisions, i.e. adding FLAG! - Remove dead _NET_WM_STATE setting via direct window property (not working anyways) - Remove dead code: FS_GRAB_KEYBOARD X11/WindowDriver.java: - Enable _NET_WM_STATE_FLAG_ABOVE temporarily if FLAG_IS_FULLSCREEN && !FLAG_IS_ALWAYSONTOP - Override focusChanged(..) to react on focus lost/gained in case of temporarily enabled _NET_WM_STATE_FLAG_ABOVE. If focus is lost, disable _NET_WM_STATE_FLAG_ABOVE, otherwise re-enable it. WindowImpl.java: - FullscreenAction.run: Always use 'FLAG_IS_FULLSCREEN_SPAN' +++ Bug 771: WindowImpl.java: - Keep fullscreenMonitors and fullscreenUseMainMonitor values intact, allowing them to be tracked. Remove duplicates in FullscreenAction class. - MonitorModeListenerImpl.monitorModeChanged: Add fullscreen path: If the changed monitor is part of fullscreenMonitors, recalculate the viewport union and reset position and fullscreen-size. - MonitorModeListenerImpl: Try to regain focus after successful mode change.
* MonitorDeviceImpl: No need to nanoTime() ..Sven Gothel2013-06-301-6/+6
|
* ScreenImpl: Fix ScreenMonitorState add/remove reference, which shall only ↵Sven Gothel2013-06-301-13/+11
| | | | | | | happen at actual native create and destroy. .. otherwise usage of Screen.createNative() and a later Window creation would cause the ScreenMonitorState having 2 added listener - which in turn disables it's orig mode reset at Screen destruction.
* NEWT Screen ..: Typos / JNI signatureSven Gothel2013-06-302-2/+2
|
* X11 RandR: Cleanup RandR impl. selection, RandR13 setMode does not require a ↵Sven Gothel2013-06-304-26/+35
| | | | temp. display connection!
* NewtCanvasAWT: Add missing println if(DEBUG) decorationSven Gothel2013-06-301-1/+3
|
* Add Comparable<?>: Point*, Dimension*, Rectangle*, SurfaceSize* and ↵Sven Gothel2013-06-305-11/+131
| | | | | | | | | | | 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.
* NEWT WindowImpl/GLWindow: @ JVM Shutdown, force stop animation thread w/o ↵Sven Gothel2013-06-252-3/+34
| | | | blocking.
* NEWT: EDTUtil.invokeStop(..) gets 'wait' argument, allowing non-blocking ↵Sven Gothel2013-06-255-14/+30
| | | | shutdown. DisplayImpl.shutdownAll(): Don't block.
* NEWT: Don't invoke external keyboardFocusHandler for auto-repeat keys ↵Sven Gothel2013-06-242-4/+8
| | | | | | (NewtCanvasAWT, ..) .. otherwise an auto repeated key would cause fast focus traversal, not intended.