Don't need index array for simple triangle strip.

And it was being used wrong anyway, resulting in display glitches.
b/5553287

Change-Id: I25354fa5959170fb20d1bcd98acb5207d6d57c05
diff --git a/src/com/android/musicvis/GenericWaveRS.java b/src/com/android/musicvis/GenericWaveRS.java
index 6e5d8ef..e8a54a3 100644
--- a/src/com/android/musicvis/GenericWaveRS.java
+++ b/src/com/android/musicvis/GenericWaveRS.java
@@ -59,10 +59,6 @@
     // so 8 floats per line.
     protected float [] mPointData = new float[1024*8];
 
-    private Allocation mLineIdxAlloc;
-    // 2 initial, plus one for each triangle, 2 triangles per sample
-    private short [] mIndexData = new short[2+1024*2];
-
     private ProgramVertex mPVBackground;
     private ProgramVertexFixedFunction.Constants mPVAlloc;
 
@@ -138,12 +134,8 @@
         // Start creating the mesh
         final Mesh.AllocationBuilder meshBuilder = new Mesh.AllocationBuilder(mRS);
         meshBuilder.addVertexAllocation(mVertexBuffer.getAllocation());
-        // Create the Allocation for the indices
-        mLineIdxAlloc = Allocation.createSized(mRS, Element.U16(mRS), mIndexData.length,
-                                               Allocation.USAGE_GRAPHICS_VERTEX |
-                                               Allocation.USAGE_SCRIPT);
         // This will be a triangle strip mesh
-        meshBuilder.addIndexSetAllocation(mLineIdxAlloc, Primitive.TRIANGLE_STRIP);
+        meshBuilder.addIndexSetType(Primitive.TRIANGLE_STRIP);
 
         // Create the Allocation for the vertices
         mCubeMesh = meshBuilder.create();
@@ -154,16 +146,8 @@
         mScript.set_gPointBuffer(mPointAlloc);
         mScript.set_gCubeMesh(mCubeMesh);
 
-        //  put the vertex and index data in their respective buffers
-        updateWave();
-        for(int i = 0; i < mIndexData.length; i ++) {
-            mIndexData[i] = (short) i;
-        }
-
-        //  upload the vertex and index data
+        //  upload the vertex data
         mPointAlloc.copyFromUnchecked(mPointData);
-        mLineIdxAlloc.copyFrom(mIndexData);
-        mLineIdxAlloc.syncAll(Allocation.USAGE_SCRIPT);
 
         // load the texture
         mTexture = Allocation.createFromBitmapResource(mRS, mResources, mTexId);
diff --git a/src/com/android/musicvis/waveform.rs b/src/com/android/musicvis/waveform.rs
index 1c5116d..b25f4cc 100644
--- a/src/com/android/musicvis/waveform.rs
+++ b/src/com/android/musicvis/waveform.rs
@@ -61,7 +61,6 @@
     float amp2 = sin(0.023f * wave2amp) * 80;
     float amp3 = sin(0.011f * wave3amp) * 40;
     float amp4 = sin(0.031f * wave4amp) * 20;
-    // calculate how many invisible lines there are on each side
     for (int i = 0; i < 1024; i++) {
         float val = fabs(sin(0.013f * (wave1pos + i)) * amp1
                   + sin(0.029f * (wave2pos + i)) * amp2);