Commit ccd61b1c by hschlueter Committed by Ian Baker

Don't reallocate EGLSurface for same debug surface.

Recreating an EGLSurface for a surface that already has an
EGLSurface is not allowed according to the
[documentation](https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglCreatePlatformWindowSurface.xhtml).

This fix was tested on the devices listed in the bug
description (Pixel 5a, Nexus 5).

PiperOrigin-RevId: 450473569
parent ecea2b9e
...@@ -602,10 +602,13 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -602,10 +602,13 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@Override @Override
public synchronized void surfaceChanged( public synchronized void surfaceChanged(
SurfaceHolder holder, int format, int width, int height) { SurfaceHolder holder, int format, int width, int height) {
surface = holder.getSurface();
eglSurface = null;
this.width = width; this.width = width;
this.height = height; this.height = height;
Surface newSurface = holder.getSurface();
if (surface == null || !surface.equals(newSurface)) {
surface = newSurface;
eglSurface = null;
}
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment