aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes
diff options
context:
space:
mode:
authorKevin Rushforth <[email protected]>2006-11-09 00:58:37 +0000
committerKevin Rushforth <[email protected]>2006-11-09 00:58:37 +0000
commit692f8844f3632f162e7d983ab8fc156fe6222ced (patch)
tree2afd4fe86ba2d9051688e141bc284dbe602595dd /src/classes
parent8c8f6efb41a235736cf6225cc331f971c0974b15 (diff)
Backed out part of the fix for issue 347 to avoid a race condition associated with the fix.
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@745 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes')
-rw-r--r--src/classes/share/javax/media/j3d/Canvas3D.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java
index dd35eec..7efad89 100644
--- a/src/classes/share/javax/media/j3d/Canvas3D.java
+++ b/src/classes/share/javax/media/j3d/Canvas3D.java
@@ -724,6 +724,8 @@ public class Canvas3D extends Canvas {
int canvasBit = 0;
// an unique number to identify this canvas : ( canvasBit = 1 << canvasId)
int canvasId = 0;
+ // Indicates whether the canvasId has been allocated
+ private boolean canvasIdAlloc = false;
// Avoid using this as lock, it cause deadlock
Object cvLock = new Object();
@@ -1290,6 +1292,7 @@ public class Canvas3D extends Canvas {
}
canvasId = VirtualUniverse.mc.getCanvasId();
+ canvasIdAlloc = true;
canvasBit = 1 << canvasId;
validCanvas = true;
@@ -1382,6 +1385,7 @@ public class Canvas3D extends Canvas {
evaluateActive();
VirtualUniverse.mc.freeCanvasId(canvasId);
+ canvasIdAlloc = false;
canvasBit = 0;
canvasId = 0;
@@ -1821,9 +1825,14 @@ public class Canvas3D extends Canvas {
// Issues 347, 348 - assign a canvasId for off-screen Canvas3D
if (manualRendering) {
- if (canvasBit == 0) {
+ if (!canvasIdAlloc) {
canvasId = VirtualUniverse.mc.getCanvasId();
- canvasBit = 1 << canvasId;
+ canvasIdAlloc = true;
+
+ // NOTE: We are backing out the following part of the following fix for issues
+ // 347 and 348 due to a regression in texture mapping, and due
+ // to the fact that it is an incomplete fix.
+// canvasBit = 1 << canvasId;
}
}
}
@@ -1832,8 +1841,9 @@ public class Canvas3D extends Canvas {
// Issues 347, 348 - release canvasId for off-screen Canvas3D
if (manualRendering) {
- if (canvasBit != 0) {
+ if (canvasIdAlloc) {
VirtualUniverse.mc.freeCanvasId(canvasId);
+ canvasIdAlloc = false;
canvasBit = 0;
canvasId = 0;
}