Merge "Sync transform of mirrored surface with the source" into udc-qpr-dev

This commit is contained in:
Riddle Hsu
2023-07-07 14:23:48 +00:00
committed by Android (Google) Code Review

View File

@@ -166,7 +166,7 @@ final class ContentRecorder implements WindowContainerListener {
+ "%d to new bounds %s and/or orientation %d.", + "%d to new bounds %s and/or orientation %d.",
mDisplayContent.getDisplayId(), recordedContentBounds, mDisplayContent.getDisplayId(), recordedContentBounds,
recordedContentOrientation); recordedContentOrientation);
updateMirroredSurface(mDisplayContent.mWmService.mTransactionFactory.get(), updateMirroredSurface(mRecordedWindowContainer.getSyncTransaction(),
recordedContentBounds, surfaceSize); recordedContentBounds, surfaceSize);
} else { } else {
// If the surface removed, do nothing. We will handle this via onDisplayChanged // If the surface removed, do nothing. We will handle this via onDisplayChanged
@@ -325,6 +325,7 @@ final class ContentRecorder implements WindowContainerListener {
.reparent(mDisplayContent.getOverlayLayer(), null); .reparent(mDisplayContent.getOverlayLayer(), null);
// Retrieve the size of the DisplayArea to mirror. // Retrieve the size of the DisplayArea to mirror.
updateMirroredSurface(transaction, mRecordedWindowContainer.getBounds(), surfaceSize); updateMirroredSurface(transaction, mRecordedWindowContainer.getBounds(), surfaceSize);
transaction.apply();
// Notify the client about the visibility of the mirrored region, now that we have begun // Notify the client about the visibility of the mirrored region, now that we have begun
// capture. // capture.
@@ -481,8 +482,7 @@ final class ContentRecorder implements WindowContainerListener {
.setMatrix(mRecordedSurface, scale, 0 /* dtdx */, 0 /* dtdy */, scale) .setMatrix(mRecordedSurface, scale, 0 /* dtdx */, 0 /* dtdy */, scale)
// Position needs to be updated when the mirrored DisplayArea has changed, since // Position needs to be updated when the mirrored DisplayArea has changed, since
// the content will no longer be centered in the output surface. // the content will no longer be centered in the output surface.
.setPosition(mRecordedSurface, shiftedX /* x */, shiftedY /* y */) .setPosition(mRecordedSurface, shiftedX /* x */, shiftedY /* y */);
.apply();
mLastRecordedBounds = new Rect(recordedContentBounds); mLastRecordedBounds = new Rect(recordedContentBounds);
// Request to notify the client about the resize. // Request to notify the client about the resize.
mMediaProjectionManager.notifyActiveProjectionCapturedContentResized( mMediaProjectionManager.notifyActiveProjectionCapturedContentResized(