ScreenRotationAnimation: Use Surface#setScalingMode
We are the last user of SurfaceControl#setOverrideScalingMode in ScreenRotationAnimation we have no need to call it since we are the BufferProducer and we can just use Surface#setScalingMode Bug: 161937501 Test: Existing tests pass Change-Id: I049145a91fedbbca5f009648f1537b0380c5e771
This commit is contained in:
@@ -739,7 +739,7 @@ public class Surface implements Parcelable {
|
||||
* Set the scaling mode to be used for this surfaces buffers
|
||||
* @hide
|
||||
*/
|
||||
void setScalingMode(@ScalingMode int scalingMode) {
|
||||
public void setScalingMode(@ScalingMode int scalingMode) {
|
||||
synchronized (mLock) {
|
||||
checkNotReleasedLocked();
|
||||
int err = nativeSetScalingMode(mNativeObject, scalingMode);
|
||||
|
||||
@@ -203,16 +203,14 @@ class ScreenRotationAnimation {
|
||||
.setCallsite("ScreenRotationAnimation")
|
||||
.build();
|
||||
|
||||
// In case display bounds change, screenshot buffer and surface may mismatch so set a
|
||||
// scaling mode.
|
||||
SurfaceControl.Transaction t2 = mService.mTransactionFactory.get();
|
||||
t2.setOverrideScalingMode(mScreenshotLayer, Surface.SCALING_MODE_SCALE_TO_WINDOW);
|
||||
t2.apply(true /* sync */);
|
||||
|
||||
// Capture a screenshot into the surface we just created.
|
||||
final int displayId = displayContent.getDisplayId();
|
||||
final Surface surface = mService.mSurfaceFactory.get();
|
||||
// In case display bounds change, screenshot buffer and surface may mismatch so set a
|
||||
// scaling mode.
|
||||
surface.copyFrom(mScreenshotLayer);
|
||||
surface.setScalingMode(Surface.SCALING_MODE_SCALE_TO_WINDOW);
|
||||
|
||||
SurfaceControl.ScreenshotHardwareBuffer screenshotBuffer =
|
||||
mService.mDisplayManagerInternal.systemScreenshot(displayId);
|
||||
if (screenshotBuffer != null) {
|
||||
|
||||
Reference in New Issue
Block a user