| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.android.wm.shell.common; |
| 18 |
|
| 19 |
import android.view.SurfaceControl; |
| 20 |
import android.view.SurfaceSession; |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
public class SurfaceUtils { |
| 26 |
|
| 27 |
public static SurfaceControl makeDimLayer(SurfaceControl.Transaction t, SurfaceControl host, |
| 28 |
String name, SurfaceSession surfaceSession) { |
| 29 |
final SurfaceControl dimLayer = makeColorLayer(host, name, surfaceSession); |
| 30 |
t.setLayer(dimLayer, Integer.MAX_VALUE).setColor(dimLayer, new float[]{0f, 0f, 0f}); |
| 31 |
return dimLayer; |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
public static SurfaceControl makeColorLayer(SurfaceControl host, String name, |
| 36 |
SurfaceSession surfaceSession) { |
| 37 |
return new SurfaceControl.Builder(surfaceSession) |
| 38 |
.setParent(host) |
| 39 |
.setColorLayer() |
| 40 |
.setName(name) |
| 41 |
.setCallsite("SurfaceUtils.makeColorLayer") |
| 42 |
.build(); |
| 43 |
} |
| 44 |
} |