summaryrefslogtreecommitdiffstats
path: root/opengl/tools/glgen/src
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2013-04-10 01:01:00 -0700
committerJesse Hall <jessehall@google.com>2013-04-10 22:00:17 -0700
commit68fc8bbced285a8a2b716e5fe1900968ad8ba7d3 (patch)
tree8ad6d699de0b4eb66ddbab1f88fd11a53cb5d885 /opengl/tools/glgen/src
parent2d9faafa2318c05f8991beff9cc683d72cbabd07 (diff)
downloadframeworks_native-68fc8bbced285a8a2b716e5fe1900968ad8ba7d3.zip
frameworks_native-68fc8bbced285a8a2b716e5fe1900968ad8ba7d3.tar.gz
frameworks_native-68fc8bbced285a8a2b716e5fe1900968ad8ba7d3.tar.bz2
Add *int64 and GLsync types and related functions
Return values are declared with the C return type, but the JNI function returns the JNI return type. In the case of GLsync/jlong as in glFenceSync(), this causes a compile error. So the generator now explicitly casts the return value to the JNI return type. Bug: 8566953 Change-Id: I814befe2e4cce745434cbc4e1c8639fc3ce8aeae
Diffstat (limited to 'opengl/tools/glgen/src')
-rw-r--r--opengl/tools/glgen/src/JType.java5
-rw-r--r--opengl/tools/glgen/src/JniCodeEmitter.java3
2 files changed, 7 insertions, 1 deletions
diff --git a/opengl/tools/glgen/src/JType.java b/opengl/tools/glgen/src/JType.java
index 795d833..b10e7e2 100644
--- a/opengl/tools/glgen/src/JType.java
+++ b/opengl/tools/glgen/src/JType.java
@@ -48,6 +48,8 @@ public class JType {
typeMapping.put(new CType("char", true, true), new JType("String", false, false));
typeMapping.put(new CType("GLchar", true, true), new JType("String", false, false));
typeMapping.put(new CType("int"), new JType("int"));
+ typeMapping.put(new CType("GLuint64"), new JType("long"));
+ typeMapping.put(new CType("GLsync"), new JType("long"));
// EGL primitive types
typeMapping.put(new CType("EGLint"), new JType("int"));
@@ -103,6 +105,8 @@ public class JType {
new JType("java.nio.IntBuffer", true, false));
typeMapping.put(new CType("GLshort", true, true),
new JType("java.nio.ShortBuffer", true, false));
+ typeMapping.put(new CType("GLint64", false, true),
+ new JType("java.nio.LongBuffer", true, false));
// Typed pointers map to arrays + offsets
arrayTypeMapping.put(new CType("char", false, true),
@@ -124,6 +128,7 @@ public class JType {
arrayTypeMapping.put(new CType("GLuint", true, true), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLintptr"), new JType("int", false, true));
arrayTypeMapping.put(new CType("GLsizeiptr"), new JType("int", false, true));
+ arrayTypeMapping.put(new CType("GLint64", false, true), new JType("long", false, true));
//EGL typed pointers map to arrays + offsets
arrayTypeMapping.put(new CType("EGLint", false, true), new JType("int", false, true));
diff --git a/opengl/tools/glgen/src/JniCodeEmitter.java b/opengl/tools/glgen/src/JniCodeEmitter.java
index ffe3767..ba1152a 100644
--- a/opengl/tools/glgen/src/JniCodeEmitter.java
+++ b/opengl/tools/glgen/src/JniCodeEmitter.java
@@ -1421,7 +1421,8 @@ public class JniCodeEmitter {
"return toEGLHandle(_env, " + baseType + "Class, " +
baseType + "Constructor, _returnValue);");
} else {
- out.println(indent + "return _returnValue;");
+ out.println(indent + "return (" +
+ getJniType(jfunc.getType()) + ")_returnValue;");
}
}