summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-08-16 15:58:33 +0200
committerSven Gothel <[email protected]>2012-08-16 15:58:33 +0200
commit43a473b2005d7f59a7f4f5b8bc7ca9ae88b4e894 (patch)
tree9580d25adf52aa9a24165f44ee8d304453ebe428 /src/nativewindow/classes/com/jogamp
parent53ba263381c7b0434cfe834e4be1ff67ebebe1fe (diff)
EGLDisplayUtil: Workaround (latest) PVR 540 EGL regression where 3nd EGLDisplay's eglInitialize(..) fails ; Fix EGLDrawableFactory.getEGLSurface()
- EGLDisplayUtil: Workaround (latest) PVR 540 EGL regression where 3nd EGLDisplay's eglInitialize(..) fails In this case and if eglGetDisplay(..) fails w/ a non EGL_DEFAULT_DEVICE, fall back to EGL_DEFAULT_DEVICE - always. This workaround actually simplifies handling both cases. - Fix EGLDrawableFactory.getEGLSurface() Tests whether a given NativeSurface w/ EGLGraphicsDevice and EGLGraphicsConfiguration has a valid EGL Surface. Only if true, reuse the whole NativeSurface, otherwise construct the missing pieces (device, config and use a WrappedSurface for EGL).
Diffstat (limited to 'src/nativewindow/classes/com/jogamp')
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
index 389949e90..40042ec81 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
@@ -37,7 +37,7 @@ import javax.media.nativewindow.*;
/** Encapsulates a graphics device on EGL platforms.
*/
public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
- final long nativeDisplayID;
+ final long[] nativeDisplayID = new long[1];
final EGLDisplayLifecycleCallback eglLifecycleCallback;
/**
@@ -51,9 +51,10 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
/**
* Implementation should issue an <code>EGL.eglGetDisplay(nativeDisplayID)</code>
* inclusive <code>EGL.eglInitialize(eglDisplayHandle, ..)</code> call.
- * @param eglDisplayHandle
+ * @param nativeDisplayID in/out array of size 1, passing the requested nativeVisualID, may return a different revised nativeVisualID handle
+ * @return the initialized EGL display ID, or <code>0</code> if not successful
*/
- public long eglGetAndInitDisplay(long nativeDisplayID);
+ public long eglGetAndInitDisplay(long[] nativeDisplayID);
/**
* Implementation should issue an <code>EGL.eglTerminate(eglDisplayHandle)</code> call.
@@ -68,17 +69,17 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
*/
public EGLGraphicsDevice(String connection, int unitID) {
super(NativeWindowFactory.TYPE_EGL, connection, unitID);
- this.nativeDisplayID = 0 ; // EGL.EGL_DEFAULT_DISPLAY
+ this.nativeDisplayID[0] = 0 ; // EGL.EGL_DEFAULT_DISPLAY
this.eglLifecycleCallback = null;
}
public EGLGraphicsDevice(long nativeDisplayID, long eglDisplay, String connection, int unitID, EGLDisplayLifecycleCallback eglLifecycleCallback) {
super(NativeWindowFactory.TYPE_EGL, connection, unitID, eglDisplay);
- this.nativeDisplayID = nativeDisplayID;
+ this.nativeDisplayID[0] = nativeDisplayID;
this.eglLifecycleCallback = eglLifecycleCallback;
}
- public long getNativeDisplayID() { return nativeDisplayID; }
+ public long getNativeDisplayID() { return nativeDisplayID[0]; }
@Override
public Object clone() {
@@ -113,7 +114,7 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
@Override
public String toString() {
- return "EGLGraphicsDevice[type EGL, connection "+getConnection()+", unitID "+getUnitID()+", handle 0x"+Long.toHexString(getHandle())+", nativeDisplayID 0x"+Long.toHexString(nativeDisplayID)+"]";
+ return "EGLGraphicsDevice[type EGL, connection "+getConnection()+", unitID "+getUnitID()+", handle 0x"+Long.toHexString(getHandle())+", nativeDisplayID 0x"+Long.toHexString(nativeDisplayID[0])+", eglLifecycleCallback "+(null != eglLifecycleCallback)+"]";
}
}