diff options
author | Jack Palevich <jackpal@google.com> | 2010-06-22 05:16:24 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-06-22 05:16:24 -0700 |
commit | 1e08cc1dfda9a0264fcf62898af0bdd6ed5a205c (patch) | |
tree | e15b11132cd0e05836cd289eb53691717613639c /opengl | |
parent | a4f980948e112cfdcc7051e12e29c71b78383a6f (diff) | |
parent | 224107a421e2611b15d1ec736df54bca9ee3e78d (diff) | |
download | frameworks_base-1e08cc1dfda9a0264fcf62898af0bdd6ed5a205c.zip frameworks_base-1e08cc1dfda9a0264fcf62898af0bdd6ed5a205c.tar.gz frameworks_base-1e08cc1dfda9a0264fcf62898af0bdd6ed5a205c.tar.bz2 |
am 224107a4: Add OpenGL ES 2.0 VBO versions glDrawElements and glVertexAttribPointer.
Merge commit '224107a421e2611b15d1ec736df54bca9ee3e78d' into gingerbread-plus-aosp
* commit '224107a421e2611b15d1ec736df54bca9ee3e78d':
Add OpenGL ES 2.0 VBO versions glDrawElements and glVertexAttribPointer.
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/java/android/opengl/GLES10.java | 16 | ||||
-rw-r--r-- | opengl/java/android/opengl/GLES20.java | 84 | ||||
-rw-r--r-- | opengl/tools/glgen/specs/gles11/GLES20.spec | 4 | ||||
-rw-r--r-- | opengl/tools/glgen/src/JniCodeEmitter.java | 2 |
4 files changed, 104 insertions, 2 deletions
diff --git a/opengl/java/android/opengl/GLES10.java b/opengl/java/android/opengl/GLES10.java index db52b82..790acbd 100644 --- a/opengl/java/android/opengl/GLES10.java +++ b/opengl/java/android/opengl/GLES10.java @@ -669,6 +669,22 @@ public class GLES10 { java.nio.IntBuffer params ); +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // C function const GLubyte * glGetString ( GLenum name ) public static native String glGetString( diff --git a/opengl/java/android/opengl/GLES20.java b/opengl/java/android/opengl/GLES20.java index b8aac0e..635f811 100644 --- a/opengl/java/android/opengl/GLES20.java +++ b/opengl/java/android/opengl/GLES20.java @@ -670,6 +670,15 @@ public class GLES20 { int count ); + // C function void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) + + public static native void glDrawElements( + int mode, + int count, + int type, + int offset + ); + // C function void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) public static native void glDrawElements( @@ -978,6 +987,22 @@ public class GLES20 { java.nio.IntBuffer params ); +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // C function void glGetProgramInfoLog( GLuint program, GLsizei maxLength, GLsizei * length, // GLchar * infoLog); @@ -1018,6 +1043,22 @@ public class GLES20 { java.nio.IntBuffer params ); +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // C function void glGetShaderInfoLog( GLuint shader, GLsizei maxLength, GLsizei * length, // GLchar * infoLog); @@ -1064,6 +1105,22 @@ public class GLES20 { byte source ); +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // C function const GLubyte * glGetString ( GLenum name ) public static native String glGetString( @@ -1316,6 +1373,22 @@ public class GLES20 { int length ); +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // C function void glShaderSource ( GLuint shader, GLsizei count, const GLchar ** string, const GLint* length ) public static native void glShaderSource( @@ -1814,6 +1887,17 @@ public class GLES20 { java.nio.FloatBuffer values ); + // C function void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset ) + + public static native void glVertexAttribPointer( + int indx, + int size, + int type, + boolean normalized, + int stride, + int offset + ); + // C function void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr ) private static native void glVertexAttribPointerBounds( diff --git a/opengl/tools/glgen/specs/gles11/GLES20.spec b/opengl/tools/glgen/specs/gles11/GLES20.spec index 61094d1..ee88f59 100644 --- a/opengl/tools/glgen/specs/gles11/GLES20.spec +++ b/opengl/tools/glgen/specs/gles11/GLES20.spec @@ -39,6 +39,7 @@ void glDetachShader ( GLuint program, GLuint shader ) void glDisable ( GLenum cap )
void glDisableVertexAttribArray ( GLuint index )
void glDrawArrays ( GLenum mode, GLint first, GLsizei count )
+void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset )
void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
void glEnable ( GLenum cap )
void glEnableVertexAttribArray ( GLuint index )
@@ -138,5 +139,6 @@ void glVertexAttrib3f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z ) void glVertexAttrib3fv ( GLuint indx, const GLfloat *values )
void glVertexAttrib4f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
void glVertexAttrib4fv ( GLuint indx, const GLfloat *values )
+void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset )
void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr )
-void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height )
\ No newline at end of file +void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height )
diff --git a/opengl/tools/glgen/src/JniCodeEmitter.java b/opengl/tools/glgen/src/JniCodeEmitter.java index ebaca90..9d8c5a0 100644 --- a/opengl/tools/glgen/src/JniCodeEmitter.java +++ b/opengl/tools/glgen/src/JniCodeEmitter.java @@ -695,7 +695,7 @@ public class JniCodeEmitter { boolean isPointerFunc = isPointerFunc(jfunc); boolean isVBOPointerFunc = (outName.endsWith("Pointer") || outName.endsWith("PointerOES") || - outName.endsWith("DrawElements")) && + outName.endsWith("DrawElements") || outName.endsWith("VertexAttribPointer")) && !jfunc.getCFunc().hasPointerArg(); if (isPointerFunc) { outName += "Bounds"; |