diff options
author | Sven Gothel <[email protected]> | 2013-01-27 14:08:07 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-01-27 14:08:07 +0100 |
commit | 2fe180fbee15b82e2ae14fe3c95887db246c874d (patch) | |
tree | 62664ce340fef807fd061b849aea5a46bba7b314 /src/jogl/classes/jogamp/opengl/GLContextImpl.java | |
parent | 3f4eeaf76efa8f1f8b305c8dc1770dc679ced307 (diff) |
Bug 665 (part 3) - Allow dis-association of GLContext's GLDrawable .. - Add EGL/ES2 tests, attempt to fix wrapped EGL case
- Bug 665 (part 2) was commit 7fd5f76e1eb4bbf93fe9b1171744bd755d8f96e4
- Add EGL/ES2 tests in
- TestGLContextDrawableSwitch01NEWT
- TestGLContextDrawableSwitch11NEWT
- Attempt to fix wrapped EGL case (incomplete)
- Using EGL/ES w/ non native EGL device/surface, but natively wrapped instances (most of the cases),
a 'complicated' delegation of
Native-Upstream -> EGL-Proxy -> EGL-Instance
is being used heavily relying on the objects lifecycle.
GLEventListenerState tries to roll back the realized state
and even sets the upstream device handle,
but this doesn't seem to be sufficient on X11.
Discussion:
It might turn out that we only can implement the survival of GLContext
and it's display device reliable w/ EGL within the GLAutoDrawable implementation,
which can hold the previous not destructed instances.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLContextImpl.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLContextImpl.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 2a2b6a8fd..b17fce569 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -206,11 +206,12 @@ public abstract class GLContextImpl extends GLContext { if( drawable == readWrite && ( setWriteOnly || drawableRead == readWrite ) ) { return drawable; // no change. } - final boolean lockHeld = lock.isOwner(Thread.currentThread()); + final Thread currentThread = Thread.currentThread(); + final boolean lockHeld = lock.isOwner(currentThread); if(lockHeld) { release(); } else if(lock.isLockedByOtherThread()) { // still could glitch .. - throw new GLException("GLContext current by other thread ("+lock.getOwner()+"), operation not allowed."); + throw new GLException("GLContext current by other thread "+lock.getOwner().getName()+", operation not allowed on this thread "+currentThread.getName()); } if( !setWriteOnly || drawableRead == drawable ) { // if !setWriteOnly || !explicitReadDrawable drawableRead = (GLDrawableImpl) readWrite; @@ -339,7 +340,7 @@ public abstract class GLContextImpl extends GLContext { } if (contextHandle != 0) { final int lockRes = drawable.lockSurface(); - if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) { + if (NativeSurface.LOCK_SURFACE_NOT_READY >= lockRes) { // this would be odd .. throw new GLException("Surface not ready to lock: "+drawable); } @@ -413,7 +414,7 @@ public abstract class GLContextImpl extends GLContext { } final int lockRes = drawable.lockSurface(); - if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) { + if (NativeSurface.LOCK_SURFACE_NOT_READY >= lockRes) { // this would be odd .. throw new GLException("Surface not ready to lock"); } |