Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2315)

Unified Diff: sdk/android/api/org/webrtc/GlShader.java

Issue 3020513002: Enable uploading vertex array with non-zero stride in Android shader.
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/android/api/org/webrtc/GlShader.java
diff --git a/sdk/android/api/org/webrtc/GlShader.java b/sdk/android/api/org/webrtc/GlShader.java
index 15dfc45a270e4b0ab518beb35f0404ee51ce7a47..fb9e8d7f6f69425e26bd9a84a3887640882327fa 100644
--- a/sdk/android/api/org/webrtc/GlShader.java
+++ b/sdk/android/api/org/webrtc/GlShader.java
@@ -82,12 +82,20 @@ public class GlShader {
* |buffer| with |dimension| number of components per vertex.
*/
public void setVertexAttribArray(String label, int dimension, FloatBuffer buffer) {
+ setVertexAttribArray(label, dimension, 0, buffer);
+ }
+
+ /**
+ * Enable and upload a vertex array for attribute |label|. The vertex data is specified in
+ * |buffer| with |dimension| number of components per vertex and specified |stride|.
+ */
+ public void setVertexAttribArray(String label, int dimension, int stride, FloatBuffer buffer) {
if (program == -1) {
throw new RuntimeException("The program has been released");
}
int location = getAttribLocation(label);
GLES20.glEnableVertexAttribArray(location);
- GLES20.glVertexAttribPointer(location, dimension, GLES20.GL_FLOAT, false, 0, buffer);
+ GLES20.glVertexAttribPointer(location, dimension, GLES20.GL_FLOAT, false, stride, buffer);
GlUtil.checkNoGLES2Error("setVertexAttribArray");
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698