Loading services/core/java/com/android/server/display/DisplayDevice.java +27 −2 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ abstract class DisplayDevice { private int mCurrentLayerStack = -1; private int mCurrentFlags = 0; private int mCurrentOrientation = -1; private int mLastDisplayWidth; private int mLastDisplayHeight; private Rect mCurrentLayerStackRect; private Rect mCurrentDisplayRect; private final Context mContext; Loading Loading @@ -216,9 +218,9 @@ abstract class DisplayDevice { } /** * Gives the display device a chance to update its properties while in a transaction. * Updates the surface for the display. */ public void performTraversalLocked(SurfaceControl.Transaction t) { public void configureSurfaceLocked(SurfaceControl.Transaction t) { } /** Loading Loading @@ -373,6 +375,29 @@ abstract class DisplayDevice { } } /** * Configure transaction with the display size. */ public void configureDisplaySizeLocked(SurfaceControl.Transaction t) { DisplayDeviceInfo info = getDisplayDeviceInfoLocked(); boolean isInstalledRotated = info.installOrientation == ROTATION_90 || info.installOrientation == ROTATION_270; int displayWidth = isInstalledRotated ? info.height : info.width; int displayHeight = isInstalledRotated ? info.width : info.height; setDisplaySizeLocked(t, displayWidth, displayHeight); } /** * Sets display size while in a transaction. */ public final void setDisplaySizeLocked(SurfaceControl.Transaction t, int width, int height) { if (width != mLastDisplayWidth && height != mLastDisplayHeight) { mLastDisplayWidth = width; mLastDisplayHeight = height; t.setDisplaySize(mDisplayToken, width, height); } } /** * Sets the display surface while in a transaction. */ Loading services/core/java/com/android/server/display/DisplayManagerService.java +0 −1 Original line number Diff line number Diff line Loading @@ -3122,7 +3122,6 @@ public final class DisplayManagerService extends SystemService { displayTransactions.get(display.getDisplayIdLocked(), t); if (device != null) { configureDisplayLocked(displayTransaction, device); device.performTraversalLocked(displayTransaction); } }); Loading services/core/java/com/android/server/display/LogicalDisplay.java +11 −2 Original line number Diff line number Diff line Loading @@ -228,14 +228,17 @@ final class LogicalDisplay { */ private final boolean mIsAnisotropyCorrectionEnabled; private final boolean mSyncedResolutionSwitchEnabled; private boolean mCanHostTasks; LogicalDisplay(int displayId, int layerStack, DisplayDevice primaryDisplayDevice) { this(displayId, layerStack, primaryDisplayDevice, false, false); this(displayId, layerStack, primaryDisplayDevice, false, false, false); } LogicalDisplay(int displayId, int layerStack, DisplayDevice primaryDisplayDevice, boolean isAnisotropyCorrectionEnabled, boolean isAlwaysRotateDisplayDeviceEnabled) { boolean isAnisotropyCorrectionEnabled, boolean isAlwaysRotateDisplayDeviceEnabled, boolean isSyncedResolutionSwitchEnabled) { mDisplayId = displayId; mLayerStack = layerStack; mPrimaryDisplayDevice = primaryDisplayDevice; Loading @@ -248,6 +251,7 @@ final class LogicalDisplay { mBaseDisplayInfo.thermalBrightnessThrottlingDataId = mThermalBrightnessThrottlingDataId; mIsAnisotropyCorrectionEnabled = isAnisotropyCorrectionEnabled; mAlwaysRotateDisplayDeviceEnabled = isAlwaysRotateDisplayDeviceEnabled; mSyncedResolutionSwitchEnabled = isSyncedResolutionSwitchEnabled; mCanHostTasks = (mDisplayId == Display.DEFAULT_DISPLAY); } Loading Loading @@ -791,7 +795,12 @@ final class LogicalDisplay { } mDisplayPosition.set(mTempDisplayRect.left, mTempDisplayRect.top); if (mSyncedResolutionSwitchEnabled || displayDeviceInfo.type == Display.TYPE_VIRTUAL) { device.configureDisplaySizeLocked(t); } device.setProjectionLocked(t, orientation, mTempLayerStackRect, mTempDisplayRect); device.configureSurfaceLocked(t); } /** Loading services/core/java/com/android/server/display/LogicalDisplayMapper.java +2 −1 Original line number Diff line number Diff line Loading @@ -1248,7 +1248,8 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener { final int layerStack = assignLayerStackLocked(displayId); final LogicalDisplay display = new LogicalDisplay(displayId, layerStack, device, mFlags.isPixelAnisotropyCorrectionInLogicalDisplayEnabled(), mFlags.isAlwaysRotateDisplayDeviceEnabled()); mFlags.isAlwaysRotateDisplayDeviceEnabled(), mFlags.isSyncedResolutionSwitchEnabled()); display.updateLocked(mDisplayDeviceRepo, mSyntheticModeManager); final DisplayInfo info = display.getDisplayInfoLocked(); Loading services/core/java/com/android/server/display/OverlayDisplayAdapter.java +1 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,7 @@ final class OverlayDisplayAdapter extends DisplayAdapter { } @Override public void performTraversalLocked(SurfaceControl.Transaction t) { public void configureSurfaceLocked(SurfaceControl.Transaction t) { if (mSurfaceTexture != null) { if (mSurface == null) { mSurface = new Surface(mSurfaceTexture); Loading Loading
services/core/java/com/android/server/display/DisplayDevice.java +27 −2 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ abstract class DisplayDevice { private int mCurrentLayerStack = -1; private int mCurrentFlags = 0; private int mCurrentOrientation = -1; private int mLastDisplayWidth; private int mLastDisplayHeight; private Rect mCurrentLayerStackRect; private Rect mCurrentDisplayRect; private final Context mContext; Loading Loading @@ -216,9 +218,9 @@ abstract class DisplayDevice { } /** * Gives the display device a chance to update its properties while in a transaction. * Updates the surface for the display. */ public void performTraversalLocked(SurfaceControl.Transaction t) { public void configureSurfaceLocked(SurfaceControl.Transaction t) { } /** Loading Loading @@ -373,6 +375,29 @@ abstract class DisplayDevice { } } /** * Configure transaction with the display size. */ public void configureDisplaySizeLocked(SurfaceControl.Transaction t) { DisplayDeviceInfo info = getDisplayDeviceInfoLocked(); boolean isInstalledRotated = info.installOrientation == ROTATION_90 || info.installOrientation == ROTATION_270; int displayWidth = isInstalledRotated ? info.height : info.width; int displayHeight = isInstalledRotated ? info.width : info.height; setDisplaySizeLocked(t, displayWidth, displayHeight); } /** * Sets display size while in a transaction. */ public final void setDisplaySizeLocked(SurfaceControl.Transaction t, int width, int height) { if (width != mLastDisplayWidth && height != mLastDisplayHeight) { mLastDisplayWidth = width; mLastDisplayHeight = height; t.setDisplaySize(mDisplayToken, width, height); } } /** * Sets the display surface while in a transaction. */ Loading
services/core/java/com/android/server/display/DisplayManagerService.java +0 −1 Original line number Diff line number Diff line Loading @@ -3122,7 +3122,6 @@ public final class DisplayManagerService extends SystemService { displayTransactions.get(display.getDisplayIdLocked(), t); if (device != null) { configureDisplayLocked(displayTransaction, device); device.performTraversalLocked(displayTransaction); } }); Loading
services/core/java/com/android/server/display/LogicalDisplay.java +11 −2 Original line number Diff line number Diff line Loading @@ -228,14 +228,17 @@ final class LogicalDisplay { */ private final boolean mIsAnisotropyCorrectionEnabled; private final boolean mSyncedResolutionSwitchEnabled; private boolean mCanHostTasks; LogicalDisplay(int displayId, int layerStack, DisplayDevice primaryDisplayDevice) { this(displayId, layerStack, primaryDisplayDevice, false, false); this(displayId, layerStack, primaryDisplayDevice, false, false, false); } LogicalDisplay(int displayId, int layerStack, DisplayDevice primaryDisplayDevice, boolean isAnisotropyCorrectionEnabled, boolean isAlwaysRotateDisplayDeviceEnabled) { boolean isAnisotropyCorrectionEnabled, boolean isAlwaysRotateDisplayDeviceEnabled, boolean isSyncedResolutionSwitchEnabled) { mDisplayId = displayId; mLayerStack = layerStack; mPrimaryDisplayDevice = primaryDisplayDevice; Loading @@ -248,6 +251,7 @@ final class LogicalDisplay { mBaseDisplayInfo.thermalBrightnessThrottlingDataId = mThermalBrightnessThrottlingDataId; mIsAnisotropyCorrectionEnabled = isAnisotropyCorrectionEnabled; mAlwaysRotateDisplayDeviceEnabled = isAlwaysRotateDisplayDeviceEnabled; mSyncedResolutionSwitchEnabled = isSyncedResolutionSwitchEnabled; mCanHostTasks = (mDisplayId == Display.DEFAULT_DISPLAY); } Loading Loading @@ -791,7 +795,12 @@ final class LogicalDisplay { } mDisplayPosition.set(mTempDisplayRect.left, mTempDisplayRect.top); if (mSyncedResolutionSwitchEnabled || displayDeviceInfo.type == Display.TYPE_VIRTUAL) { device.configureDisplaySizeLocked(t); } device.setProjectionLocked(t, orientation, mTempLayerStackRect, mTempDisplayRect); device.configureSurfaceLocked(t); } /** Loading
services/core/java/com/android/server/display/LogicalDisplayMapper.java +2 −1 Original line number Diff line number Diff line Loading @@ -1248,7 +1248,8 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener { final int layerStack = assignLayerStackLocked(displayId); final LogicalDisplay display = new LogicalDisplay(displayId, layerStack, device, mFlags.isPixelAnisotropyCorrectionInLogicalDisplayEnabled(), mFlags.isAlwaysRotateDisplayDeviceEnabled()); mFlags.isAlwaysRotateDisplayDeviceEnabled(), mFlags.isSyncedResolutionSwitchEnabled()); display.updateLocked(mDisplayDeviceRepo, mSyntheticModeManager); final DisplayInfo info = display.getDisplayInfoLocked(); Loading
services/core/java/com/android/server/display/OverlayDisplayAdapter.java +1 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,7 @@ final class OverlayDisplayAdapter extends DisplayAdapter { } @Override public void performTraversalLocked(SurfaceControl.Transaction t) { public void configureSurfaceLocked(SurfaceControl.Transaction t) { if (mSurfaceTexture != null) { if (mSurface == null) { mSurface = new Surface(mSurfaceTexture); Loading