Commit e91065c4 by eguven Committed by Oliver Woodman

Remove ProjectionRenderer.EyeType

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215562599
parent 645f08af
...@@ -33,18 +33,6 @@ import org.checkerframework.checker.nullness.qual.Nullable; ...@@ -33,18 +33,6 @@ import org.checkerframework.checker.nullness.qual.Nullable;
@TargetApi(15) @TargetApi(15)
/* package */ final class ProjectionRenderer { /* package */ final class ProjectionRenderer {
/** Defines the constants identifying the current eye type. */
/* package */ interface EyeType {
/** Single eye in monocular rendering. */
int MONOCULAR = 0;
/** The left eye in stereo rendering. */
int LEFT = 1;
/** The right eye in stereo rendering. */
int RIGHT = 2;
}
/** /**
* Returns whether {@code projection} is supported. At least it should have left mesh and there * Returns whether {@code projection} is supported. At least it should have left mesh and there
* should be only one sub mesh per mesh. * should be only one sub mesh per mesh.
...@@ -148,10 +136,11 @@ import org.checkerframework.checker.nullness.qual.Nullable; ...@@ -148,10 +136,11 @@ import org.checkerframework.checker.nullness.qual.Nullable;
* *
* @param textureId GL_TEXTURE_EXTERNAL_OES used for this mesh. * @param textureId GL_TEXTURE_EXTERNAL_OES used for this mesh.
* @param mvpMatrix The Model View Projection matrix. * @param mvpMatrix The Model View Projection matrix.
* @param eyeType An {@link EyeType} value. * @param rightEye Whether the right eye view should be drawn. If {@code false}, the left eye view
* is drawn.
*/ */
/* package */ void draw(int textureId, float[] mvpMatrix, int eyeType) { /* package */ void draw(int textureId, float[] mvpMatrix, boolean rightEye) {
MeshData meshData = eyeType == EyeType.RIGHT ? rightMeshData : leftMeshData; MeshData meshData = rightEye ? rightMeshData : leftMeshData;
if (meshData == null) { if (meshData == null) {
return; return;
} }
...@@ -166,9 +155,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; ...@@ -166,9 +155,9 @@ import org.checkerframework.checker.nullness.qual.Nullable;
float[] texMatrix; float[] texMatrix;
if (stereoMode == C.STEREO_MODE_TOP_BOTTOM) { if (stereoMode == C.STEREO_MODE_TOP_BOTTOM) {
texMatrix = eyeType == EyeType.RIGHT ? TEX_MATRIX_BOTTOM : TEX_MATRIX_TOP; texMatrix = rightEye ? TEX_MATRIX_BOTTOM : TEX_MATRIX_TOP;
} else if (stereoMode == C.STEREO_MODE_LEFT_RIGHT) { } else if (stereoMode == C.STEREO_MODE_LEFT_RIGHT) {
texMatrix = eyeType == EyeType.RIGHT ? TEX_MATRIX_RIGHT : TEX_MATRIX_LEFT; texMatrix = rightEye ? TEX_MATRIX_RIGHT : TEX_MATRIX_LEFT;
} else { } else {
texMatrix = TEX_MATRIX_WHOLE; texMatrix = TEX_MATRIX_WHOLE;
} }
......
...@@ -23,7 +23,6 @@ import android.opengl.Matrix; ...@@ -23,7 +23,6 @@ import android.opengl.Matrix;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.ui.spherical.ProjectionRenderer.EyeType;
import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.GlUtil; import com.google.android.exoplayer2.util.GlUtil;
import com.google.android.exoplayer2.util.TimedValueQueue; import com.google.android.exoplayer2.util.TimedValueQueue;
...@@ -103,9 +102,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -103,9 +102,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* Draws the scene with a given eye pose and type. * Draws the scene with a given eye pose and type.
* *
* @param viewProjectionMatrix 16 element GL matrix. * @param viewProjectionMatrix 16 element GL matrix.
* @param eyeType An {@link EyeType} value * @param rightEye Whether the right eye view should be drawn. If {@code false}, the left eye view
* is drawn.
*/ */
public void drawFrame(float[] viewProjectionMatrix, int eyeType) { public void drawFrame(float[] viewProjectionMatrix, boolean rightEye) {
// glClear isn't strictly necessary when rendering fully spherical panoramas, but it can improve // glClear isn't strictly necessary when rendering fully spherical panoramas, but it can improve
// performance on tiled renderers by causing the GPU to discard previous data. // performance on tiled renderers by causing the GPU to discard previous data.
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
...@@ -128,7 +128,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -128,7 +128,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
} }
} }
Matrix.multiplyMM(tempMatrix, 0, viewProjectionMatrix, 0, rotationMatrix, 0); Matrix.multiplyMM(tempMatrix, 0, viewProjectionMatrix, 0, rotationMatrix, 0);
projectionRenderer.draw(textureId, tempMatrix, eyeType); projectionRenderer.draw(textureId, tempMatrix, rightEye);
} }
// Methods called on playback thread. // Methods called on playback thread.
......
...@@ -36,7 +36,6 @@ import android.view.Surface; ...@@ -36,7 +36,6 @@ import android.view.Surface;
import android.view.WindowManager; import android.view.WindowManager;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.ui.spherical.ProjectionRenderer.EyeType;
import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.Util; import com.google.android.exoplayer2.util.Util;
import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLConfig;
...@@ -287,7 +286,7 @@ public final class SphericalSurfaceView extends GLSurfaceView { ...@@ -287,7 +286,7 @@ public final class SphericalSurfaceView extends GLSurfaceView {
} }
Matrix.multiplyMM(viewProjectionMatrix, 0, projectionMatrix, 0, viewMatrix, 0); Matrix.multiplyMM(viewProjectionMatrix, 0, projectionMatrix, 0, viewMatrix, 0);
scene.drawFrame(viewProjectionMatrix, EyeType.MONOCULAR); scene.drawFrame(viewProjectionMatrix, /* rightEye= */ false);
} }
/** Adjusts the GL camera's rotation based on device rotation. Runs on the sensor thread. */ /** Adjusts the GL camera's rotation based on device rotation. Runs on the sensor thread. */
......
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