Merge "Do not set early wakeup flag for inset animations" into rvc-dev am: ed3c321c9f am: 976aa9e24f
Change-Id: I2f94c61e6aedf8c808ff185bac6eae0c1e8410c0
This commit is contained in:
@@ -724,12 +724,13 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
|
|||||||
mApplier = new SyncRtSurfaceTransactionApplier(mViewRoot.mView);
|
mApplier = new SyncRtSurfaceTransactionApplier(mViewRoot.mView);
|
||||||
}
|
}
|
||||||
if (mViewRoot.mView.isHardwareAccelerated()) {
|
if (mViewRoot.mView.isHardwareAccelerated()) {
|
||||||
mApplier.scheduleApply(params);
|
mApplier.scheduleApply(false /* earlyWakeup */, params);
|
||||||
} else {
|
} else {
|
||||||
// Window doesn't support hardware acceleration, no synchronization for now.
|
// Window doesn't support hardware acceleration, no synchronization for now.
|
||||||
// TODO(b/149342281): use mViewRoot.mSurface.getNextFrameNumber() to sync on every
|
// TODO(b/149342281): use mViewRoot.mSurface.getNextFrameNumber() to sync on every
|
||||||
// frame instead.
|
// frame instead.
|
||||||
mApplier.applyParams(new Transaction(), -1 /* frame */, params);
|
mApplier.applyParams(new Transaction(), -1 /* frame */, false /* earlyWakeup */,
|
||||||
|
params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -605,7 +605,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
|
|||||||
mTmpRect.set(0, 0, mSurfaceWidth, mSurfaceHeight);
|
mTmpRect.set(0, 0, mSurfaceWidth, mSurfaceHeight);
|
||||||
}
|
}
|
||||||
SyncRtSurfaceTransactionApplier applier = new SyncRtSurfaceTransactionApplier(this);
|
SyncRtSurfaceTransactionApplier applier = new SyncRtSurfaceTransactionApplier(this);
|
||||||
applier.scheduleApply(
|
applier.scheduleApply(false /* earlyWakeup */,
|
||||||
new SyncRtSurfaceTransactionApplier.SurfaceParams.Builder(mSurfaceControl)
|
new SyncRtSurfaceTransactionApplier.SurfaceParams.Builder(mSurfaceControl)
|
||||||
.withWindowCrop(mTmpRect)
|
.withWindowCrop(mTmpRect)
|
||||||
.build());
|
.build());
|
||||||
|
|||||||
@@ -53,10 +53,11 @@ public class SyncRtSurfaceTransactionApplier {
|
|||||||
/**
|
/**
|
||||||
* Schedules applying surface parameters on the next frame.
|
* 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
|
* @param params The surface parameters to apply. DO NOT MODIFY the list after passing into
|
||||||
* this method to avoid synchronization issues.
|
* this method to avoid synchronization issues.
|
||||||
*/
|
*/
|
||||||
public void scheduleApply(final SurfaceParams... params) {
|
public void scheduleApply(boolean earlyWakeup, final SurfaceParams... params) {
|
||||||
if (mTargetViewRootImpl == null) {
|
if (mTargetViewRootImpl == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -66,7 +67,7 @@ public class SyncRtSurfaceTransactionApplier {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Transaction t = new Transaction();
|
Transaction t = new Transaction();
|
||||||
applyParams(t, frame, params);
|
applyParams(t, frame, earlyWakeup, params);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Make sure a frame gets scheduled.
|
// Make sure a frame gets scheduled.
|
||||||
@@ -77,10 +78,12 @@ public class SyncRtSurfaceTransactionApplier {
|
|||||||
* Applies surface parameters on the next frame.
|
* Applies surface parameters on the next frame.
|
||||||
* @param t transaction to apply all parameters in.
|
* @param t transaction to apply all parameters in.
|
||||||
* @param frame frame to synchronize to. Set -1 when sync is not required.
|
* @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
|
* @param params The surface parameters to apply. DO NOT MODIFY the list after passing into
|
||||||
* this method to avoid synchronization issues.
|
* 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--) {
|
for (int i = params.length - 1; i >= 0; i--) {
|
||||||
SurfaceParams surfaceParams = params[i];
|
SurfaceParams surfaceParams = params[i];
|
||||||
SurfaceControl surface = surfaceParams.surface;
|
SurfaceControl surface = surfaceParams.surface;
|
||||||
@@ -89,7 +92,9 @@ public class SyncRtSurfaceTransactionApplier {
|
|||||||
}
|
}
|
||||||
applyParams(t, surfaceParams, mTmpFloat9);
|
applyParams(t, surfaceParams, mTmpFloat9);
|
||||||
}
|
}
|
||||||
t.setEarlyWakeup();
|
if (earlyWakeup) {
|
||||||
|
t.setEarlyWakeup();
|
||||||
|
}
|
||||||
t.apply();
|
t.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ public class ActivityLaunchAnimator {
|
|||||||
.withCornerRadius(mCornerRadius)
|
.withCornerRadius(mCornerRadius)
|
||||||
.withVisibility(true)
|
.withVisibility(true)
|
||||||
.build();
|
.build();
|
||||||
mSyncRtTransactionApplier.scheduleApply(params);
|
mSyncRtTransactionApplier.scheduleApply(true /* earlyWakeup */, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user