Android SurfaceViewRenderer: Call glClear() for every frame to avoid bad GL state

BUG=webrtc:5147

Review URL: https://codereview.webrtc.org/1436883002

Cr-Commit-Position: refs/heads/master@{#10617}
This commit is contained in:
magjed
2015-11-12 01:08:32 -08:00
committed by Commit bot
parent 96839648a0
commit fc6affc60d

View File

@ -465,6 +465,9 @@ public class SurfaceViewRenderer extends SurfaceView
} }
GLES20.glViewport(0, 0, surfaceWidth, surfaceHeight); GLES20.glViewport(0, 0, surfaceWidth, surfaceHeight);
// TODO(magjed): glClear() shouldn't be necessary since every pixel is covered anyway, but it's
// a workaround for bug 5147. Performance will be slightly worse.
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
if (frame.yuvFrame) { if (frame.yuvFrame) {
// Make sure YUV textures are allocated. // Make sure YUV textures are allocated.
if (yuvTextures == null) { if (yuvTextures == null) {