Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion services/core/java/com/android/server/display/ColorFade.java
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ private boolean captureScreenshotTextureAndSetViewport() {
if (!attachEglContext()) {
return false;
}
SurfaceTexture st = null;
try {
if (!mTexNamesGenerated) {
GLES20.glGenTextures(1, mTexNames, 0);
Expand All @@ -459,7 +460,7 @@ private boolean captureScreenshotTextureAndSetViewport() {
mTexNamesGenerated = true;
}

final SurfaceTexture st = new SurfaceTexture(mTexNames[0]);
st = new SurfaceTexture(mTexNames[0]);
final Surface s = new Surface(st);
try {
SurfaceControl.screenshot(SurfaceControl.getBuiltInDisplay(
Expand All @@ -483,6 +484,8 @@ private boolean captureScreenshotTextureAndSetViewport() {
GLES20.glViewport(0, 0, mDisplayWidth, mDisplayHeight);
ortho(0, mDisplayWidth, 0, mDisplayHeight, -1, 1);
} finally {
if (st != null)
st.release();
detachEglContext();
}
return true;
Expand Down