From 82c7c16b6298a5a781c9721edb8b81d7ec2aaf81 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 26 Oct 2011 12:48:21 +0200 Subject: Minor edits / cleanup of GLContext* --- src/jogl/classes/jogamp/opengl/egl/EGLContext.java | 2 +- src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java | 13 +++++-------- .../jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/egl') diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java index 2deae65fb..0ec913e31 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java @@ -36,6 +36,7 @@ package jogamp.opengl.egl; import javax.media.opengl.*; + import jogamp.opengl.*; import com.jogamp.gluegen.runtime.ProcAddressTable; @@ -183,7 +184,6 @@ public abstract class EGLContext extends GLContextImpl { throw new GLException("Error creating OpenGL context: eglDisplay "+toHexString(eglDisplay)+ ", eglConfig "+config+", "+glProfile+", shareWith "+toHexString(shareWith)+", error "+toHexString(EGL.eglGetError())); } - GLContextShareSet.contextCreated(this); if (DEBUG) { System.err.println(getThreadName() + ": !!! Created OpenGL context 0x" + Long.toHexString(contextHandle) + diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java index fb9c93000..79d96bdb6 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java @@ -136,6 +136,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { return true; // via mappings (X11/WGL/.. -> EGL) we shall be able to handle all types. } + /** private boolean isEGLContextAvailable(EGLGraphicsDevice sharedDevice, String profile) { boolean madeCurrent = false; final GLCapabilities caps = new GLCapabilities(GLProfile.get(profile)); @@ -163,9 +164,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { drawable.destroy(); } return madeCurrent; - } + } */ - private SharedResource getOrCreateShared(AbstractGraphicsDevice adevice) { + /* package */ SharedResource getOrCreateEGLSharedResource(AbstractGraphicsDevice adevice) { String connection = adevice.getConnection(); SharedResource sr; synchronized(sharedMap) { @@ -200,7 +201,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { } public final boolean getWasSharedContextCreated(AbstractGraphicsDevice device) { - SharedResource sr = getOrCreateShared(device); + SharedResource sr = getOrCreateEGLSharedResource(device); if(null!=sr) { return sr.wasES1ContextAvailable() || sr.wasES2ContextAvailable(); } @@ -212,17 +213,13 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { } protected AbstractGraphicsDevice getOrCreateSharedDeviceImpl(AbstractGraphicsDevice device) { - SharedResource sr = getOrCreateShared(device); + SharedResource sr = getOrCreateEGLSharedResource(device); if(null!=sr) { return sr.getDevice(); } return null; } - SharedResource getOrCreateSharedResource(AbstractGraphicsDevice device) { - return (SharedResource) getOrCreateShared(device); - } - public GLDynamicLookupHelper getGLDynamicLookupHelper(int esProfile) { if (2==esProfile) { if(null==eglES2DynamicLookupHelper) { diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java index 8c1cf882c..74f7d884b 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java @@ -101,7 +101,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact } protected static List getAvailableCapabilities(EGLDrawableFactory factory, AbstractGraphicsDevice device) { - EGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResource(device); + EGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateEGLSharedResource(device); if(null == sharedResource) { throw new GLException("Shared resource for device n/a: "+device); } -- cgit v1.2.3