Fix green screen problem when using VpxRenderer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120689946
This commit is contained in:
olly 2016-04-25 02:53:38 -07:00 committed by Oliver Woodman
parent 854acaa1ac
commit ab615682b5

View file

@ -78,6 +78,7 @@ import javax.microedition.khronos.opengles.GL10;
private int program;
private int texLocation;
private int colorMatrixLocation;
private FloatBuffer textureCoords;
private int previousWidth;
private int previousStride;
@ -170,7 +171,9 @@ import javax.microedition.khronos.opengles.GL10;
// Set cropping of stride if either width or stride has changed.
if (previousWidth != outputBuffer.width || previousStride != outputBuffer.yuvStrides[0]) {
float crop = (float) outputBuffer.width / outputBuffer.yuvStrides[0];
FloatBuffer textureCoords = nativeFloatBuffer(
// This buffer is consumed during each call to glDrawArrays. It needs to be a member variable
// rather than a local variable to ensure that it doesn't get garbage collected.
textureCoords = nativeFloatBuffer(
0.0f, 0.0f,
0.0f, 1.0f,
crop, 0.0f,