summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewRootImpl.java
diff options
context:
space:
mode:
authorRobert Carr <racarr@google.com>2021-06-08 15:38:21 -0700
committerRobert Carr <racarr@google.com>2021-07-13 13:22:58 -0700
commite9c2e84d28b6e336789b94d119b759bc8738be4d (patch)
tree6b98738ea44eb50b7b2cfc2ce2d0d3337623959b /core/java/android/view/ViewRootImpl.java
parent74c65d260033ea16787adaf8a415bda0b75a163d (diff)
ViewRootImpl: Use mWindowAttributes directly for BBQ
The logic we are using to handle the params == null case doesn't make sense, params=null just indicates nothing was changing on this relayout and so we avoid passing to WM, not that we should default the format. We can just use mWindowAttributes directly to avoid this problem. Test: Existing tests pass Bug: 190483641 Change-Id: I4a765914eb8ca33a432fc808af96847bb78fb054
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
-rw-r--r--core/java/android/view/ViewRootImpl.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 23faac6c0787..50155ad00ce9 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1948,22 +1948,23 @@ public final class ViewRootImpl implements ViewParent,
return mBoundsLayer;
}
- Surface getOrCreateBLASTSurface(int width, int height,
- @Nullable WindowManager.LayoutParams params) {
+ Surface getOrCreateBLASTSurface() {
if (!mSurfaceControl.isValid()) {
return null;
}
- int format = params == null ? PixelFormat.TRANSLUCENT : params.format;
Surface ret = null;
if (mBlastBufferQueue == null) {
- mBlastBufferQueue = new BLASTBufferQueue(mTag, mSurfaceControl, width, height,
- format);
+ mBlastBufferQueue = new BLASTBufferQueue(mTag, mSurfaceControl,
+ mSurfaceSize.x, mSurfaceSize.y,
+ mWindowAttributes.format);
// We only return the Surface the first time, as otherwise
// it hasn't changed and there is no need to update.
ret = mBlastBufferQueue.createSurface();
} else {
- mBlastBufferQueue.update(mSurfaceControl, width, height, format);
+ mBlastBufferQueue.update(mSurfaceControl,
+ mSurfaceSize.x, mSurfaceSize.y,
+ mWindowAttributes.format);
}
return ret;
@@ -7769,8 +7770,7 @@ public final class ViewRootImpl implements ViewParent,
if (!useBLAST()) {
mSurface.copyFrom(mSurfaceControl);
} else {
- final Surface blastSurface = getOrCreateBLASTSurface(mSurfaceSize.x, mSurfaceSize.y,
- params);
+ final Surface blastSurface = getOrCreateBLASTSurface();
// If blastSurface == null that means it hasn't changed since the last time we
// called. In this situation, avoid calling transferFrom as we would then
// inc the generation ID and cause EGL resources to be recreated.