Delete old createFromClass methods.
It no longer makes sense to create type info from Java since this cannot be exported to scripts. The new flow is in the opposite direction. Change-Id: I9b46e3f57abf84c01326bd9b9b834f3ff0f7c504
This commit is contained in:
@@ -315,29 +315,6 @@ public class Element extends BaseObj {
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
public static Element createFromClass(RenderScript rs, Class c) {
|
||||
rs.validate();
|
||||
Field[] fields = c.getFields();
|
||||
Builder b = new Builder(rs);
|
||||
|
||||
for(Field f: fields) {
|
||||
Class fc = f.getType();
|
||||
if(fc == int.class) {
|
||||
b.add(createUser(rs, DataType.SIGNED_32), f.getName());
|
||||
} else if(fc == short.class) {
|
||||
b.add(createUser(rs, DataType.SIGNED_16), f.getName());
|
||||
} else if(fc == byte.class) {
|
||||
b.add(createUser(rs, DataType.SIGNED_8), f.getName());
|
||||
} else if(fc == float.class) {
|
||||
b.add(createUser(rs, DataType.FLOAT_32), f.getName());
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unkown field type");
|
||||
}
|
||||
}
|
||||
return b.create();
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////
|
||||
public static Element createUser(RenderScript rs, DataType dt) {
|
||||
return new Element(rs, dt, DataKind.USER, false, 1);
|
||||
|
||||
Reference in New Issue
Block a user