diff options
author | Sven Gothel <[email protected]> | 2012-10-13 07:10:52 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-10-13 07:10:52 +0200 |
commit | 61bb64aea9d8967f5360ba42fc9ec7a24b79683b (patch) | |
tree | cece3f24c117e0b2ebc7201dd5128a0721e334ae /src/jogl/classes/javax/media/opengl/GLProfile.java | |
parent | 51f055ae70f927638ac304436e9a1f02a1c0b570 (diff) |
Fix Windows ANGLE Workaround Regression of commit 923d9dd7f1d40db72d35ca76a761ca14babf147f
We are aware that Google's ANGLE (Windows EGL/ES2 impl. based on D3D)
crashes using eglInitialize(..) w/ EGL_DEFAULT_DISPLAY.
Commit 923d9dd7f1d40db72d35ca76a761ca14babf147f moved the EGL device initialization
into the EGLDrawableFactory ctor and hence slipped out ANGLE workaround to disable it per default.
- Moving property static flags from GLProfile -> GLDrawableFactory
- Moving ANGLE workaround right into EGLDrawableFactory (where it belongs)
- Moving optional EGL/ES disable code to GLDrawableFactory (where it belongs)
Tested on Windows w/ Java-32bit and latest Chrome ANGLE DLLs
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/GLProfile.java')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLProfile.java | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index aabda465e..f916ab8b1 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -77,23 +77,6 @@ public class GLProfile { public static final boolean DEBUG = Debug.debug("GLProfile"); - /** - * We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome. - * When run in the mentioned browsers, the eglInitialize(..) implementation crashes. - * <p> - * This can be overridden by explicitly enabling ANGLE on Windows by setting the property - * <code>jogl.enable.ANGLE</code>. - * </p> - */ - private static final boolean enableANGLE = Debug.isPropertyDefined("jogl.enable.ANGLE", true); - - /** - * In case no OpenGL ES implementation is required - * and if the running platform may have a buggy implementation, - * setting the property <code>jogl.disable.opengles</code> disables querying a possible existing OpenGL ES implementation. - */ - private static final boolean disableOpenGLES = Debug.isPropertyDefined("jogl.disable.opengles", true); - static { // Also initializes TempJarCache if shall be used. Platform.initSingleton(); @@ -1447,28 +1430,15 @@ public class GLProfile { defaultDesktopDevice = desktopFactory.getDefaultDevice(); } - if ( !disableOpenGLES && ReflectionUtil.isClassAvailable("jogamp.opengl.egl.EGLDrawableFactory", classloader) ) { + if ( ReflectionUtil.isClassAvailable("jogamp.opengl.egl.EGLDrawableFactory", classloader) ) { t=null; try { eglFactory = (GLDrawableFactoryImpl) GLDrawableFactory.getFactoryImpl(GLES2); if(null != eglFactory) { - final boolean isANGLE = ((jogamp.opengl.egl.EGLDrawableFactory)eglFactory).isANGLE(); - if(isANGLE && !enableANGLE) { - if(DEBUG) { - System.err.println("Info: GLProfile.init - EGL/ES2 ANGLE disabled"); - } - eglFactory.destroy(); - eglFactory = null; - hasEGLFactory = false; - } else { - if(DEBUG && isANGLE) { - System.err.println("Info: GLProfile.init - EGL/ES2 ANGLE enabled"); - } - hasEGLFactory = true; - // update hasGLES1Impl, hasGLES2Impl based on EGL - hasGLES2Impl = null!=eglFactory.getGLDynamicLookupHelper(2) && hasGLES2Impl; - hasGLES1Impl = null!=eglFactory.getGLDynamicLookupHelper(1) && hasGLES1Impl; - } + hasEGLFactory = true; + // update hasGLES1Impl, hasGLES2Impl based on EGL + hasGLES2Impl = null!=eglFactory.getGLDynamicLookupHelper(2) && hasGLES2Impl; + hasGLES1Impl = null!=eglFactory.getGLDynamicLookupHelper(1) && hasGLES1Impl; } } catch (LinkageError le) { t=le; |