Commit bf6b6470 by eguven Committed by Oliver Woodman

Rename spherical/Utils class to GlUtil

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207525621
parent 454b1069
...@@ -30,11 +30,11 @@ import java.nio.FloatBuffer; ...@@ -30,11 +30,11 @@ import java.nio.FloatBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
/** GL utility methods. */ /** GL utility methods. */
/*package*/ final class Utils { /*package*/ final class GlUtil {
private static final String TAG = "Spherical.Utils"; private static final String TAG = "Spherical.Utils";
/** Class only contains static methods. */ /** Class only contains static methods. */
private Utils() {} private GlUtil() {}
/** /**
* If there is an OpenGl error, logs the error and if {@link * If there is an OpenGl error, logs the error and if {@link
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
package com.google.android.exoplayer2.ui.spherical; package com.google.android.exoplayer2.ui.spherical;
import static com.google.android.exoplayer2.ui.spherical.Utils.checkGlError; import static com.google.android.exoplayer2.ui.spherical.GlUtil.checkGlError;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.opengl.GLES11Ext; import android.opengl.GLES11Ext;
...@@ -126,12 +126,12 @@ import java.nio.FloatBuffer; ...@@ -126,12 +126,12 @@ import java.nio.FloatBuffer;
/** Used by static constructors. */ /** Used by static constructors. */
private Mesh(float[] vertexData) { private Mesh(float[] vertexData) {
vertixCount = vertexData.length / COORDS_PER_VERTEX; vertixCount = vertexData.length / COORDS_PER_VERTEX;
vertexBuffer = Utils.createBuffer(vertexData); vertexBuffer = GlUtil.createBuffer(vertexData);
} }
/** Initializes of the GL components. */ /** Initializes of the GL components. */
/* package */ void init() { /* package */ void init() {
program = Utils.compileProgram(VERTEX_SHADER_CODE, FRAGMENT_SHADER_CODE); program = GlUtil.compileProgram(VERTEX_SHADER_CODE, FRAGMENT_SHADER_CODE);
mvpMatrixHandle = GLES20.glGetUniformLocation(program, "uMvpMatrix"); mvpMatrixHandle = GLES20.glGetUniformLocation(program, "uMvpMatrix");
positionHandle = GLES20.glGetAttribLocation(program, "aPosition"); positionHandle = GLES20.glGetAttribLocation(program, "aPosition");
texCoordsHandle = GLES20.glGetAttribLocation(program, "aTexCoords"); texCoordsHandle = GLES20.glGetAttribLocation(program, "aTexCoords");
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
package com.google.android.exoplayer2.ui.spherical; package com.google.android.exoplayer2.ui.spherical;
import static com.google.android.exoplayer2.ui.spherical.Utils.checkGlError; import static com.google.android.exoplayer2.ui.spherical.GlUtil.checkGlError;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.opengl.GLES20; import android.opengl.GLES20;
...@@ -49,7 +49,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -49,7 +49,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
GLES20.glClearColor(0.5f, 0.5f, 0.5f, 1.0f); GLES20.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
checkGlError(); checkGlError();
textureId = Utils.createExternalTexture(); textureId = GlUtil.createExternalTexture();
surfaceTexture = new SurfaceTexture(textureId); surfaceTexture = new SurfaceTexture(textureId);
surfaceTexture.setOnFrameAvailableListener(surfaceTexture -> frameAvailable.set(true)); surfaceTexture.setOnFrameAvailableListener(surfaceTexture -> frameAvailable.set(true));
return surfaceTexture; return surfaceTexture;
......
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