Merge "Fixes for SyncRtSurfaceTransactionApplier" into pi-dev

This commit is contained in:
Jorim Jaggi
2018-05-18 17:24:43 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 5 deletions

View File

@@ -70,6 +70,9 @@ public class SyncRtSurfaceTransactionApplier {
t.setEarlyWakeup();
t.apply();
});
// Make sure a frame gets scheduled.
mTargetViewRootImpl.getView().invalidate();
}
public static class SurfaceParams {
@@ -83,9 +86,9 @@ public class SyncRtSurfaceTransactionApplier {
* @param matrix Matrix to apply.
* @param windowCrop Crop to apply.
*/
public SurfaceParams(SurfaceControl surface, float alpha, Matrix matrix, Rect windowCrop,
int layer) {
this.surface = surface;
public SurfaceParams(SurfaceControlCompat surface, float alpha, Matrix matrix,
Rect windowCrop, int layer) {
this.surface = surface.mSurfaceControl;
this.alpha = alpha;
this.matrix = new Matrix(matrix);
this.windowCrop = new Rect(windowCrop);

View File

@@ -30,6 +30,7 @@ import android.view.RemoteAnimationAdapter;
import android.view.RemoteAnimationTarget;
import com.android.systemui.Interpolators;
import com.android.systemui.shared.system.SurfaceControlCompat;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplier;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplier.SurfaceParams;
import com.android.systemui.statusbar.ExpandableNotificationRow;
@@ -245,8 +246,8 @@ public class ActivityLaunchAnimator {
Matrix m = new Matrix();
m.postTranslate(0, (float) (mParams.top - app.position.y));
mWindowCrop.set(mParams.left, 0, mParams.right, mParams.getHeight());
SurfaceParams params = new SurfaceParams(app.leash, 1f /* alpha */, m, mWindowCrop,
app.prefixOrderIndex);
SurfaceParams params = new SurfaceParams(new SurfaceControlCompat(app.leash),
1f /* alpha */, m, mWindowCrop, app.prefixOrderIndex);
mSyncRtTransactionApplier.scheduleApply(params);
}