Remove binding framebuffer from GlTextureFrameBuffer.setSize.

There shouldn't be a need to bind the framebuffer to modify the texture
size. Binding the framebuffer causes a crash on Samsung Galaxy S3 mini
for some reason.

BUG=webrtc:6470

Review-Url: https://codereview.webrtc.org/2524003002
Cr-Commit-Position: refs/heads/master@{#15210}
This commit is contained in:
sakal
2016-11-23 06:12:26 -08:00
committed by Commit bot
parent 8e321c82eb
commit 1c82884e31

View File

@ -75,25 +75,13 @@ public class GlTextureFrameBuffer {
this.width = width;
this.height = height;
// Bind our framebuffer.
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, frameBufferId);
GlUtil.checkNoGLES2Error("glBindFramebuffer");
// Allocate texture.
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureId);
GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, pixelFormat, width, height, 0, pixelFormat,
GLES20.GL_UNSIGNED_BYTE, null);
// Check that the framebuffer is in a good state.
final int status = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);
if (status != GLES20.GL_FRAMEBUFFER_COMPLETE) {
throw new IllegalStateException("Framebuffer not complete, status: " + status);
}
// Restore normal framebuffer.
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
GlUtil.checkNoGLES2Error("GlTextureFrameBuffer setSize");
}
public int getWidth() {