Merge "Remove crop for Windowless Window leash"

This commit is contained in:
Chavi Weingarten
2023-01-27 16:36:25 +00:00
committed by Android (Google) Code Review
4 changed files with 26 additions and 5 deletions

View File

@@ -361,7 +361,6 @@ public class WindowlessWindowManager implements IWindowSession {
}
t.setPosition(leash, frames.frame.left, frames.frame.top);
t.setWindowCrop(leash, frames.frame.width(), frames.frame.height());
if (viewFlags == View.VISIBLE) {
// TODO(b/262892794) ViewRootImpl modifies the app's rendering SurfaceControl

View File

@@ -250,6 +250,8 @@ void CanvasContext::setupPipelineSurface() {
// Order is important when new and old surfaces are the same, because old surface has
// its frame stats disabled automatically.
native_window_enable_frame_timestamps(mNativeSurface->getNativeWindow(), true);
native_window_set_scaling_mode(mNativeSurface->getNativeWindow(),
NATIVE_WINDOW_SCALING_MODE_FREEZE);
} else {
mRenderThread.removeFrameCallback(this);
mGenerationID++;

View File

@@ -22,6 +22,7 @@ import static android.server.wm.WindowManagerState.getLogicalDisplaySize;
import android.app.KeyguardManager;
import android.os.PowerManager;
import android.platform.test.annotations.Presubmit;
import android.view.SurfaceControl;
import android.view.cts.surfacevalidator.CapturedActivity;
import android.window.SurfaceSyncGroup;
@@ -68,11 +69,23 @@ public class SurfaceSyncGroupContinuousTest {
@Test
public void testSurfaceControlViewHostIPCSync_Fast() throws Throwable {
mCapturedActivity.verifyTest(new SyncValidatorSCVHTestCase(0 /* delayMs */), mName);
mCapturedActivity.verifyTest(
new SyncValidatorSCVHTestCase(0 /* delayMs */, false /* overrideDefaultDuration */),
mName);
}
@Test
public void testSurfaceControlViewHostIPCSync_Slow() throws Throwable {
mCapturedActivity.verifyTest(new SyncValidatorSCVHTestCase(100 /* delayMs */), mName);
mCapturedActivity.verifyTest(new SyncValidatorSCVHTestCase(100 /* delayMs */,
false /* overrideDefaultDuration */), mName);
}
@Test
@Presubmit
public void testSurfaceControlViewHostIPCSync_Short() throws Throwable {
mCapturedActivity.setMinimumCaptureDurationMs(5000);
mCapturedActivity.verifyTest(
new SyncValidatorSCVHTestCase(0 /* delayMs */, true /* overrideDefaultDuration */),
mName);
}
}

View File

@@ -54,10 +54,12 @@ public class SyncValidatorSCVHTestCase implements ISurfaceValidatorTestCase {
new Point(300, 800), new Point(200, 200)};
private int mLastSizeIndex = 1;
private long mDelayMs;
private final long mDelayMs;
private final boolean mOverrideDefaultDuration;
public SyncValidatorSCVHTestCase(long delayMs) {
public SyncValidatorSCVHTestCase(long delayMs, boolean overrideDefaultDuration) {
mDelayMs = delayMs;
mOverrideDefaultDuration = overrideDefaultDuration;
}
private final Runnable mRunnable = new Runnable() {
@@ -231,4 +233,9 @@ public class SyncValidatorSCVHTestCase implements ISurfaceValidatorTestCase {
public void end() {
mHandler.removeCallbacks(mRunnable);
}
@Override
public boolean hasAnimation() {
return !mOverrideDefaultDuration;
}
}