From b7bd092831a1ad7a660386c4c291cb363cd8ebb0 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Fri, 23 Apr 2010 02:00:27 +0200 Subject: reviewed calls to lockSurface() and ensured propper unlocking. --- .../opengl/impl/egl/EGLOnscreenDrawable.java | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java') diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java index 3286367e5..3864fc39c 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java @@ -60,21 +60,19 @@ public class EGLOnscreenDrawable extends EGLDrawable { protected void swapBuffersImpl() { boolean didLock = false; + if (!isSurfaceLocked()) { + // Usually the surface shall be locked within [makeCurrent .. swap .. release] + if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { + return; + } + didLock = true; + } try { - if ( !isSurfaceLocked() ) { - // Usually the surface shall be locked within [makeCurrent .. swap .. release] - if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { - return; - } - didLock = true; - } - - EGL.eglSwapBuffers(eglDisplay, eglSurface); - + EGL.eglSwapBuffers(eglDisplay, eglSurface); } finally { - if(didLock) { - unlockSurface(); - } + if (didLock) { + unlockSurface(); + } } } -- cgit v1.2.3