Commit 82fcbd20 by claincly Committed by Tofunmi Adigun-Hameed

Fix recreation of DefaultShaderProgram in FinalWrapper

`outputSurfaceInfoChanged` is not reset when `defaultShaderProgram` is null.
That is, on the first time `ensureConfigured()` is called with output size
changed, `outputSurfaceInfoChanged` is not set to false after creating the
`defaultShaderProgram`, and `defaultShaderProgram` will be created again on the
second time `ensureConfigured()` is called.

PiperOrigin-RevId: 537870404
(cherry picked from commit 3d8a2f8b8a81f022d71a12abf3deaabd426ca8ca)
parent d5f0ff05
...@@ -461,14 +461,15 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -461,14 +461,15 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
defaultShaderProgram = null; defaultShaderProgram = null;
outputSurfaceInfoChanged = false; outputSurfaceInfoChanged = false;
} }
if (defaultShaderProgram == null) { if (defaultShaderProgram == null) {
defaultShaderProgram = defaultShaderProgram =
createDefaultShaderProgram( createDefaultShaderProgram(
outputSurfaceInfo == null ? 0 : outputSurfaceInfo.orientationDegrees, outputSurfaceInfo == null ? 0 : outputSurfaceInfo.orientationDegrees,
outputWidth, outputWidth,
outputHeight); outputHeight);
outputSurfaceInfoChanged = false;
} }
return true; return true;
} }
......
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