aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-02-22 17:30:56 +0100
committerSven Gothel <[email protected]>2012-02-22 17:30:56 +0100
commit7085c11e493e5a7bbe56a602a3252f4e28c2f974 (patch)
tree62032e7c4a7ce14d3a5a3c8c2b4964dbc87a4577 /src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
parenta5a3d0dfa2c8c7e1e68dc4b066dda1011f471606 (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/EGLDrawableFactory.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
index 56d14fc8f..2a6985d90 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -152,7 +152,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
if(DEBUG) {
System.err.println("EGLDrawableFactory.destroy("+shutdownType+"): "+sr.device.toString());
}
- EGL.eglTerminate(sr.device.getHandle());
+ EGLDisplayUtil.eglTerminate(sr.device.getHandle());
}
sharedMap.clear();
sharedMap = null;
@@ -249,13 +249,13 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
sr = (SharedResource) sharedMap.get(connection);
}
if(null==sr) {
- long eglDisplay = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
+ long eglDisplay = EGLDisplayUtil.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
if (eglDisplay == EGL.EGL_NO_DISPLAY) {
throw new GLException("Failed to created EGL default display: error 0x"+Integer.toHexString(EGL.eglGetError()));
} else if(DEBUG) {
System.err.println("EGLDrawableFactory.createShared: eglDisplay(EGL_DEFAULT_DISPLAY): 0x"+Long.toHexString(eglDisplay));
}
- if (!EGL.eglInitialize(eglDisplay, null, null)) {
+ if (!EGLDisplayUtil.eglInitialize(eglDisplay, null, null)) {
throw new GLException("eglInitialize failed"+", error 0x"+Integer.toHexString(EGL.eglGetError()));
}
final EGLGraphicsDevice sharedDevice = new EGLGraphicsDevice(eglDisplay, connection, adevice.getUnitID());