diff options
| author | Jorim Jaggi <jjaggi@google.com> | 2021-05-03 15:49:25 +0200 |
|---|---|---|
| committer | Jorim Jaggi <jjaggi@google.com> | 2021-05-03 15:49:25 +0200 |
| commit | 9516605d632adb8bce4f9163fb3c247be7c4a1b0 (patch) | |
| tree | e2b9af23f09468443b211ea10a0483fa898ad0ae /core/java/android/view/ViewRootImpl.java | |
| parent | 30de424ddf4971d4d2f9007fb11d77f4fe46b39b (diff) | |
Mark first frames in metrics properly
Such that we only set the flag in case window visibility actually
changes. There are a lot of other cases where we need to do a
window relayout which can lead to visible jank.
Test: FrameMetricsListenerTest, manual
Bug: 185902609
Change-Id: Ia09ce640f3a89bf9dd4ff0f4e4469e88a513709a
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 0958f3fbd771..a06f193255b2 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -2764,7 +2764,9 @@ public final class ViewRootImpl implements ViewParent, // to resume them mDirty.set(0, 0, mWidth, mHeight); } - mViewFrameInfo.flags |= FrameInfo.FLAG_WINDOW_LAYOUT_CHANGED; + } + if (mFirst || viewVisibilityChanged) { + mViewFrameInfo.flags |= FrameInfo.FLAG_WINDOW_VISIBILITY_CHANGED; } relayoutResult = relayoutWindow(params, viewVisibility, insetsPending); final boolean freeformResizing = (relayoutResult |
