Apply window crop on entering PiP transition

For entering PiP transition in button navigation mode, there seems to be
regression causing the black background when there is no source rect
hint being set.

Work around this by explicitly applying window crop on the start of transition.

Video: http://rcll/aaaaaabFQoRHlzixHdtY/e9o986ZD7jO0rI14rrwoRZ
Bug: 178242567
Test: See video
Change-Id: I89ba5a41f0d6fc7ad9873455348b22db3f364615
This commit is contained in:
Hongwei Wang
2021-01-27 11:49:50 -08:00
parent e363da1269
commit 1c2ffc5410

View File

@@ -469,6 +469,11 @@ public class PipAnimationController {
getSurfaceTransactionHelper()
.alpha(tx, leash, 1f)
.round(tx, leash, shouldApplyCornerRadius());
// TODO(b/178632364): this is a work around for the black background when
// entering PiP in buttion navigation mode.
if (isInPipDirection(direction)) {
tx.setWindowCrop(leash, getStartValue());
}
tx.show(leash);
tx.apply();
}