Set early-wake during transition animation
Parity with legacy. This tells surfaceflinger to allow more
time to composite frames during animations -- reduces likelihood
of missing frames.
Also, pause task-persisting during this period to avoid lock
contention (also parity w/ legacy).
Bug: 258881120
Test: run graphics/coldlaunch/open-youtube microbench and observe
aggregate for SFSTATS_GLOBAL_MISSEDFRAMES-mean
Change-Id: I29afc5dca935e7b5db338b9f85c405cccafe09cc
This commit is contained in:
@@ -38,6 +38,7 @@ import android.os.SystemProperties;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.Slog;
|
||||
import android.util.proto.ProtoOutputStream;
|
||||
import android.view.SurfaceControl;
|
||||
import android.view.WindowManager;
|
||||
import android.window.ITransitionMetricsReporter;
|
||||
import android.window.ITransitionPlayer;
|
||||
@@ -116,6 +117,8 @@ class TransitionController {
|
||||
*/
|
||||
boolean mBuildingFinishLayers = false;
|
||||
|
||||
private final SurfaceControl.Transaction mWakeT = new SurfaceControl.Transaction();
|
||||
|
||||
TransitionController(ActivityTaskManagerService atm,
|
||||
TaskSnapshotController taskSnapshotController,
|
||||
TransitionTracer transitionTracer) {
|
||||
@@ -619,8 +622,16 @@ class TransitionController {
|
||||
private void updateRunningRemoteAnimation(Transition transition, boolean isPlaying) {
|
||||
if (mTransitionPlayerProc == null) return;
|
||||
if (isPlaying) {
|
||||
mWakeT.setEarlyWakeupStart();
|
||||
mWakeT.apply();
|
||||
// Usually transitions put quite a load onto the system already (with all the things
|
||||
// happening in app), so pause task snapshot persisting to not increase the load.
|
||||
mAtm.mWindowManager.mTaskSnapshotController.setPersisterPaused(true);
|
||||
mTransitionPlayerProc.setRunningRemoteAnimation(true);
|
||||
} else if (mPlayingTransitions.isEmpty()) {
|
||||
mWakeT.setEarlyWakeupEnd();
|
||||
mWakeT.apply();
|
||||
mAtm.mWindowManager.mTaskSnapshotController.setPersisterPaused(false);
|
||||
mTransitionPlayerProc.setRunningRemoteAnimation(false);
|
||||
mRemotePlayer.clear();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user