OSDN Git Service

Post expensive ContentCapture calls to Choreographer's CALLBACK_COMMIT stage.
authorFelipe Leme <felipeal@google.com>
Wed, 23 Jan 2019 01:59:48 +0000 (17:59 -0800)
committerFelipe Leme <felipeal@google.com>
Fri, 25 Jan 2019 17:47:27 +0000 (09:47 -0800)
commit26cbd718964d2a5474e97e5385e733452283cec4
tree853bfe236c39107db687400ab9a8442bd584d839
parent3175839d6c604e3f5481b7614d94be52d7593543
Post expensive ContentCapture calls to Choreographer's CALLBACK_COMMIT stage.

onProvideContentCaptureStructure() doesn't take much for only 1 view, but it's called for all views
the first time the view hiearchy is laid off, which could acccumulative delay the
initial layout. Hence, we're postponing it to a later stage - it might still cost a
lost frame (or more), but that jank cost would only happen after the 1st layout.

Using this change, the impact on cold-dropcache-test dropped about 50% (from ~2ms to ~1ms).

Bug: 123307965
Bug: 121039624
Test: atest ContentCaptureSession
Test: atest google/perf/app-startup/benchmark-app-hermetic/cold-dropcache-test

Change-Id: I68b98b2894d23309af90d87cc99280f133557252
core/java/android/view/View.java