diff options
author | Sven Gothel <[email protected]> | 2012-02-22 17:30:56 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-02-22 17:30:56 +0100 |
commit | 7085c11e493e5a7bbe56a602a3252f4e28c2f974 (patch) | |
tree | 62032e7c4a7ce14d3a5a3c8c2b4964dbc87a4577 /src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java | |
parent | a5a3d0dfa2c8c7e1e68dc4b066dda1011f471606 (diff) |
EGL Display Lifecycle Robustness Patch (impl. workaround)
Added EGLDisplayUtil helper class managing the lifecycle of the EGL display handle recursively.
This class is required, due to implementation bugs within EGL where EGL.eglTerminate(long)
does not mark the resource for deletion when still in use, bug releases them immediatly.
This fixes unit test com.jogamp.opengl.test.junit.jogl.acore.TestInitConcurrentNEWT
on Linux ARM w/ Omap4 and Tegra2.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java index c4e16b784..a74d7d610 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java @@ -163,20 +163,20 @@ public abstract class EGLDrawable extends GLDrawableImpl { } else { nDisplay = aDevice.getHandle(); // 0 == EGL.EGL_DEFAULT_DISPLAY } - eglDisplay = EGL.eglGetDisplay(nDisplay); + eglDisplay = EGLDisplayUtil.eglGetDisplay(nDisplay); if (eglDisplay == EGL.EGL_NO_DISPLAY) { if(DEBUG) { System.err.println(getThreadName() + ": eglDisplay("+toHexString(nDisplay)+" <surfaceHandle>): failed, using EGL_DEFAULT_DISPLAY"); } nDisplay = EGL.EGL_DEFAULT_DISPLAY; - eglDisplay = EGL.eglGetDisplay(nDisplay); + eglDisplay = EGLDisplayUtil.eglGetDisplay(nDisplay); } if (eglDisplay == EGL.EGL_NO_DISPLAY) { throw new GLException("Failed to created EGL display: nhandle "+toHexString(nDisplay)+", "+aDevice+", error "+toHexString(EGL.eglGetError())); } else if(DEBUG) { System.err.println(getThreadName() + ": eglDisplay("+toHexString(nDisplay)+"): "+toHexString(eglDisplay)); } - if (!EGL.eglInitialize(eglDisplay, null, null)) { + if (!EGLDisplayUtil.eglInitialize(eglDisplay, null, null)) { throw new GLException("eglInitialize failed"+", error "+Integer.toHexString(EGL.eglGetError())); } EGLGraphicsDevice e = new EGLGraphicsDevice(eglDisplay, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT); @@ -208,7 +208,7 @@ public abstract class EGLDrawable extends GLDrawableImpl { if(DEBUG) { System.err.println(getThreadName() + ": EGLDrawable.setRealized(false): eglTerminate: "+toHexString(eglDisplay)); } - EGL.eglTerminate(eglDisplay); + EGLDisplayUtil.eglTerminate(eglDisplay); } eglDisplay=EGL.EGL_NO_DISPLAY; eglConfig=null; |