Revision 11845a9e
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/library/main/DistortedMaster.java | ||
---|---|---|
99 | 99 |
if( !found ) mSlaves.add(s); |
100 | 100 |
} |
101 | 101 |
|
102 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
103 |
// Can make this logarithmic but the typical number of children is very small anyway. |
|
104 |
// |
|
105 |
// We want to keep same buckets next to each other, while avoiding changes in order of the children |
|
106 |
// (if possible!) We want to keep bucket=0 (i.e. the non-postprocessed children) at the beginning. |
|
107 |
|
|
108 |
static void addSortingByBuckets(ArrayList<DistortedNode> mChildren, DistortedNode newChild) |
|
109 |
{ |
|
110 |
int i,num = mChildren.size(); |
|
111 |
long bucket = newChild.getPostprocessQueue().getID(); |
|
112 |
boolean sameBucket = false; |
|
113 |
|
|
114 |
for(i=0; i<num; i++) |
|
115 |
{ |
|
116 |
if( mChildren.get(i).getPostprocessQueue().getID() == bucket ) |
|
117 |
{ |
|
118 |
sameBucket=true; |
|
119 |
} |
|
120 |
else if( sameBucket || bucket==0 ) |
|
121 |
{ |
|
122 |
break; |
|
123 |
} |
|
124 |
} |
|
125 |
|
|
126 |
mChildren.add(i,newChild); |
|
127 |
|
|
128 |
//android.util.Log.e("newChild", "newBucket="+bucket+" new child at "+i+" total num ="+num); |
|
129 |
} |
|
130 |
|
|
131 | 102 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
132 | 103 |
|
133 | 104 |
static void onDestroy() |
Also available in: Unified diff
Carve the 'children list' from DOutputSurface and DNode into a separate class of its own, DistortedChildrenList.