Skip to content

Commit 76a3cb9

Browse files
author
Jeff Brown
committed
We don't need black frames for forced display size.
Now that surface flinger lets us set a display projection, the window manager no longer needs to place a black frame around the content when simulating a different display size. Bug: 7139798 Change-Id: I6014390f47444633d434ccf918cee5ff7b502869
1 parent cdfc56a commit 76a3cb9

File tree

2 files changed

+0
-62
lines changed

2 files changed

+0
-62
lines changed

services/java/com/android/server/wm/WindowAnimator.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -611,15 +611,6 @@ private void animateLocked() {
611611
!mService.okToDisplay());
612612
}
613613

614-
if (mService.mBlackFrame != null) {
615-
if (mScreenRotationAnimation != null) {
616-
mService.mBlackFrame.setMatrix(
617-
mScreenRotationAnimation.getEnterTransformation().getMatrix());
618-
} else {
619-
mService.mBlackFrame.clearMatrix();
620-
}
621-
}
622-
623614
if (mService.mWatermark != null) {
624615
mService.mWatermark.drawIfNeeded();
625616
}

services/java/com/android/server/wm/WindowManagerService.java

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,6 @@ public void onReceive(Context context, Intent intent) {
430430
Watermark mWatermark;
431431
StrictModeFlash mStrictModeFlash;
432432

433-
BlackFrame mBlackFrame;
434-
435433
final float[] mTmpFloats = new float[9];
436434

437435
boolean mDisplayReady;
@@ -6036,8 +6034,6 @@ public boolean updateRotationUncheckedLocked(boolean inTransaction) {
60366034
}
60376035
}
60386036

6039-
rebuildBlackFrameLocked();
6040-
60416037
final WindowList windows = displayContent.getWindowList();
60426038
for (int i = windows.size() - 1; i >= 0; i--) {
60436039
WindowState w = windows.get(i);
@@ -7854,49 +7850,7 @@ public void setForcedDisplaySize(int displayId, int width, int height) {
78547850
}
78557851
}
78567852

7857-
private void rebuildBlackFrameLocked() {
7858-
if (mBlackFrame != null) {
7859-
mBlackFrame.kill();
7860-
mBlackFrame = null;
7861-
}
7862-
// TODO(multidisplay): For now rotations are only main screen.
7863-
final DisplayContent displayContent = getDefaultDisplayContentLocked();
7864-
final Display display = displayContent.getDisplay();
7865-
if (displayContent.mBaseDisplayWidth < displayContent.mInitialDisplayWidth
7866-
|| displayContent.mBaseDisplayHeight < displayContent.mInitialDisplayHeight) {
7867-
int initW, initH, baseW, baseH;
7868-
final boolean rotated = (mRotation == Surface.ROTATION_90
7869-
|| mRotation == Surface.ROTATION_270);
7870-
if (DEBUG_BOOT) {
7871-
Slog.i(TAG, "BLACK FRAME: rotated=" + rotated + " init="
7872-
+ displayContent.mInitialDisplayWidth + "x"
7873-
+ displayContent.mInitialDisplayHeight + " base="
7874-
+ displayContent.mBaseDisplayWidth + "x"
7875-
+ displayContent.mBaseDisplayHeight);
7876-
}
7877-
if (rotated) {
7878-
initW = displayContent.mInitialDisplayHeight;
7879-
initH = displayContent.mInitialDisplayWidth;
7880-
baseW = displayContent.mBaseDisplayHeight;
7881-
baseH = displayContent.mBaseDisplayWidth;
7882-
} else {
7883-
initW = displayContent.mInitialDisplayWidth;
7884-
initH = displayContent.mInitialDisplayHeight;
7885-
baseW = displayContent.mBaseDisplayWidth;
7886-
baseH = displayContent.mBaseDisplayHeight;
7887-
}
7888-
Rect outer = new Rect(0, 0, initW, initH);
7889-
Rect inner = new Rect(0, 0, baseW, baseH);
7890-
try {
7891-
mBlackFrame = new BlackFrame(mFxSession, outer, inner, MASK_LAYER,
7892-
display.getLayerStack());
7893-
} catch (Surface.OutOfResourcesException e) {
7894-
}
7895-
}
7896-
}
7897-
78987853
private void readForcedDisplaySizeAndDensityLocked(final DisplayContent displayContent) {
7899-
boolean changed = false;
79007854
final String sizeStr = Settings.Global.getString(mContext.getContentResolver(),
79017855
Settings.Global.DISPLAY_SIZE_FORCED);
79027856
if (sizeStr != null && sizeStr.length() > 0) {
@@ -7909,7 +7863,6 @@ private void readForcedDisplaySizeAndDensityLocked(final DisplayContent displayC
79097863
synchronized(displayContent.mDisplaySizeLock) {
79107864
if (displayContent.mBaseDisplayWidth != width
79117865
|| displayContent.mBaseDisplayHeight != height) {
7912-
changed = true;
79137866
Slog.i(TAG, "FORCED DISPLAY SIZE: " + width + "x" + height);
79147867
displayContent.mBaseDisplayWidth = width;
79157868
displayContent.mBaseDisplayHeight = height;
@@ -7927,17 +7880,13 @@ private void readForcedDisplaySizeAndDensityLocked(final DisplayContent displayC
79277880
density = Integer.parseInt(densityStr);
79287881
synchronized(displayContent.mDisplaySizeLock) {
79297882
if (displayContent.mBaseDisplayDensity != density) {
7930-
changed = true;
79317883
Slog.i(TAG, "FORCED DISPLAY DENSITY: " + density);
79327884
displayContent.mBaseDisplayDensity = density;
79337885
}
79347886
}
79357887
} catch (NumberFormatException ex) {
79367888
}
79377889
}
7938-
if (changed) {
7939-
rebuildBlackFrameLocked();
7940-
}
79417890
}
79427891

79437892
private void setForcedDisplaySizeLocked(DisplayContent displayContent, int width, int height) {
@@ -8011,8 +7960,6 @@ private void reconfigureDisplayLocked(DisplayContent displayContent) {
80117960
mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
80127961
}
80137962

8014-
rebuildBlackFrameLocked();
8015-
80167963
performLayoutAndPlaceSurfacesLocked();
80177964
}
80187965

0 commit comments

Comments
 (0)