aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax
Commit message (Collapse)AuthorAgeFilesLines
* JOGL CapabilitiesChooser-API and impl.: Cleanup using generics: 'List l' -> ↵Sven Gothel2012-06-212-7/+14
| | | | 'List<? extends CapabilitiesImmutable> l'
* Clarify API Doc: GLRunnable and it's GLAutoDrawable::invoke(..)Sven Gothel2012-05-152-16/+25
|
* Fix Bug 572: AWT-GLCanvas shall force setRealized(true) on AWT-EDT avoiding ↵Sven Gothel2012-05-141-3/+8
| | | | AWTTree deadlock
* GLContext*: Remove '[set/is]Synchronized(..)' - Defaults to wait for locks: ↵Sven Gothel2012-05-133-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | 1. Drawable, 2. GLContext Remove deadlock situation where thread-1 (Animator Thread) holds the GLContext-Lock and acquires the Surface-Lock, while thread-2 (UI/Main/EDT) holds the Surface-Lock and attempts to create the GLContext and hence acquires the GLContext-Lock. A GLContext-Lock and hence makeing the GLContext current requires to hold the Surface-Lock. The prev. code acquired the locks in reverse order and allowed the deadlock as described above. This fix acquires the locks in the proper natural order 1 - Surface-Lock 2 - GLContext-Lock This fix also renders the use of the non-synchronized behavior invalid, since it is bogus not to wait for the GLContext lock where it waits for the Surface lock. It also seems nonsense not to wait for any of both locks and our code always waited for both (synchronized := true). The GLContext [set/is]Synchronized(..) methods are removed and waiting for the lock per default is the correct behavior.
* NEWT API Change 'WindowClosingProtocol': Use 'enum WindowClosingMode' ↵Sven Gothel2012-05-022-4/+6
| | | | instead of static final int values.
* GLProfile/EGLDrawableFactory: Detect ANGLE (Windows D3D ES2 Emulation) and ↵Sven Gothel2012-05-011-6/+29
| | | | | | | | | | | | | disable support per default. We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome. When run in the mentioned browsers, the eglInitialize(..) implementation crashes. This behavior can be overridden by explicitly enabling ANGLE on Windows by setting the property 'jogl.enable.ANGLE'. EGLDrawableFactory: - destroy(): clear references and unregister factory, maybe triggered by GLProfile (ANGLE case) - getAvailableCapabilitiesImpl(): return empty list in case EGL/ES is n/a (ANGLE case)
* StringBuffer -> StringBuilder (Local objects, no concurrency) ; Impacts: ↵Sven Gothel2012-04-164-7/+7
| | | | Capabilities/GLContext API 'toString(StringBuilder)'
* Refine API docSven Gothel2012-04-112-10/+12
|
* GLArrayData: Fix 'growBuffer()' / clarify 'initialSize' -> 'initialElementCount'Sven Gothel2012-04-111-2/+5
| | | | | - growBuffer() was using '(osize+additional) * components' -> 'osize + (additional * components )' - added jogl.debug.GLArrayData - notifying growBuffer()
* GLContext: Don't enable TRACE_SWITCH if DEBUG is enabled.Sven Gothel2012-04-031-1/+1
|
* Enhance and generalize AWT Threading* implementation; Minor changes ..Sven Gothel2012-03-254-256/+183
| | | | | | | | | | | | | | | | | | | | | | | | | Threading*: - add invoke(..) generalizing the Therading decision GLCanvas: - remove 'manual' Threading decision, simply call Threading.invoke(..) - use anonymous Runnable instances - remove drawable lock, drawable is volatile instead GLJPanel: - remove 'manual' Threading decision, simply call Threading.invoke(..) - use anonymous Runnable instances - DEBUG: Use getThreadName() prefix GLContextImpl: - Remove GLWorkerThread idle command on makeCurrent(), no holding of context in worker thread while idle. - DEBUG: Use getThreadName() prefix X11GLXContext: - DEBUG: Use getThreadName() prefix TODO: Validate whether it's OK for GLCanvas and GLJPanel to set Threading.Mode.MT as the default mode!
* Cleanup: Use getThreadName() and validateCurrent() to remove redundancy and ↵Sven Gothel2012-03-202-43/+35
| | | | to add thread-name info; GLWorkerThread: Use ArrayList and generics.
* Fix / Cleanup AWT related Threading code: Using enums, properly disable ↵Sven Gothel2012-03-191-8/+8
| | | | singlethreading if requested, fix doc: -Dopengl.1thread -> -Djogl.1thread
* Reduce Thread.dumpStack() in debug mode where no negative behavior appears ↵Sven Gothel2012-03-182-2/+1
| | | | or a stack trace may be helpful.
* Adapt to gluegen Properties/Security commits ↵Sven Gothel2012-03-135-27/+13
| | | | f4ac27e177f6deb444280d3b375e7d343e38bd080 and eedb4b530fb83fc59a26962bcf7847a1404092a0
* GL/GLContext: Properly define swapInterval incl. default value for EGL (1) ↵Sven Gothel2012-03-101-5/+44
| | | | | | and desktop (undefined). *GLContext.setSwapIntervalImpl: Simple return success, set state in GLContext.
* Minor changes: DefaultGLCapabilitiesChooser + GearsES1/2 and Android demosSven Gothel2012-03-101-14/+15
| | | | | | | | | | DefaultGLCapabilitiesChooser: Move 'static' values to final static. GearsES1/2: Handle width>=height case -> flip frustum. Android: Enable fps trace dump after visibility, use default RGBA_8888, Explicitly don't use swapInterval (-1). NEWTGearsES2TransActivity: Gather Screen size and set demo view 2/3 of it.
* NativeWindow public-spec to public-impl reorg ↵Sven Gothel2012-03-062-6/+6
| | | | (javax.media.nativewindow.<impl> -> com.jogamp.nativewindow.<impl>) 2/3
* NEWT/GLWindow.display(): No explicit surface locking/unlocking for ↵Sven Gothel2012-03-041-3/+14
| | | | | | | | | | GLDrawableHelper.invokeGL(..) - it's done implicit at makeCurrent()/release() The explicit locking takes away the locking result, eg. SURFACE_CHANGED, which is required to update the delegated drawable handles (e.g.: EGL surface handle). With the followup fix of EGLDrawable.updateHandle()'s recreate EGL surface, an EGL 'wrapper' can work on Windows (eg. ANGLE).
* X11/GLX: Query X Server whether GLX is available (X11/SharedResourceRunner) ↵Sven Gothel2012-02-252-12/+11
| | | | | | | | | | | | ; Minor cleanups. Before gathering GLX details and actually instantiate a X11/GLX shared resource, we shall query whether GLX is actually available. Since GLX availability is being queried on the server side, more changes are required for the X11GLX* impl, eg. not using X11GLXGraphicsConfigurationFactory and fall back to X11GraphicsConfigurationFactory.
* Fix GLProfile/GLDrawableFactory bug: Recursion on default desktop device, ↵Sven Gothel2012-02-252-18/+55
| | | | | | | | | | | | | | since no profile was mapped. GLDrawableFactory*: - Initialize defaultDevice, even if impl. is not available (no GL libraries for impl.), hence - getDefaultDevice() always returns a valid device - getIsDeviceCompatible() only returns 'true' if device is supported _and_ drawable factory is functional GLProfile: - default-desktop-device becomes default-device even if the desktop-factory itself is not functional. This is due to the fact that the subsequent EGL-factory always handles desktop-devices (X11->EGL, GDI->EGL, etc).
* Add GLProfile.getGL2GL3() meta profile getter completing getGL2ES[12]()Sven Gothel2012-02-241-0/+32
|
* Enhance GLProfile's profile tests - compare the final String references, ↵Sven Gothel2012-02-231-19/+19
| | | | | | | | | instead of String comparison. GLProfile's 'profile' string reference is final and one of the static final GL* string references, with which it is compared. Hence only the references can be used here. Impact: Performance.
* Fix GLProfile.isGL2ES2(): "isGL2() || isGL3()" -> "isGL2GL3()"Sven Gothel2012-02-231-14/+14
| | | | .. was excluding: GL2GL3 common profile.
* DEBUG Output: More thread-names to drawable/context lifecycle; Remove ↵Sven Gothel2012-02-223-9/+9
| | | | massive '!!!' occurence
* Minor GL/GLContext additions / cleanups (GL_BGRA, isNPOTTextureAvailable())Sven Gothel2012-02-222-3/+14
| | | | | | | | - Subsume GL_EXT_texture_format_BGRA8888 -> GL, Added GLContext.isTextureFormatBGRA8888Available() - Movied generic isNPOTTextureAvailable() from GL -> GLContext, used by GL (desktop), added simplified impl. in GLES1/GLES2 (false/true)
* API Change [GLProfile/GLContext]: Add notion of hardware acceleration in ↵Sven Gothel2012-02-202-97/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | GLProfile.get<Profile>() methods. We need to distinguish between software and hardware accelerated OpenGL profiles to allow choosing the proper profiles [default, GL2ES1, GL2ES2, ..] on platforms where both, software and hardware implementations exist (GL, GLES2, ..). Where no preference is being requested, hardware acceleration is favored: GLProfile.getDefault() GLProfile.getGL2ES1() GLProfile.getGL2ES2() Some method signatures needed to change GLProfile: getMaxProgrammable(AbstractGraphicsDevice device) -> getMaxProgrammable(AbstractGraphicsDevice device, boolean favorHardwareRasterizer) GLProfile adds: isHardwareRasterizer() Determination whether a hardware acceleration is being used or not is extended in GLContextImpl by querying the current context's GL_RENDERER string. If the latter contains 'software' (case insensitive) it is not hardware accelerated. At least this works w/ newer Mesa3D impl, where GLX_SLOW_CONFIG is not set!
* Fix ExtensionAvailabilityCache ; Enhance caching.Sven Gothel2012-02-142-37/+33
| | | | | | | | | | | | | | | | | | | ExtensionAvailabilityCache regression / enhancement: - Set context version (w/o string) before caching. This is required since we query the ctx version. Regression from 4011e70eed8c88aee0fcd051a50ab3f15bb94f68 - Remove GLContextImpl state. Only use the passed value at initialization. - Defined initialization, due to the 'new' cache/instantiation logic Remove redundant GLContext profile bits: - CTX_OPTION_ANY: implicit if !CTX_OPTION_FORWARD - CTX_IMPL_ACCEL_HARD: implicit if !CTX_IMPL_ACCEL_SOFT Cache key (ProcAddressTable, Extensions): - Mask out GLContext.CTX_OPTION_DEBUG | GLContext.CTX_IMPL_ES2_COMPAT, since they don't influence the cached values.
* Enhance ExtensionAvailabilityCache ; Expose extension count in GLContext ↵Sven Gothel2012-02-131-20/+52
| | | | | | | | | | | | | | (and clean up) - GLContext - Expose isFunctionAvailable(), isExtensionAvailable(), getPlatformExtensionCount(), getGLExtensionCount() - sort methods a bit ExtensionAvailabilityCache: - Favor StringBuilder instead of StringBuffer (faster) - Resuse set's - Hold dedicated counts of extensions, platform and GL
* OpenGL ES/EGL OverhaulSven Gothel2012-02-136-206/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - GLProfile properly detects native EGL/ES1/ES2 on the 'desktop' device factory. This allows usage of Mesa's EGL/ES or Imageon's PVR emulation, etc. - GLProfile drops getDefaultDesktopDevice() and getDefaultEGLDevice() since both are aligned by getDefaultDevice(). - Fix GL_ARB_ES2_compatibility detection and utilize resulting isGLES2Compatible() where possible. This allows ES2 compatible desktop profiles to use core ES2 functionality (glShaderBinary() .. etc) even with a GL2ES2 desktop implementation. - EGLDrawable: If createSurface(..) fails (BAD_NATIVE_WINDOW) w/ surfaceHandle it uses windowHandle if available and differs. This allows the ANGLE impl. to work. - Properly order of EGL/ES library lookup: ES2: libGLESv2.so.2, libGLESv2.so, GLES20, GLESv2_CM EGL: libEGL.so.1, libEGL.so, EGL - *DynamicLookupHelper reference will be null if it's library is not complete (all tool libs, all glue libs and a ProcAddressFunc lookup function - if named). - Enhance GL version string (incl. ES2 compatible, hw/sw, ..) - GLBase: Fix docs and remove redundancies - Prepared (disabled) DesktopES2DynamicLibraryBundleInfo to be used for a real EGL/ES2 implementation within the desktop GL lib (AMD). Sadly it currenly crashed within eglGetDisplay(EGL_DEFAULT_DISPLAY), hence it's disabled.
* OSX Fix: Catch releaseImpl's glFinish() exception (DebugGL); Make ↵Sven Gothel2012-01-131-1/+6
| | | | | | | | | | | | | | GLContext.release's setCurrent(null) exception prone. Catch releaseImpl's glFinish() exception (DebugGL) glGetError() after glFinish() (eg. w/ debug pipeline) produced unknown error 0x0506 on OS X (10.7.2 NV). Make GLContext.release's setCurrent(null) exception prone Call setCurrent(null) in finalizer block to ensure it's 'released' out of the TLS even when an exception is being thrown. Make MacOSX Shared Resources 'destroy' more error prone (catch exceptions)
* SWT GLCanvas: Adapt to latest JOGL changes (init, destroy, ..), Align main() ↵Sven Gothel2012-01-091-3/+3
| | | | | | entry w/ AWT GLCanvas functionality. -
* minor editsSven Gothel2012-01-091-2/+0
|
* GLContext/NativeSurface Impl's toString(): Add lock.toString()Sven Gothel2012-01-081-1/+8
|
* GLContext*/GLDrawableHelper: Fix consistency of recursive ↵Sven Gothel2012-01-083-80/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | makeCurrent()/release()/destroy() calls ; Enable context switch tracing ; GLCanvas: proper AbstractGraphicsDevice destruction GLContext*/GLDrawableHelper: Fix consistency of recursive makeCurrent()/release()/destroy() calls Utilizing volatile and lock.tryLock(0) for lockConsiderFailFast(), reducing redundant synchronization and using RecursiveLock implicit sync. GLContext 'early-out' is the case where the thread already holds the context, ie. context is already current and the native makeCurrent is skipped. makeCurrent()'s 'early-out' w/o incr. the recursive lock of GLContext and it's NativeSurface could lead to asymetry in lock/unlock count with release()/destroy() calls. The 1st release actually released the native ctx already. Properly utilize recursive lock/unlock in all cases and impl. 'early-out' after locking. Following the above in GLDrawableHelper.invokeGL()'s 'early-out' case as well, ie calling makeCurrent()/release() symmetrical. Introduce GLDrawableHelper.disposeGL(), which issues dispose on all GLEventListeners within a current context and issued context destruction directly. This simplifies GLAutodrawable's destroy/dispose calls and ensures that the above sequence of events happens atomically (lock is being hold until destruction). Enable context switch tracing If property 'jogl.debug.GLContext.TraceSwitch' is defined, trace context switch. GLCanvas: proper AbstractGraphicsDevice destruction
* Fix bug 549 - Incorrect calculation of count value in GLUniformData due to ↵Sven Gothel2012-01-051-3/+3
| | | | | | | | | ignored buffer position. This was disclosed by testing agains the Intel HD 3000 GPU, resulting in an INVALID OPERATION GL error (correct). Other driver ignored this mismatch ..
* GLJPanel: Fix dispose of backend (J2DOGL thread, no double dispose)..,Sven Gothel2011-12-222-104/+94
| | | | | | | | | | | | | | | | | | | | | | | GLJPanel: - fix dispose of backend - proper J2DOGL thread - no double dispose - remove VERBOSE - no dispose regenerate flag - add @Overrride - more safe createContext(..) impl - setSynchronized(true); for all backends - ensure AbstractGraphicsDevice close() is being called GLDrawableHelper: - Clarify w/ isDisposeAction = null==initAction GLPbufferImpl: - ensure AbstractGraphicsDevice close() is being called Java2D: - remove VERBOSE -
* CgDynamicLibraryBundleInfo: Add TempJarCache usage for atomic native jar (of ↵Sven Gothel2011-12-181-1/+2
| | | | | | | atomic java JAR) - GLProfile, NWJNILibLoader, NEWTJNILibLoader: Issue Platform.initSingleton() upfront within priviledge block.
* New Interface 'OffscreenLayerOption', impl. by JAWTWindow (impl) and ↵Sven Gothel2011-12-171-31/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | NewtCanvasAWT/GLCanvas (delegation) ; Fix GLCanvas OffscreenLayerSurface usage. JAWTWindow.destroy(): - No more getGraphicsConfiguration().getScreen().getDevice().close() call, since the configuration (hence the device) is passed @ creation and owned by the caller. New Interface 'OffscreenLayerOption', impl. by JAWTWindow (impl) and NewtCanvasAWT/GLCanvas (delegation) - Abstract offscreenLayer option to be delegated by using classes - Allow offscreen testing of GLCanvas as well (like NewtCanvasAWT) Fix GLCanvas OffscreenLayerSurface usage - common 'createDrawableAndContext()' for context and drawable instance creation - addNotify() calls createDrawableAndContext() after super.addNotify() to be able to lock the surface (JAWTWindow) and hence to determine offscreen usage. - reshape(...) issues recreation 'dispose(true)' in case of using an offscreen layer - dispose() explicitly destroys the JAWTWindow NewtCanvasAWT: - explicitly close the device of the JAWTWindow (as GLCanvas does) Tests: com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer01GLCanvasAWT com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer02NewtCanvasAWT
* GLDrawableFactory*.createOffscreenDrawable(): No implicit setRealized(true) ↵Sven Gothel2011-12-171-0/+1
| | | | | | | | | | | | | | @ creation GLDrawableFactory*.createOffscreenDrawable(): No implicit setRealized(true) @ creation, following deferred creation like onscreen drawables. This allows using offscreen drawables in classes like GLCanvas, where realization is deferred due to pending valid size. Only createGLPBuffer() realizes the offscreen pbuffer drawable immediatly to reduce the impact on user-code. GLDrawableFactoryImpl.createGLDrawable(): - Simplify OffscreenLayerSurface validation and check it first regardless of the chosenCaps to get a chance to use pbuffer.
* Fix GLDrawableFactory lack of GLProfile initialization in case get*Factory() ↵Sven Gothel2011-12-131-7/+3
| | | | is called 1st, add tests. Add performance numbers of init/shutdown in tests.
* Fix concurrency bug of GLProfile initialization ; Fix SharedResourceRunner ↵Sven Gothel2011-12-113-120/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'dead' thread (Applets) GLDrawableFactory: - clarify: public getWasSharedContextCreated(..) -> protected createSharedResource(..) - add: getSharesResourceThread() GLProfile: - proper locking of initSingletion(..) path: - Use RecursiveThreadGroupLock and add/remove GLDrawableFactory's sharesResourceThread while creating it's the sharedResource. This simplifies and fixes GLProfile's locking code. - Fix and simplify initSingleton(boolean) API doc - mark it deprecated. - Add initSingleton() for controlled initialization only, pairing w/ shutdown(..) Remove initSingleton(boolean) calls in code and test! +++ Fix SharedResourceRunner 'dead' thread (Applets) In Applets, stopping an Applet makes the browser Java plugin interrupting and killing all related threads, including our SharedResourceRunner thread. - Validate whether the shared resource thread is alive - Catch interruption in shared resource thread and assume it's a kill signal - releaseSharedResource: clear devicesTried set
* New GLProfile.ShutdownType: SHARED_ONLY / COMPLETE - Enhance/Fix Lifecycle ↵Sven Gothel2011-12-012-10/+36
| | | | | | | | | | | | | | | | | | | | | Management - Leave Platform, .. TempJarCache untouched. - GLDrawableFactoryImpl*: Leave DynamicLibraryBundle(lib-binding) untouched, for NativeLibrary, JNILibLoaderBase (JNI libs), .. consistency. - SHARED_ONLY: shutdown shared GLDrawableFactoryImpl* resources and NativeWindowFactory - COMPLETE: additionally shutdown GLContext* Clear all cached GL/GLX proc-address and device/context mappings. - Use new "GLProfile.shutdown(GLProfile.ShutdownType.SHARED_ONLY)" in Applets - X11GLXDrawableFactory Shutdown: Uncomment close/destroy of shared resources. - JAWTWindow.destroy(): Close the delegated device. In case it's X11 this closes the exclusive opened X11 Display.
* GLContext fix shutdown(): Clear proc address tables and extension cache ↵Sven Gothel2011-12-011-3/+6
| | | | (GLContextImpl)
* GLProfile: use dbl checked locking w/ volatile ; Proper shutdown sequence.Sven Gothel2011-12-011-26/+36
|
* GLDrawableFactory: Implementations lifecycle is handled via ↵Sven Gothel2011-12-011-27/+43
| | | | constructor/destroy()
* More Robust GLProfile Initialization ; Add NativeWindowFactory ShutdownSven Gothel2011-11-302-7/+19
| | | | | | | | | | | | More Robust GLProfile Initialization - Catch GLException in GLDrawableFactory getWasSharedContextCreated(device) impl., which may fail (See comment on Firefox/Chorme EGL deployed library for Windows). - If getWasSharedContextCreated(devide) fails, set respective factory availability to false, ie. hasDesktopGLFactory, hasEGLFactory, .. Add NativeWindowFactory Shutdown - Currenly a dummy entry, may evolve. X11Util shutdown is issued by respective GLDrawableFactory
* Nativewindow AWT Device/Screen: Cleanup construction [default, specific]; ↵Sven Gothel2011-11-251-1/+3
| | | | AWTDevice: Remove subtype
* NativeSurface's getGraphicsConfiguration() returns the native (delegated) ↵Sven Gothel2011-11-232-4/+4
| | | | | | | | | | | AbstractGraphicsConfiguration, if delegation is used. This change restricts the usage of AbstractGraphicsConfiguration's getNativeGraphicsConfiguration() to NativeSurface implementations and hence reduces complexity. NativeSurface implementations are adapted and access to it's AbstractGraphicsConfiguration is controlled via get/set method avoiding flawed usage (read/write), since read access shall return the delegated AbstractGraphicsConfiguration, if used.
* Fix GLDrawableFactory: Move 'GLContext getOrCreateSharedContext(..)' to non ↵Sven Gothel2011-11-211-16/+0
| | | | | | | | | | | | | | public class GLDrawableFactoryImpl. Michael Weber's test case (commit e7388512b69979d00e5a213a1b166a1b1726ae0c) pointed me to the flaw in GLDrawableFactory which exposed a non-public method, ie. 'getOrCreateSharedContext()'. This lead to the assumption, that the 'shared' drawable/context of the factory is multi purpose and may be used for application context sharing - which is not the case. Changed Michael's test case to use a local shared pbuffer based drawable/context and made the method non-public, where it belongs.