Merge "Remove the frame number from WindowManagerService"

This commit is contained in:
Tiger Huang
2022-01-25 14:11:20 +00:00
committed by Android (Google) Code Review
10 changed files with 10 additions and 39 deletions

View File

@@ -136,7 +136,6 @@ public class RelayoutPerfTest extends WindowManagerPerfTestBase
final IntSupplier mViewVisibility;
int mFrameNumber;
int mFlags;
RelayoutRunner(Activity activity, IWindow window, IntSupplier visibilitySupplier) {
@@ -153,7 +152,7 @@ public class RelayoutPerfTest extends WindowManagerPerfTestBase
final IWindowSession session = WindowManagerGlobal.getWindowSession();
while (state.keepRunning()) {
session.relayout(mWindow, mParams, mWidth, mHeight,
mViewVisibility.getAsInt(), mFlags, mFrameNumber, mOutFrames,
mViewVisibility.getAsInt(), mFlags, mOutFrames,
mOutMergedConfiguration, mOutSurfaceControl, mOutInsetsState, mOutControls);
}
}

View File

@@ -1142,7 +1142,7 @@ public abstract class WallpaperService extends Service {
final int relayoutResult = mSession.relayout(
mWindow, mLayout, mWidth, mHeight,
View.VISIBLE, 0, -1, mWinFrames, mMergedConfiguration, mSurfaceControl,
View.VISIBLE, 0, mWinFrames, mMergedConfiguration, mSurfaceControl,
mInsetsState, mTempControls);
final int transformHint = SurfaceControl.rotationToBufferTransform(

View File

@@ -74,7 +74,6 @@ interface IWindowSession {
* @param viewVisibility Window root view's visibility.
* @param flags Request flags: {@link WindowManagerGlobal#RELAYOUT_INSETS_PENDING},
* {@link WindowManagerGlobal#RELAYOUT_DEFER_SURFACE_DESTROY}.
* @param frameNumber A frame number in which changes requested in this layout will be rendered.
* @param outFrame Rect in which is placed the new position/size on
* screen.
* @param outContentInsets Rect in which is placed the offsets from
@@ -103,7 +102,7 @@ interface IWindowSession {
*/
int relayout(IWindow window, in WindowManager.LayoutParams attrs,
int requestedWidth, int requestedHeight, int viewVisibility,
int flags, long frameNumber, out ClientWindowFrames outFrames,
int flags, out ClientWindowFrames outFrames,
out MergedConfiguration outMergedConfiguration, out SurfaceControl outSurfaceControl,
out InsetsState insetsState, out InsetsSourceControl[] activeControls);

View File

@@ -7933,14 +7933,9 @@ public final class ViewRootImpl implements ViewParent,
final int requestedWidth = (int) (mView.getMeasuredWidth() * appScale + 0.5f);
final int requestedHeight = (int) (mView.getMeasuredHeight() * appScale + 0.5f);
long frameNumber = -1;
if (mSurface.isValid()) {
frameNumber = mSurface.getNextFrameNumber();
}
int relayoutResult = mWindowSession.relayout(mWindow, params,
requestedWidth, requestedHeight, viewVisibility,
insetsPending ? WindowManagerGlobal.RELAYOUT_INSETS_PENDING : 0, frameNumber,
insetsPending ? WindowManagerGlobal.RELAYOUT_INSETS_PENDING : 0,
mTmpFrames, mPendingMergedConfiguration, mSurfaceControl, mTempInsets,
mTempControls);

View File

@@ -263,7 +263,7 @@ public class WindowlessWindowManager implements IWindowSession {
@Override
public int relayout(IWindow window, WindowManager.LayoutParams inAttrs,
int requestedWidth, int requestedHeight, int viewFlags, int flags, long frameNumber,
int requestedWidth, int requestedHeight, int viewFlags, int flags,
ClientWindowFrames outFrames, MergedConfiguration mergedConfiguration,
SurfaceControl outSurfaceControl, InsetsState outInsetsState,
InsetsSourceControl[] outActiveControls) {

View File

@@ -439,7 +439,7 @@ message WindowStateProto {
optional bool is_on_screen = 37;
optional bool is_visible = 38;
optional bool pending_seamless_rotation = 39;
optional int64 finished_seamless_rotation_frame = 40;
optional int64 finished_seamless_rotation_frame = 40 [deprecated=true];
optional WindowFramesProto window_frames = 41;
optional bool force_seamless_rotation = 42;
optional bool has_compat_scale = 43;

View File

@@ -241,7 +241,7 @@ public class TaskSnapshotWindow {
window.setOuter(snapshotSurface);
try {
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "TaskSnapshot#relayout");
session.relayout(window, layoutParams, -1, -1, View.VISIBLE, 0, -1,
session.relayout(window, layoutParams, -1, -1, View.VISIBLE, 0,
tmpFrames, tmpMergedConfiguration, surfaceControl, tmpInsetsState,
tmpControls);
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);

View File

@@ -221,7 +221,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
@Override
public int relayout(IWindow window, WindowManager.LayoutParams attrs,
int requestedWidth, int requestedHeight, int viewFlags, int flags, long frameNumber,
int requestedWidth, int requestedHeight, int viewFlags, int flags,
ClientWindowFrames outFrames, MergedConfiguration mergedConfiguration,
SurfaceControl outSurfaceControl, InsetsState outInsetsState,
InsetsSourceControl[] outActiveControls) {
@@ -229,7 +229,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
+ Binder.getCallingPid());
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, mRelayoutTag);
int res = mService.relayoutWindow(this, window, attrs,
requestedWidth, requestedHeight, viewFlags, flags, frameNumber,
requestedWidth, requestedHeight, viewFlags, flags,
outFrames, mergedConfiguration, outSurfaceControl, outInsetsState,
outActiveControls);
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);

View File

@@ -2180,7 +2180,7 @@ public class WindowManagerService extends IWindowManager.Stub
public int relayoutWindow(Session session, IWindow client, LayoutParams attrs,
int requestedWidth, int requestedHeight, int viewVisibility, int flags,
long frameNumber, ClientWindowFrames outFrames, MergedConfiguration mergedConfiguration,
ClientWindowFrames outFrames, MergedConfiguration mergedConfiguration,
SurfaceControl outSurfaceControl, InsetsState outInsetsState,
InsetsSourceControl[] outActiveControls) {
Arrays.fill(outActiveControls, null);
@@ -2202,8 +2202,6 @@ public class WindowManagerService extends IWindowManager.Stub
win.setRequestedSize(requestedWidth, requestedHeight);
}
win.setFrameNumber(frameNumber);
int attrChanges = 0;
int flagChanges = 0;
int privateFlagChanges = 0;

View File

@@ -163,7 +163,6 @@ import static com.android.server.wm.WindowStateProto.ANIMATOR;
import static com.android.server.wm.WindowStateProto.ATTRIBUTES;
import static com.android.server.wm.WindowStateProto.DESTROYING;
import static com.android.server.wm.WindowStateProto.DISPLAY_ID;
import static com.android.server.wm.WindowStateProto.FINISHED_SEAMLESS_ROTATION_FRAME;
import static com.android.server.wm.WindowStateProto.FORCE_SEAMLESS_ROTATION;
import static com.android.server.wm.WindowStateProto.GIVEN_CONTENT_INSETS;
import static com.android.server.wm.WindowStateProto.GLOBAL_SCALE;
@@ -380,7 +379,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
*/
final boolean mForceSeamlesslyRotate;
SeamlessRotator mPendingSeamlessRotate;
long mFinishSeamlessRotateFrameNumber;
private RemoteCallbackList<IWindowFocusObserver> mFocusCallbacks;
@@ -706,11 +704,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
*/
private PowerManagerWrapper mPowerManagerWrapper;
/**
* A frame number in which changes requested in this layout will be rendered.
*/
private long mFrameNumber = -1;
private static final StringBuilder sTmpSB = new StringBuilder();
/**
@@ -969,7 +962,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
}
mPendingSeamlessRotate.finish(t, this);
mFinishSeamlessRotateFrameNumber = getFrameNumber();
mPendingSeamlessRotate = null;
getDisplayContent().getDisplayRotation().markForSeamlessRotation(this,
@@ -4122,7 +4114,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
proto.write(IS_ON_SCREEN, isOnScreen());
proto.write(IS_VISIBLE, isVisible);
proto.write(PENDING_SEAMLESS_ROTATION, mPendingSeamlessRotate != null);
proto.write(FINISHED_SEAMLESS_ROTATION_FRAME, mFinishSeamlessRotateFrameNumber);
proto.write(FORCE_SEAMLESS_ROTATION, mForceSeamlesslyRotate);
proto.write(HAS_COMPAT_SCALE, hasCompatScale());
proto.write(GLOBAL_SCALE, mGlobalScale);
@@ -4264,7 +4255,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
} else {
pw.print("null");
}
pw.println(" finishedFrameNumber=" + mFinishSeamlessRotateFrameNumber);
if (mHScale != 1 || mVScale != 1) {
pw.println(prefix + "mHScale=" + mHScale
@@ -5633,16 +5623,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return target != null ? target.getWindow() : null;
}
long getFrameNumber() {
// Return the frame number in which changes requested in this layout will be rendered or
// -1 if we do not expect the frame to be rendered.
return getFrame().isEmpty() ? -1 : mFrameNumber;
}
void setFrameNumber(long frameNumber) {
mFrameNumber = frameNumber;
}
void forceReportingResized() {
mWindowFrames.forceReportingResized();
}