From 333054091dcc2f721d4934c675128892dee7e264 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sat, 15 Jun 2013 10:39:41 -0700 Subject: j3dcore: annotate two locked geometry lists in RenderBin Signed-off-by: Harvey Harrison --- src/classes/share/javax/media/j3d/RenderBin.java | 63 +++++++++++------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/src/classes/share/javax/media/j3d/RenderBin.java b/src/classes/share/javax/media/j3d/RenderBin.java index 485d945..4f2f68a 100644 --- a/src/classes/share/javax/media/j3d/RenderBin.java +++ b/src/classes/share/javax/media/j3d/RenderBin.java @@ -258,12 +258,12 @@ ArrayList obList = new ArrayList(5); ArrayList> orderedBinsList = new ArrayList>(5); ArrayList> toBeAddedBinList = new ArrayList>(5); - /** - * arraylist of geometry that should be locked to ensure - * that the same snapshot of the geometry is rendered - * across all canvases - */ - ArrayList lockGeometryList = new ArrayList(5); +/** + * arraylist of geometry that should be locked to ensure + * that the same snapshot of the geometry is rendered + * across all canvases + */ +ArrayList lockGeometryList = new ArrayList(5); /** @@ -307,11 +307,11 @@ ArrayList bgOrderedBins = new ArrayList(5); ArrayList textureBinList = new ArrayList(5); - /** - * arraylist of refernce geometry that should be locked when transparency - * is on, so that we can make a mirror copy of the colors safely - */ - ArrayList dirtyReferenceGeomList = new ArrayList(5); +/** + * arraylist of refernce geometry that should be locked when transparency + * is on, so that we can make a mirror copy of the colors safely + */ +ArrayList dirtyReferenceGeomList = new ArrayList(5); // list of all Oriented RenderAtoms ArrayList orientedRAs = new ArrayList(5); @@ -599,7 +599,7 @@ ArrayList dirtyList = new ArrayList(5); Canvas3D canvases[] = view.getCanvases(); for (i = 0; i < size; i++) { - geo = (GeometryArrayRetained) dirtyReferenceGeomList.get(i); + geo = dirtyReferenceGeomList.get(i); // Evaluate the nodeComponentList for all the canvases geo.geomLock.getLock(); j = 0; @@ -5660,29 +5660,27 @@ void reEvaluateEnv(ArrayList mLts, ArrayList fogs, // release after building the display list (which happens // for the first canvas rendered) void lockGeometry() { - GeometryRetained geo; - int i, size; + int size; // Vertex array is locked for every time renderer is run size = lockGeometryList.size(); - for (i = 0; i < size; i++) { - geo = (GeometryRetained) lockGeometryList.get(i); - geo.geomLock.getLock(); - + for (int i = 0; i < size; i++) { + GeometryRetained geo = lockGeometryList.get(i); + geo.geomLock.getLock(); } // dlist is locked only when they are rebuilt size = dlistLockList.size(); - for (i = 0; i < size ; i++) { - geo = (GeometryRetained) dlistLockList.get(i); + for (int i = 0; i < size ; i++) { + GeometryRetained geo = (GeometryRetained) dlistLockList.get(i); geo.geomLock.getLock(); } // Lock all the by reference image components size = nodeComponentList.size(); - for (i = 0; i < size; i++) { + for (int i = 0; i < size; i++) { ImageComponentRetained nc = (ImageComponentRetained)nodeComponentList.get(i); nc.geomLock.getLock(); } @@ -5690,49 +5688,48 @@ void reEvaluateEnv(ArrayList mLts, ArrayList fogs, // Release all geometry after rendering to the last canvas void releaseGeometry() { - GeometryRetained geo; - int i, size; + int size; size = lockGeometryList.size(); - for (i = 0; i < size; i++) { - geo = (GeometryRetained) lockGeometryList.get(i); - geo.geomLock.unLock(); + for (int i = 0; i < size; i++) { + GeometryRetained geo = lockGeometryList.get(i); + geo.geomLock.unLock(); } size = dlistLockList.size(); - for (i = 0; i < size; i++) { - geo = (GeometryRetained) dlistLockList.get(i); + for (int i = 0; i < size; i++) { + GeometryRetained geo = (GeometryRetained) dlistLockList.get(i); geo.geomLock.unLock(); } // Clear the display list clear list dlistLockList.clear(); // Lock all the by reference image components size = nodeComponentList.size(); - for (i = 0; i < size; i++) { + for (int i = 0; i < size; i++) { ImageComponentRetained nc = (ImageComponentRetained)nodeComponentList.get(i); nc.geomLock.unLock(); } } - void addGeometryToLockList(Object geo) { + void addGeometryToLockList(GeometryRetained geo) { // just add it to the list, if its a shared geometry // it may be added more than once, thats OK since we // now have nested locks! lockGeometryList.add(geo); } - void removeGeometryFromLockList(Object geo) { + void removeGeometryFromLockList(GeometryRetained geo) { lockGeometryList.remove(geo); } - void addDirtyReferenceGeometry(Object geo) { +void addDirtyReferenceGeometry(GeometryArrayRetained geo) { // just add it to the list, if its a shared geometry // it may be added more than once, thats OK since we // now have nested locks! dirtyReferenceGeomList.add(geo); - } +} void addNodeComponent(Object nc) { -- cgit v1.2.3