Optimizing View capture logic

Doing view capture in two passes
1) UI thread: creating a flat copy of the full view tree. Since
   view structure can change on the UI thread, this needs to be
   captured synchronously on UI thread.
2) BG thread: We capture the properties of the View on background
   thread using the flat tree created in the previous step. Since
   reading the properties is atomic, there is no synchronization
   issued.

One down side of this approach is that the properties might change
while the background-tep is underway. So all the properties of a
of a node may not represent the frame-state. But for the purpose
of animations, we can just refer a few continous frames.

Bug: 242095405
Test: Verified on device, frame capture reduced by at least 5x
      every time.
Change-Id: I0a61fb24669940b3b3533c0471e42e476709da55
2 files changed