summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/WindowStateAnimator.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index 3251a56d860e..5ae7c9422199 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -1277,6 +1277,7 @@ class WindowStateAnimator {
if (displayContent == null) {
return;
}
+ final DisplayInfo displayInfo = displayContent.getDisplayInfo();
// Need to recompute a new system decor rect each time.
if ((w.mAttrs.flags & LayoutParams.FLAG_SCALED) != 0) {
@@ -1286,7 +1287,6 @@ class WindowStateAnimator {
} else if (!w.isDefaultDisplay()) {
// On a different display there is no system decor. Crop the window
// by the screen boundaries.
- final DisplayInfo displayInfo = displayContent.getDisplayInfo();
w.mSystemDecorRect.set(0, 0, w.mCompatFrame.width(), w.mCompatFrame.height());
w.mSystemDecorRect.intersect(-w.mCompatFrame.left, -w.mCompatFrame.top,
displayInfo.logicalWidth - w.mCompatFrame.left,
@@ -1308,9 +1308,11 @@ class WindowStateAnimator {
applyDecorRect(w.mDecorFrame);
}
- // By default, the clip rect is the system decor if the transformation doesn't specify one.
+ final boolean fullscreen = w.isFullscreen(displayInfo.appWidth, displayInfo.appHeight);
final Rect clipRect = mTmpClipRect;
- clipRect.set((mHasClipRect) ? mClipRect : w.mSystemDecorRect);
+ // We use the clip rect as provided by the tranformation for non-fullscreen windows to
+ // avoid premature clipping with the system decor rect.
+ clipRect.set((mHasClipRect && !fullscreen) ? mClipRect : w.mSystemDecorRect);
// Expand the clip rect for surface insets.
final WindowManager.LayoutParams attrs = w.mAttrs;
@@ -1319,6 +1321,13 @@ class WindowStateAnimator {
clipRect.right += attrs.surfaceInsets.right;
clipRect.bottom += attrs.surfaceInsets.bottom;
+ if (mHasClipRect && fullscreen) {
+ // We intersect the clip rect specified by the transformation with the expanded system
+ // decor rect to prevent artifacts from drawing during animation if the transformation
+ // clip rect extends outside the system decor rect.
+ clipRect.intersect(mClipRect);
+ }
+
// The clip rect was generated assuming (0,0) as the window origin,
// so we need to translate to match the actual surface coordinates.
clipRect.offset(attrs.surfaceInsets.left, attrs.surfaceInsets.top);