Ensure correct Z order on WM trace

Use a counter to determine in which order the elements are parsed, and
use this information to sort the rects, instead of doing a combination
of children.revered() to dipsplay the hierarchy and rects.reversed() to
display the rects

Bug: 259085964
Test: open a WM trace and check if the window ordering is correct
Change-Id: I421093ef73876088644caa6c312e811b515705c3
10 files changed