Skip to content

Commit 924d9b7

Browse files
author
Craig Mautner
committed
Force BlackSurface to be a black surface.
BlackSurface transparency was tracking animation transparency causing background images to peek around the corners. Fixes bug 4998851. Change-Id: I48ac7bf5d0cc560b655c9f12faccda411985cbad
1 parent 139e5aa commit 924d9b7

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,17 @@ class BlackSurface {
4242
this.layer = layer;
4343
int w = r-l;
4444
int h = b-t;
45-
surface = new Surface(session, 0, "BlackSurface",
46-
-1, w, h, PixelFormat.OPAQUE, Surface.FX_SURFACE_DIM);
45+
if (WindowManagerService.DEBUG_SURFACE_TRACE) {
46+
surface = new WindowStateAnimator.SurfaceTrace(session, 0, "BlackSurface("
47+
+ l + ", " + t + ")",
48+
-1, w, h, PixelFormat.OPAQUE, Surface.FX_SURFACE_DIM);
49+
} else {
50+
surface = new Surface(session, 0, "BlackSurface",
51+
-1, w, h, PixelFormat.OPAQUE, Surface.FX_SURFACE_DIM);
52+
}
53+
surface.setAlpha(1);
54+
surface.setLayer(layer);
55+
surface.show();
4756
if (WindowManagerService.SHOW_TRANSACTIONS ||
4857
WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
4958
" BLACK " + surface + ": CREATE layer=" + layer);
@@ -58,8 +67,6 @@ void setMatrix(Matrix matrix) {
5867
surface.setMatrix(
5968
mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y],
6069
mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]);
61-
surface.setAlpha(1.0f);
62-
surface.setLayer(layer);
6370
if (false) {
6471
Slog.i(WindowManagerService.TAG, "Black Surface @ (" + left + "," + top + "): ("
6572
+ mTmpFloats[Matrix.MTRANS_X] + ","
@@ -159,14 +166,6 @@ public void setMatrix(Matrix matrix) {
159166
}
160167
}
161168

162-
public void setAlpha(float alpha) {
163-
for (int i=0; i<mBlackSurfaces.length; i++) {
164-
if (mBlackSurfaces[i] != null) {
165-
mBlackSurfaces[i].surface.setAlpha(alpha);
166-
}
167-
}
168-
}
169-
170169
public void clearMatrix() {
171170
for (int i=0; i<mBlackSurfaces.length; i++) {
172171
if (mBlackSurfaces[i] != null) {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,6 @@ void updateSurfaces() {
862862
} else {
863863
mExitFrameFinalMatrix.setConcat(mExitTransformation.getMatrix(), mFrameInitialMatrix);
864864
mExitingBlackFrame.setMatrix(mExitFrameFinalMatrix);
865-
mExitingBlackFrame.setAlpha(mExitTransformation.getAlpha());
866865
}
867866
}
868867

0 commit comments

Comments
 (0)