Add glClear call before drawing.

PiperOrigin-RevId: 428492031
This commit is contained in:
hschlueter 2022-02-14 14:34:37 +00:00 committed by Ian Baker
parent 28b8ae7076
commit 015592f534

View File

@ -352,6 +352,8 @@ import java.util.concurrent.atomic.AtomicInteger;
/** Focuses the specified surface with the specified width and height, then draws a quad. */
private void focusAndDrawQuad(EGLSurface eglSurface, int width, int height) {
GlUtil.focusEglSurface(eglDisplay, eglContext, eglSurface, width, height);
GLES20.glClearColor(/* red= */ 0, /* green= */ 0, /* blue= */ 0, /* alpha= */ 0);
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
// The four-vertex triangle strip forms a quad.
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, /* first= */ 0, /* count= */ 4);
}