Merge "Use legacy layer name for screenshot shell display rotation" into tm-qpr-dev
This commit is contained in:
@@ -2155,8 +2155,12 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
|
|||||||
Slog.w(TAG, "Failed to capture screenshot for " + wc);
|
Slog.w(TAG, "Failed to capture screenshot for " + wc);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
final boolean isDisplayRotation = wc.asDisplayContent() != null
|
||||||
|
&& wc.asDisplayContent().isRotationChanging();
|
||||||
|
// Some tests may check the name "RotationLayer" to detect display rotation.
|
||||||
|
final String name = isDisplayRotation ? "RotationLayer" : "transition snapshot: " + wc;
|
||||||
SurfaceControl snapshotSurface = wc.makeAnimationLeash()
|
SurfaceControl snapshotSurface = wc.makeAnimationLeash()
|
||||||
.setName("transition snapshot: " + wc.toString())
|
.setName(name)
|
||||||
.setOpaque(true)
|
.setOpaque(true)
|
||||||
.setParent(wc.getSurfaceControl())
|
.setParent(wc.getSurfaceControl())
|
||||||
.setSecure(screenshotBuffer.containsSecureLayers())
|
.setSecure(screenshotBuffer.containsSecureLayers())
|
||||||
@@ -2166,9 +2170,8 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
|
|||||||
mFrozen.add(wc);
|
mFrozen.add(wc);
|
||||||
final ChangeInfo changeInfo = Objects.requireNonNull(mChanges.get(wc));
|
final ChangeInfo changeInfo = Objects.requireNonNull(mChanges.get(wc));
|
||||||
changeInfo.mSnapshot = snapshotSurface;
|
changeInfo.mSnapshot = snapshotSurface;
|
||||||
if (wc.asDisplayContent() != null) {
|
if (isDisplayRotation) {
|
||||||
// This isn't cheap, so only do it for rotations: assume display-level is rotate
|
// This isn't cheap, so only do it for display rotations.
|
||||||
// since most of the time it is.
|
|
||||||
changeInfo.mSnapshotLuma = RotationAnimationUtils.getMedianBorderLuma(
|
changeInfo.mSnapshotLuma = RotationAnimationUtils.getMedianBorderLuma(
|
||||||
screenshotBuffer.getHardwareBuffer(), screenshotBuffer.getColorSpace());
|
screenshotBuffer.getHardwareBuffer(), screenshotBuffer.getColorSpace());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user