Loading core/java/android/view/ViewRootImpl.java +33 −5 Original line number Diff line number Diff line Loading @@ -666,6 +666,8 @@ public final class ViewRootImpl implements ViewParent, private ScrollCaptureConnection mScrollCaptureConnection; private boolean mIsSurfaceOpaque; private final BackgroundBlurDrawable.Aggregator mBlurRegionAggregator = new BackgroundBlurDrawable.Aggregator(this); Loading Loading @@ -2716,6 +2718,14 @@ public final class ViewRootImpl implements ViewParent, mViewFrameInfo.flags |= FrameInfo.FLAG_WINDOW_LAYOUT_CHANGED; } relayoutResult = relayoutWindow(params, viewVisibility, insetsPending); final boolean freeformResizing = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_FREEFORM) != 0; final boolean dockedResizing = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_DOCKED) != 0; final boolean dragResizing = freeformResizing || dockedResizing; if (mSurfaceControl.isValid()) { updateOpacity(params, dragResizing); } if (DEBUG_LAYOUT) Log.v(mTag, "relayout: frame=" + frame.toShortString() + " surface=" + mSurface); Loading Loading @@ -2840,11 +2850,6 @@ public final class ViewRootImpl implements ViewParent, notifySurfaceReplaced(); } final boolean freeformResizing = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_FREEFORM) != 0; final boolean dockedResizing = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_DOCKED) != 0; final boolean dragResizing = freeformResizing || dockedResizing; if (mDragResizing != dragResizing) { if (dragResizing) { mResizeMode = freeformResizing Loading Loading @@ -7640,6 +7645,29 @@ public final class ViewRootImpl implements ViewParent, return relayoutResult; } private void updateOpacity(@Nullable WindowManager.LayoutParams params, boolean dragResizing) { boolean opaque = false; if (params != null && !PixelFormat.formatHasAlpha(params.format) // Don't make surface with surfaceInsets opaque as they display a // translucent shadow. && params.surfaceInsets.left == 0 && params.surfaceInsets.top == 0 && params.surfaceInsets.right == 0 && params.surfaceInsets.bottom == 0 // Don't make surface opaque when resizing to reduce the amount of // artifacts shown in areas the app isn't drawing content to. && !dragResizing) { opaque = true; } if (mIsSurfaceOpaque == opaque) { return; } mTransaction.setOpaque(mSurfaceControl, opaque).apply(); mIsSurfaceOpaque = opaque; } private void setFrame(Rect frame) { mWinFrame.set(frame); mInsetsController.onFrameChanged(frame); Loading services/core/java/com/android/server/wm/WindowStateAnimator.java +1 −12 Original line number Diff line number Diff line Loading @@ -443,20 +443,9 @@ class WindowStateAnimator { // Set up surface control with initial size. try { // This can be removed once we move all Buffer Layers to use BLAST. final boolean isHwAccelerated = (attrs.flags & FLAG_HARDWARE_ACCELERATED) != 0; final int format = isHwAccelerated ? PixelFormat.TRANSLUCENT : attrs.format; if (!PixelFormat.formatHasAlpha(attrs.format) // Don't make surface with surfaceInsets opaque as they display a // translucent shadow. && attrs.surfaceInsets.left == 0 && attrs.surfaceInsets.top == 0 && attrs.surfaceInsets.right == 0 && attrs.surfaceInsets.bottom == 0 // Don't make surface opaque when resizing to reduce the amount of // artifacts shown in areas the app isn't drawing content to. && !w.isDragResizing()) { flags |= SurfaceControl.OPAQUE; } mSurfaceController = new WindowSurfaceController(attrs.getTitle().toString(), width, height, format, flags, this, windowType); Loading Loading
core/java/android/view/ViewRootImpl.java +33 −5 Original line number Diff line number Diff line Loading @@ -666,6 +666,8 @@ public final class ViewRootImpl implements ViewParent, private ScrollCaptureConnection mScrollCaptureConnection; private boolean mIsSurfaceOpaque; private final BackgroundBlurDrawable.Aggregator mBlurRegionAggregator = new BackgroundBlurDrawable.Aggregator(this); Loading Loading @@ -2716,6 +2718,14 @@ public final class ViewRootImpl implements ViewParent, mViewFrameInfo.flags |= FrameInfo.FLAG_WINDOW_LAYOUT_CHANGED; } relayoutResult = relayoutWindow(params, viewVisibility, insetsPending); final boolean freeformResizing = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_FREEFORM) != 0; final boolean dockedResizing = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_DOCKED) != 0; final boolean dragResizing = freeformResizing || dockedResizing; if (mSurfaceControl.isValid()) { updateOpacity(params, dragResizing); } if (DEBUG_LAYOUT) Log.v(mTag, "relayout: frame=" + frame.toShortString() + " surface=" + mSurface); Loading Loading @@ -2840,11 +2850,6 @@ public final class ViewRootImpl implements ViewParent, notifySurfaceReplaced(); } final boolean freeformResizing = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_FREEFORM) != 0; final boolean dockedResizing = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_DOCKED) != 0; final boolean dragResizing = freeformResizing || dockedResizing; if (mDragResizing != dragResizing) { if (dragResizing) { mResizeMode = freeformResizing Loading Loading @@ -7640,6 +7645,29 @@ public final class ViewRootImpl implements ViewParent, return relayoutResult; } private void updateOpacity(@Nullable WindowManager.LayoutParams params, boolean dragResizing) { boolean opaque = false; if (params != null && !PixelFormat.formatHasAlpha(params.format) // Don't make surface with surfaceInsets opaque as they display a // translucent shadow. && params.surfaceInsets.left == 0 && params.surfaceInsets.top == 0 && params.surfaceInsets.right == 0 && params.surfaceInsets.bottom == 0 // Don't make surface opaque when resizing to reduce the amount of // artifacts shown in areas the app isn't drawing content to. && !dragResizing) { opaque = true; } if (mIsSurfaceOpaque == opaque) { return; } mTransaction.setOpaque(mSurfaceControl, opaque).apply(); mIsSurfaceOpaque = opaque; } private void setFrame(Rect frame) { mWinFrame.set(frame); mInsetsController.onFrameChanged(frame); Loading
services/core/java/com/android/server/wm/WindowStateAnimator.java +1 −12 Original line number Diff line number Diff line Loading @@ -443,20 +443,9 @@ class WindowStateAnimator { // Set up surface control with initial size. try { // This can be removed once we move all Buffer Layers to use BLAST. final boolean isHwAccelerated = (attrs.flags & FLAG_HARDWARE_ACCELERATED) != 0; final int format = isHwAccelerated ? PixelFormat.TRANSLUCENT : attrs.format; if (!PixelFormat.formatHasAlpha(attrs.format) // Don't make surface with surfaceInsets opaque as they display a // translucent shadow. && attrs.surfaceInsets.left == 0 && attrs.surfaceInsets.top == 0 && attrs.surfaceInsets.right == 0 && attrs.surfaceInsets.bottom == 0 // Don't make surface opaque when resizing to reduce the amount of // artifacts shown in areas the app isn't drawing content to. && !w.isDragResizing()) { flags |= SurfaceControl.OPAQUE; } mSurfaceController = new WindowSurfaceController(attrs.getTitle().toString(), width, height, format, flags, this, windowType); Loading