Merge "Do not set early wakeup flag for inset animations" into rvc-dev am: ed3c321c9f

Change-Id: I9b2978c189c273f630ceee64ee8939e739be239d
This commit is contained in:
Automerger Merge Worker
2020-03-10 12:17:32 +00:00
4 changed files with 14 additions and 8 deletions

View File

@@ -724,12 +724,13 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
mApplier = new SyncRtSurfaceTransactionApplier(mViewRoot.mView);
}
if (mViewRoot.mView.isHardwareAccelerated()) {
mApplier.scheduleApply(params);
mApplier.scheduleApply(false /* earlyWakeup */, params);
} else {
// Window doesn't support hardware acceleration, no synchronization for now.
// TODO(b/149342281): use mViewRoot.mSurface.getNextFrameNumber() to sync on every
// frame instead.
mApplier.applyParams(new Transaction(), -1 /* frame */, params);
mApplier.applyParams(new Transaction(), -1 /* frame */, false /* earlyWakeup */,
params);
}
}

View File

@@ -605,7 +605,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
mTmpRect.set(0, 0, mSurfaceWidth, mSurfaceHeight);
}
SyncRtSurfaceTransactionApplier applier = new SyncRtSurfaceTransactionApplier(this);
applier.scheduleApply(
applier.scheduleApply(false /* earlyWakeup */,
new SyncRtSurfaceTransactionApplier.SurfaceParams.Builder(mSurfaceControl)
.withWindowCrop(mTmpRect)
.build());

View File

@@ -53,10 +53,11 @@ public class SyncRtSurfaceTransactionApplier {
/**
* Schedules applying surface parameters on the next frame.
*
* @param earlyWakeup Whether to set {@link Transaction#setEarlyWakeup()} on transaction.
* @param params The surface parameters to apply. DO NOT MODIFY the list after passing into
* this method to avoid synchronization issues.
*/
public void scheduleApply(final SurfaceParams... params) {
public void scheduleApply(boolean earlyWakeup, final SurfaceParams... params) {
if (mTargetViewRootImpl == null) {
return;
}
@@ -66,7 +67,7 @@ public class SyncRtSurfaceTransactionApplier {
return;
}
Transaction t = new Transaction();
applyParams(t, frame, params);
applyParams(t, frame, earlyWakeup, params);
});
// Make sure a frame gets scheduled.
@@ -77,10 +78,12 @@ public class SyncRtSurfaceTransactionApplier {
* Applies surface parameters on the next frame.
* @param t transaction to apply all parameters in.
* @param frame frame to synchronize to. Set -1 when sync is not required.
* @param earlyWakeup Whether to set {@link Transaction#setEarlyWakeup()} on transaction.
* @param params The surface parameters to apply. DO NOT MODIFY the list after passing into
* this method to avoid synchronization issues.
*/
void applyParams(Transaction t, long frame, final SurfaceParams... params) {
void applyParams(Transaction t, long frame, boolean earlyWakeup,
final SurfaceParams... params) {
for (int i = params.length - 1; i >= 0; i--) {
SurfaceParams surfaceParams = params[i];
SurfaceControl surface = surfaceParams.surface;
@@ -89,7 +92,9 @@ public class SyncRtSurfaceTransactionApplier {
}
applyParams(t, surfaceParams, mTmpFloat9);
}
t.setEarlyWakeup();
if (earlyWakeup) {
t.setEarlyWakeup();
}
t.apply();
}

View File

@@ -282,7 +282,7 @@ public class ActivityLaunchAnimator {
.withCornerRadius(mCornerRadius)
.withVisibility(true)
.build();
mSyncRtTransactionApplier.scheduleApply(params);
mSyncRtTransactionApplier.scheduleApply(true /* earlyWakeup */, params);
}
@Override