Commit ab615682 by olly Committed by Oliver Woodman

Fix green screen problem when using VpxRenderer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120689946
parent 854acaa1
...@@ -78,6 +78,7 @@ import javax.microedition.khronos.opengles.GL10; ...@@ -78,6 +78,7 @@ import javax.microedition.khronos.opengles.GL10;
private int program; private int program;
private int texLocation; private int texLocation;
private int colorMatrixLocation; private int colorMatrixLocation;
private FloatBuffer textureCoords;
private int previousWidth; private int previousWidth;
private int previousStride; private int previousStride;
...@@ -170,7 +171,9 @@ import javax.microedition.khronos.opengles.GL10; ...@@ -170,7 +171,9 @@ import javax.microedition.khronos.opengles.GL10;
// Set cropping of stride if either width or stride has changed. // Set cropping of stride if either width or stride has changed.
if (previousWidth != outputBuffer.width || previousStride != outputBuffer.yuvStrides[0]) { if (previousWidth != outputBuffer.width || previousStride != outputBuffer.yuvStrides[0]) {
float crop = (float) outputBuffer.width / 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, 0.0f,
0.0f, 1.0f, 0.0f, 1.0f,
crop, 0.0f, crop, 0.0f,
......
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