diff options
author | Michael Bien <[email protected]> | 2010-04-23 02:00:27 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-04-23 02:00:27 +0200 |
commit | b7bd092831a1ad7a660386c4c291cb363cd8ebb0 (patch) | |
tree | a52a2c5c34ecdfa91aa60f5615d36788259f1a28 /src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java | |
parent | c9b12606cf57c4ef255d88a65eb713ff9167c6de (diff) |
reviewed calls to lockSurface() and ensured propper unlocking.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java | 24 |
1 files changed, 11 insertions, 13 deletions
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(); + } } } |