Bug 743247. Ensure we don't have an array buffer bound when drawing PluginLayer. r=kats a=mfinkle
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Sat, 28 Apr 2012 00:55:16 -0400
changeset 94173 a41f240334c8c57db26afad2b35765cf36ce9980
parent 94172 b14c92737b6aacead4c32ea2ac65e7445ae13009
child 94174 b6d8869ae4a18010fb1c2b443edd94bca7d6c755
push idunknown
push userunknown
push dateunknown
reviewerskats, mfinkle
bugs743247
milestone14.0a2
Bug 743247. Ensure we don't have an array buffer bound when drawing PluginLayer. r=kats a=mfinkle This fixes the same problem in the newly added PluginLayer
mobile/android/base/gfx/PluginLayer.java
--- a/mobile/android/base/gfx/PluginLayer.java
+++ b/mobile/android/base/gfx/PluginLayer.java
@@ -242,16 +242,19 @@ public class PluginLayer extends TileLay
         int textureHandle = context.textureHandle;
 
         GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, getTextureID());
 
         // Make sure we are at position zero in the buffer
         coordBuffer.position(0);
         coordBuffer.put(coords);
 
+        // Unbind any the current array buffer so we can use client side buffers
+        GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
+
         // Vertex coordinates are x,y,z starting at position 0 into the buffer.
         coordBuffer.position(0);
         GLES20.glVertexAttribPointer(positionHandle, 3, GLES20.GL_FLOAT, false, 20, coordBuffer);
 
         // Texture coordinates are texture_x, texture_y starting at position 3 into the buffer.
         coordBuffer.position(3);
         GLES20.glVertexAttribPointer(textureHandle, 2, GLES20.GL_FLOAT, false, 20, coordBuffer);
         GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
@@ -312,9 +315,9 @@ public class PluginLayer extends TileLay
         public ShowViewRunnable(PluginLayer layer) {
             mLayer = layer;
         }
 
         public void run() {
             mLayer.showView();
         }
     }
-}
\ No newline at end of file
+}