aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/jogamp
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/newt/classes/jogamp
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/newt/classes/jogamp')
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java6
-rw-r--r--src/newt/classes/jogamp/newt/driver/kd/KDDisplay.java6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java b/src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java
index 72c0bce64..be3fbd323 100644
--- a/src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java
+++ b/src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java
@@ -54,13 +54,13 @@ public class AndroidDisplay extends jogamp.newt.DisplayImpl {
protected void createNativeImpl() {
// EGL Device
- final long eglDisplay = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
+ final 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("Android Display.createNativeImpl: 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 eglDisplay 0x"+Long.toHexString(eglDisplay)+", error 0x"+Integer.toHexString(EGL.eglGetError()));
}
aDevice = new EGLGraphicsDevice(eglDisplay, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
@@ -68,7 +68,7 @@ public class AndroidDisplay extends jogamp.newt.DisplayImpl {
protected void closeNativeImpl() {
if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
- EGL.eglTerminate(aDevice.getHandle());
+ EGLDisplayUtil.eglTerminate(aDevice.getHandle());
}
}
diff --git a/src/newt/classes/jogamp/newt/driver/kd/KDDisplay.java b/src/newt/classes/jogamp/newt/driver/kd/KDDisplay.java
index bbfe10160..bbe67f00f 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/KDDisplay.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/KDDisplay.java
@@ -59,11 +59,11 @@ public class KDDisplay extends DisplayImpl {
protected void createNativeImpl() {
// FIXME: map name to EGL_*_DISPLAY
- long handle = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
+ long handle = EGLDisplayUtil.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
if (handle == EGL.EGL_NO_DISPLAY) {
throw new NativeWindowException("eglGetDisplay failed");
}
- if (!EGL.eglInitialize(handle, null, null)) {
+ if (!EGLDisplayUtil.eglInitialize(handle, null, null)) {
throw new NativeWindowException("eglInitialize failed");
}
aDevice = new EGLGraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
@@ -71,7 +71,7 @@ public class KDDisplay extends DisplayImpl {
protected void closeNativeImpl() {
if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
- EGL.eglTerminate(aDevice.getHandle());
+ EGLDisplayUtil.eglTerminate(aDevice.getHandle());
}
}