Merge "Update the light center when the root view\'s layout changed" into nyc-dev

am: e78ba24c17

* commit 'e78ba24c176fd6a0c54eaf7e52be545952ba1ab7':
  Update the light center when the root view's layout changed

Change-Id: I03e6d183e2a98b4d08f1e5be74447ddf942e8337
This commit is contained in:
Teng-Hui Zhu
2016-05-26 17:53:31 +00:00
committed by android-build-merger
2 changed files with 15 additions and 3 deletions

View File

@@ -22811,6 +22811,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/ */
boolean mKeepScreenOn; boolean mKeepScreenOn;
/**
* Set during a traveral if the light center needs to be updated.
*/
boolean mNeedsUpdateLightCenter;
/** /**
* Bitwise-or of all of the values that views have passed to setSystemUiVisibility(). * Bitwise-or of all of the values that views have passed to setSystemUiVisibility().
*/ */

View File

@@ -80,7 +80,6 @@ import android.view.accessibility.IAccessibilityInteractionConnection;
import android.view.accessibility.IAccessibilityInteractionConnectionCallback; import android.view.accessibility.IAccessibilityInteractionConnectionCallback;
import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator; import android.view.animation.Interpolator;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.Scroller; import android.widget.Scroller;
@@ -920,6 +919,11 @@ public final class ViewRootImpl implements ViewParent,
// Recompute system ui visibility. // Recompute system ui visibility.
mAttachInfo.mRecomputeGlobalAttributes = true; mAttachInfo.mRecomputeGlobalAttributes = true;
} }
if ((mWindowAttributesChangesFlag
& WindowManager.LayoutParams.LAYOUT_CHANGED) != 0) {
// Request to update light center.
mAttachInfo.mNeedsUpdateLightCenter = true;
}
if (mWindowAttributes.packageName == null) { if (mWindowAttributes.packageName == null) {
mWindowAttributes.packageName = mBasePackageName; mWindowAttributes.packageName = mBasePackageName;
} }
@@ -2226,13 +2230,16 @@ public final class ViewRootImpl implements ViewParent,
} }
mAttachInfo.mWindowLeft = frame.left; mAttachInfo.mWindowLeft = frame.left;
mAttachInfo.mWindowTop = frame.top; mAttachInfo.mWindowTop = frame.top;
}
// Update the light position for the new window offsets. if (windowMoved || mAttachInfo.mNeedsUpdateLightCenter) {
// Update the light position for the new offsets.
if (mAttachInfo.mHardwareRenderer != null) { if (mAttachInfo.mHardwareRenderer != null) {
mAttachInfo.mHardwareRenderer.setLightCenter(mAttachInfo); mAttachInfo.mHardwareRenderer.setLightCenter(mAttachInfo);
} }
mAttachInfo.mNeedsUpdateLightCenter = false;
} }
} }
private void handleOutOfResourcesException(Surface.OutOfResourcesException e) { private void handleOutOfResourcesException(Surface.OutOfResourcesException e) {
Log.e(mTag, "OutOfResourcesException initializing HW surface", e); Log.e(mTag, "OutOfResourcesException initializing HW surface", e);
try { try {