diff options
| author | 2019-09-06 04:58:57 +0000 | |
|---|---|---|
| committer | 2019-09-06 04:58:57 +0000 | |
| commit | c5a1fb3d2eb55f697beb8ca68a50055e8cd761b6 (patch) | |
| tree | e6d09c6869bcb86171d88cf6ef140cbdea5252ff | |
| parent | f09d52d3e08fb863fe1c302f48a3ae1c12a1247c (diff) | |
| parent | 15d0ac57f79b8eac469394391ecdc5c45b67da6d (diff) | |
Merge "Reduce relayoutWindow when requestTransparentRegion"
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 23 | ||||
| -rw-r--r-- | core/java/android/view/WindowManager.java | 2 |
2 files changed, 11 insertions, 14 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 3a51eaa5d7d1..85aba3c3f535 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -468,7 +468,6 @@ public final class ViewRootImpl implements ViewParent, private final UnhandledKeyManager mUnhandledKeyManager = new UnhandledKeyManager(); boolean mWindowAttributesChanged = false; - int mWindowAttributesChangesFlag = 0; // These can be accessed by any thread, must be protected with a lock. // Surface can never be reassigned or cleared (use Surface.clear()). @@ -865,7 +864,6 @@ public final class ViewRootImpl implements ViewParent, mSoftInputMode = attrs.softInputMode; mWindowAttributesChanged = true; - mWindowAttributesChangesFlag = WindowManager.LayoutParams.EVERYTHING_CHANGED; mAttachInfo.mRootView = view; mAttachInfo.mScalingRequired = mTranslator != null; mAttachInfo.mApplicationScale = @@ -1269,14 +1267,12 @@ public final class ViewRootImpl implements ViewParent, attrs.systemUiVisibility = mWindowAttributes.systemUiVisibility; attrs.subtreeSystemUiVisibility = mWindowAttributes.subtreeSystemUiVisibility; - mWindowAttributesChangesFlag = mWindowAttributes.copyFrom(attrs); - if ((mWindowAttributesChangesFlag - & WindowManager.LayoutParams.TRANSLUCENT_FLAGS_CHANGED) != 0) { + final int changes = mWindowAttributes.copyFrom(attrs); + if ((changes & WindowManager.LayoutParams.TRANSLUCENT_FLAGS_CHANGED) != 0) { // Recompute system ui visibility. mAttachInfo.mRecomputeGlobalAttributes = true; } - if ((mWindowAttributesChangesFlag - & WindowManager.LayoutParams.LAYOUT_CHANGED) != 0) { + if ((changes & WindowManager.LayoutParams.LAYOUT_CHANGED) != 0) { // Request to update light center. mAttachInfo.mNeedsUpdateLightCenter = true; } @@ -2037,8 +2033,6 @@ public final class ViewRootImpl implements ViewParent, } } - mWindowAttributesChangesFlag = 0; - Rect frame = mWinFrame; if (mFirst) { mFullRedrawNeeded = true; @@ -3313,14 +3307,19 @@ public final class ViewRootImpl implements ViewParent, public void requestTransparentRegion(View child) { // the test below should not fail unless someone is messing with us checkThread(); - if (mView == child) { + if (mView != child) { + return; + } + + if ((mView.mPrivateFlags & View.PFLAG_REQUEST_TRANSPARENT_REGIONS) == 0) { mView.mPrivateFlags |= View.PFLAG_REQUEST_TRANSPARENT_REGIONS; // Need to make sure we re-evaluate the window attributes next // time around, to ensure the window has the correct format. mWindowAttributesChanged = true; - mWindowAttributesChangesFlag = 0; - requestLayout(); } + + // Always request layout to apply the latest transparent region. + requestLayout(); } /** diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 9cd356f6d653..b2d70321178e 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -2891,8 +2891,6 @@ public interface WindowManager extends ViewManager { public static final int COLOR_MODE_CHANGED = 1 << 26; /** {@hide} */ public static final int INSET_FLAGS_CHANGED = 1 << 27; - /** {@hide} */ - public static final int EVERYTHING_CHANGED = 0xffffffff; // internal buffer to backup/restore parameters under compatibility mode. private int[] mCompatibilityParamsBackup = null; |