Closed vroad closed 7 years ago
Thanks a lot for the suggestion, and sorry for the late reply (I was on a vacation).
That sounds like a very smart idea! That push/pop stuff is some of the most expensive in Starling's render loop, so it would be extremely helpful to optimize this.
I'll definitely try this out!! 😄
Thanks again for bringing this up! This avoids lots of unnecessary CPU cycles. 👍
DisplayObjectContainer
saves current render state every time when it renders a child object, but is this unavoidable? I think that you could do something like this instead:BatchProcessor.fillToken
if you did that already)_stateStackPos
_stateStackPos
outside of for-loopThat way you don't need to call
Painter.pushState
every time before rendering child objects, and will help in improving the performance ofDisplayObjectContainer
which has many child objects. I've tried this in my repo and seems to be working fine.