summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Rushforth <[email protected]>2007-05-15 21:31:43 +0000
committerKevin Rushforth <[email protected]>2007-05-15 21:31:43 +0000
commitcf929de6a881ab72b03b99690feec23a8e0413d5 (patch)
tree13ed836b2034b71841bb400dfb6748561a8f8518
parent18276a79583f338b3940dde5febf47f67ef6f61d (diff)
Fixed issue 489: AutoOffScreenCanvas3D: postSwap() is called twice
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@841 ba19aa83-45c5-6ac9-afd3-db810772062c
-rw-r--r--src/classes/share/javax/media/j3d/Renderer.java38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/classes/share/javax/media/j3d/Renderer.java b/src/classes/share/javax/media/j3d/Renderer.java
index 21e7534..d6a9805 100644
--- a/src/classes/share/javax/media/j3d/Renderer.java
+++ b/src/classes/share/javax/media/j3d/Renderer.java
@@ -1422,26 +1422,30 @@ class Renderer extends J3dThread {
canvas.endOffScreenRendering();
canvas.offScreenRendering = false;
- // do the postSwap for offscreen here
- canvas.view.inCanvasCallback = true;
- try {
- canvas.postSwap();
- } catch (RuntimeException e) {
- System.err.println("Exception occurred during Canvas 3D callback:");
- e.printStackTrace();
- } catch (Error e) {
- // Issue 264 - catch Error so Renderer doesn't die
- System.err.println("Error occurred during Canvas3D callback:");
- e.printStackTrace();
- }
+ // Issue 489 - don't call postSwap here for auto-offscreen,
+ // since it will be called later by the SWAP operation
+ if (canvas.manualRendering) {
+ // do the postSwap for offscreen here
+ canvas.view.inCanvasCallback = true;
+ try {
+ canvas.postSwap();
+ } catch (RuntimeException e) {
+ System.err.println("Exception occurred during Canvas 3D callback:");
+ e.printStackTrace();
+ } catch (Error e) {
+ // Issue 264 - catch Error so Renderer doesn't die
+ System.err.println("Error occurred during Canvas3D callback:");
+ e.printStackTrace();
+ }
- if (offBufRetained.isByReference()) {
- offBufRetained.geomLock.unLock();
- }
+ if (offBufRetained.isByReference()) {
+ offBufRetained.geomLock.unLock();
+ }
- canvas.view.inCanvasCallback = false;
+ canvas.view.inCanvasCallback = false;
- canvas.releaseCtx();
+ canvas.releaseCtx();
+ }
}
canvas.endScene();