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

Unified Diff: talk/app/webrtc/java/android/org/webrtc/GlShader.java

Issue 1191243005: Android VideoRendererGui: Refactor GLES rendering (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: glaznev@s comments Created 5 years, 6 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
Index: talk/app/webrtc/java/android/org/webrtc/GlShader.java
diff --git a/talk/app/webrtc/java/android/org/webrtc/GlShader.java b/talk/app/webrtc/java/android/org/webrtc/GlShader.java
index 712af2b4469ea3b4da0829616c29a2756a877321..3014aab407e81f75b1c6e0097774a83633a0d62c 100644
--- a/talk/app/webrtc/java/android/org/webrtc/GlShader.java
+++ b/talk/app/webrtc/java/android/org/webrtc/GlShader.java
@@ -30,6 +30,8 @@ package org.webrtc;
import android.opengl.GLES20;
import android.util.Log;
+import java.nio.FloatBuffer;
+
// Helper class for handling OpenGL shaders and shader programs.
public class GlShader {
private static final String TAG = "GlShader";
@@ -88,6 +90,20 @@ public class GlShader {
return location;
}
+ /**
+ * Enable and upload a vertex array for attribute |label|. The vertex data is specified in
+ * |buffer| with |dimension| number of components per vertex.
+ */
+ public void setVertexAttribArray(String label, int dimension, 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);
+ GlUtil.checkNoGLES2Error("setVertexAttribArray");
+ }
+
public int getUniformLocation(String label) {
if (program == -1) {
throw new RuntimeException("The program has been released");

Powered by Google App Engine
This is Rietveld 408576698