From 26f965bbe7b40968158901c3f4ef2f54e821ac70 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 23 Jan 2015 23:34:39 +0100 Subject: GLContextImpl.makeCurrentImpl(): Remove redundant test whether context is already current - GLContextImpl.makeCurrentImpl(): Remove redundant test whether context is already current GLContext.makeCurrent() already verifies whether native makeCurrent can be skipped by comparing against the thread-local current GLContext instance. - Add X11GLXContext.glXReleaseContext(..) to simplify release call --- src/jogl/classes/jogamp/opengl/egl/EGLContext.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/egl/EGLContext.java') diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java index fe01fbc8c..7b4b55b34 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java @@ -115,16 +115,14 @@ public class EGLContext extends GLContextImpl { @Override protected void makeCurrentImpl() throws GLException { - if (EGL.eglGetCurrentContext() != contextHandle) { - final long dpy = drawable.getNativeSurface().getDisplayHandle(); - if (!EGL.eglMakeCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) { - throw new GLException("Error making context " + toHexString(contextHandle) + - " current on Thread " + getThreadName() + - " with display " + toHexString(dpy) + - ", drawableWrite " + toHexString(drawable.getHandle()) + - ", drawableRead "+ toHexString(drawableRead.getHandle()) + - " - Error code " + toHexString(EGL.eglGetError()) + ", " + this); - } + final long dpy = drawable.getNativeSurface().getDisplayHandle(); + if ( !EGL.eglMakeCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle) ) { + throw new GLException("Error making context " + toHexString(contextHandle) + + " current on Thread " + getThreadName() + + " with display " + toHexString(dpy) + + ", drawableWrite " + toHexString(drawable.getHandle()) + + ", drawableRead "+ toHexString(drawableRead.getHandle()) + + " - Error code " + toHexString(EGL.eglGetError()) + ", " + this); } } -- cgit v1.2.3