From 6119c8adbb8f2f8acda470ef82b5032342c8f142 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 13 Sep 2014 15:27:43 +0200 Subject: AnimatorBase.finishLifecycleAction(): Non blocking call shall return true, success - otherwise pause()/.. return value is inconsistent. Caller of e.g. pause() running on the anim-thread or AWT-EDT (AWTAnimatorImpl) will be non-blocking. Before this change, a non-blocking simply did not wait until the 'hold' condition is reached and returned its negated value. This ofc is 'false', indicated unsuccessful operation. Caller use the return value to determine whether the call actually paused (or ..) the animator. Despite the non-blocking nature, the pause state was set, even if not reached. Hence a resume() would be required to continue operation after a temporary pause. +++ This change ignores the non-blocking nature's unmet condition. finishLifecycleAction() returns !nok || !blocking, i.e. either true for the reached condition (blocking) or true if non-blocking. Blocking calls with unmet condition still return false. +++ In case an animated GLAutoDrawableis being pulled after a non-blocking animator pause() call, the GLAutoDrawable's implementation thread-safety must ensure proper operation. +++ --- src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/newt/classes/com') diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index 42b886742..2ba030f76 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -606,10 +606,12 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind @Override public synchronized boolean pauseRenderingAction() { - boolean animatorPaused = false; + final boolean animatorPaused; savedAnimator = GLWindow.this.getAnimator(); if ( null != savedAnimator ) { animatorPaused = savedAnimator.pause(); + } else { + animatorPaused = false; } return animatorPaused; } -- cgit v1.2.3