Further to this, I got a little bogged down with the problem since it was causing me no end of slow down, and so ..
It seems to be caused by the generation of loads and loads of StateNodes, all based around Transform3Ds. Now I don't really understand what all this stuff is for. However, I also get a tonne of TreeMap entries showing up on the profile.
I had a look round the code and it seems to be a problem with the StateMap. Now, I can't really tell the implications of the follow but it did at least seem to fix the problem without breaking any of my rendering..
Anyway, introduction over, here's the change I made, thought it might help in finding the real problem..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| void assignState( StateTrackable trackable ) {
StateNode sn = trackable.getStateNode(); StateNode existing = (StateNode)states.get(trackable); if (existing != null) { trackable.setStateNode(existing); } else { sn = new StateNode(trackable); sn.id = nextId++; states.put(trackable,sn); trackable.setStateNode(sn); }
} |
Apologies if this turns out to be a red herring so to speak.
Kev