Merge changes from topic "release_buffer_cache_id" into tm-dev am: 14c5e3d34d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17100719

Change-Id: Icb95f5bfe2381357460ca3fc4c102b8d1b50a3dc
This commit is contained in:
Rob Carr
2022-03-24 18:36:05 +00:00
committed by Automerger Merge Worker
2 changed files with 17 additions and 13 deletions

View File

@@ -595,6 +595,9 @@ public final class ViewRootImpl implements ViewParent,
*/
private boolean mSyncBuffer = false;
int mSyncSeqId = 0;
int mLastSyncSeqId = 0;
boolean mFullRedrawNeeded;
boolean mNewSurfaceNeeded;
boolean mForceNextWindowRelayout;
@@ -855,8 +858,6 @@ public final class ViewRootImpl implements ViewParent,
* integer back over relayout.
*/
private Bundle mRelayoutBundle = new Bundle();
private int mSyncSeqId = 0;
private int mLastSyncSeqId = 0;
private String mTag = TAG;
@@ -2660,7 +2661,6 @@ public final class ViewRootImpl implements ViewParent,
private void performTraversals() {
// cache mView since it is used so much below...
final View host = mView;
if (DBG) {
System.out.println("======================================");
System.out.println("performTraversals");
@@ -3499,13 +3499,15 @@ public final class ViewRootImpl implements ViewParent,
}
Consumer<Transaction> syncConsumer = null;
final int seqId = mSyncSeqId;
if (mBLASTDrawConsumer != null) {
syncConsumer = mBLASTDrawConsumer;
mBLASTDrawConsumer = null;
} else if (mReportNextDraw) {
syncConsumer = transaction -> {
mSurfaceChangedTransaction.merge(transaction);
reportDrawFinished();
reportDrawFinished(seqId);
};
}
@@ -4133,13 +4135,13 @@ public final class ViewRootImpl implements ViewParent,
}
}
private void reportDrawFinished() {
private void reportDrawFinished(int seqId) {
if (DEBUG_BLAST) {
Log.d(mTag, "reportDrawFinished " + Debug.getCallers(5));
}
try {
mWindowSession.finishDrawing(mWindow, mSurfaceChangedTransaction, Integer.MAX_VALUE);
mWindowSession.finishDrawing(mWindow, mSurfaceChangedTransaction, seqId);
} catch (RemoteException e) {
Log.e(mTag, "Unable to report draw finished", e);
mSurfaceChangedTransaction.apply();
@@ -4212,6 +4214,7 @@ public final class ViewRootImpl implements ViewParent,
final BackgroundBlurDrawable.BlurRegion[] blurRegionsForFrame =
mBlurRegionAggregator.getBlurRegionsCopyForRT();
// The callback will run on the render thread.
registerRtFrameCallback((frame) -> mBlurRegionAggregator
.dispatchBlurTransactionIfNeeded(frame, blurRegionsForFrame, hasBlurUpdates));
@@ -7955,7 +7958,6 @@ public final class ViewRootImpl implements ViewParent,
private int relayoutWindow(WindowManager.LayoutParams params, int viewVisibility,
boolean insetsPending) throws RemoteException {
mRelayoutRequested = true;
float appScale = mAttachInfo.mApplicationScale;
boolean restore = false;
@@ -8528,7 +8530,8 @@ public final class ViewRootImpl implements ViewParent,
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
private void dispatchResized(ClientWindowFrames frames, boolean reportDraw,
MergedConfiguration mergedConfiguration, boolean forceLayout,
boolean alwaysConsumeSystemBars, int displayId, int seqId, int resizeMode) {
boolean alwaysConsumeSystemBars, int displayId, int syncSeqId, int resizeMode) {
Message msg = mHandler.obtainMessage(reportDraw ? MSG_RESIZED_REPORT : MSG_RESIZED);
SomeArgs args = SomeArgs.obtain();
final boolean sameProcessCall = (Binder.getCallingPid() == android.os.Process.myPid());
@@ -8538,8 +8541,9 @@ public final class ViewRootImpl implements ViewParent,
args.argi1 = forceLayout ? 1 : 0;
args.argi2 = alwaysConsumeSystemBars ? 1 : 0;
args.argi3 = displayId;
args.argi4 = seqId;
args.argi4 = syncSeqId;
args.argi5 = resizeMode;
msg.obj = args;
mHandler.sendMessage(msg);
}
@@ -9929,11 +9933,11 @@ public final class ViewRootImpl implements ViewParent,
@Override
public void resized(ClientWindowFrames frames, boolean reportDraw,
MergedConfiguration mergedConfiguration, boolean forceLayout,
boolean alwaysConsumeSystemBars, int displayId, int seqId, int resizeMode) {
boolean alwaysConsumeSystemBars, int displayId, int syncSeqId, int resizeMode) {
final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
viewAncestor.dispatchResized(frames, reportDraw, mergedConfiguration, forceLayout,
alwaysConsumeSystemBars, displayId, seqId, resizeMode);
alwaysConsumeSystemBars, displayId, syncSeqId, resizeMode);
}
}

View File

@@ -3962,8 +3962,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
try {
mClient.resized(mClientWindowFrames, reportDraw, mLastReportedConfiguration,
forceRelayout, alwaysConsumeSystemBars, displayId, Integer.MAX_VALUE,
resizeMode);
forceRelayout, alwaysConsumeSystemBars, displayId, mSyncSeqId, resizeMode);
if (drawPending && reportOrientation && mOrientationChanging) {
mOrientationChangeRedrawRequestTime = SystemClock.elapsedRealtime();
ProtoLog.v(WM_DEBUG_ORIENTATION,