From 11347ad39059836f3e2a4f1fc592dc1e3fab6a09 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 30 Aug 2014 00:21:00 +0200 Subject: Bug 1054: GLContext: makeCurrent() needs a null-check of [mutable] drawable; Review null checks and synchronization/locking. 'drawable' field of GLContextImpl is mutable via setGLDrawable(..), which requires high-level locking as documented. The required high-level locking allows us to _not_ add special synchronization to this field (and drawableRead). A simple null-check in makeCurrent() shall be sufficient, plus ensuring mentioned high-level locking is applied. GLContextImpl 'drawable' and 'drawableRead' synchronization: - commit ad79bd072b600a3f2416cc6f0c61e2925000069d check of null drawable is sufficient - Add GLAutoDrawable upstream-lock locking to: - AWT GLCanvas setupPrint/releasePrint - AWT GLJPanel (was missing) Misc: - validate shared-context native-surface locking, throw exception if not successful - pixelDataEvaluated does not need to be synchronized, since it's being called while context is current, locking - GLDrawableHelper.recreateGLDrawable(..): Remove redundant glFinish() call --- src/jogl/classes/jogamp/opengl/GLDrawableHelper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/GLDrawableHelper.java') diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java index f91e1bdba..25ff83fc0 100644 --- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java +++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java @@ -282,7 +282,6 @@ public class GLDrawableHelper { if( currentContext != context ) { context.makeCurrent(); } - context.getGL().glFinish(); context.setGLDrawable(null, true); // dis-associate } @@ -300,7 +299,7 @@ public class GLDrawableHelper { } if(null != context) { - context.setGLDrawable(drawable, true); // re-association + context.setGLDrawable(drawable, true); // re-association, implicit glFinish() ctx/drawable sync } if( null != currentContext ) { -- cgit v1.2.3