WM/ViewRootImpl: Fix convertFromTranslucent to respect existing state.
Code-paths triggered by convertFromTranslucent end up setting an opaque state both on the client side and the WindowManager side, without appropriately checking to see if we were already non-opaque before we were convertedToTranslucent. Bug:126897750 Test: Manual Change-Id: I2d19624be31330100b61615fabae04899d95cda9
This commit is contained in:
@@ -8279,6 +8279,7 @@ public final class ViewRootImpl implements ViewParent,
|
||||
|
||||
void changeCanvasOpacity(boolean opaque) {
|
||||
Log.d(mTag, "changeCanvasOpacity: opaque=" + opaque);
|
||||
opaque = opaque & ((mView.mPrivateFlags & View.PFLAG_REQUEST_TRANSPARENT_REGIONS) == 0);
|
||||
if (mAttachInfo.mThreadedRenderer != null) {
|
||||
mAttachInfo.mThreadedRenderer.setOpaque(opaque);
|
||||
}
|
||||
|
||||
@@ -137,6 +137,7 @@ import android.database.ContentObserver;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Insets;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
@@ -2607,9 +2608,11 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
final AppWindowToken wtoken = mRoot.getAppWindowToken(token);
|
||||
if (wtoken != null) {
|
||||
final WindowState win = wtoken.findMainWindow();
|
||||
if (win != null) {
|
||||
win.mWinAnimator.setOpaqueLocked(isOpaque);
|
||||
if (win == null) {
|
||||
return;
|
||||
}
|
||||
isOpaque = isOpaque & !PixelFormat.formatHasAlpha(win.getAttrs().format);
|
||||
win.mWinAnimator.setOpaqueLocked(isOpaque);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user