GLES2Dbg: more tests and minor fixes/improvements
Change-Id: I55c360372623c019da0c1ba2eebbc68f73f0f211 Signed-off-by: David Li <davidxli@google.com>
This commit is contained in:
@@ -67,16 +67,21 @@ public abstract class MessageParser {
|
||||
|
||||
String[] getList()
|
||||
{
|
||||
assert args.charAt(0) == '{';
|
||||
String arg = args;
|
||||
args = args.substring(args.lastIndexOf('}') + 1);
|
||||
int comma = args.indexOf(',');
|
||||
final int comma = args.indexOf(',');
|
||||
if (comma >= 0)
|
||||
args = args.substring(comma + 1).trim();
|
||||
else
|
||||
args = null;
|
||||
|
||||
final int comment = arg.indexOf('=');
|
||||
if (comment >= 0)
|
||||
arg = arg.substring(comment + 1);
|
||||
arg = arg.trim();
|
||||
assert arg.charAt(0) == '{';
|
||||
arg = arg.substring(1, arg.lastIndexOf('}')).trim();
|
||||
return arg.split(",");
|
||||
return arg.split("\\s*,\\s*");
|
||||
}
|
||||
|
||||
ByteString parseFloats(int count) {
|
||||
@@ -110,7 +115,7 @@ public abstract class MessageParser {
|
||||
}
|
||||
|
||||
ByteString parseMatrix(int columns, int count) {
|
||||
return parseFloats(columns * count);
|
||||
return parseFloats(columns * columns * count);
|
||||
}
|
||||
|
||||
ByteString parseString() {
|
||||
@@ -127,21 +132,22 @@ public abstract class MessageParser {
|
||||
|
||||
String getArgument()
|
||||
{
|
||||
int comma = args.indexOf(",");
|
||||
final int comma = args.indexOf(',');
|
||||
String arg = null;
|
||||
if (comma >= 0)
|
||||
{
|
||||
arg = args.substring(0, comma).trim();
|
||||
args = args.substring(comma + 1).trim();
|
||||
arg = args.substring(0, comma);
|
||||
args = args.substring(comma + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
arg = args;
|
||||
args = null;
|
||||
}
|
||||
if (arg.indexOf("=") >= 0)
|
||||
arg = arg.substring(arg.indexOf("=") + 1);
|
||||
return arg;
|
||||
final int comment = arg.indexOf('=');
|
||||
if (comment >= 0)
|
||||
arg = arg.substring(comment + 1);
|
||||
return arg.trim();
|
||||
}
|
||||
|
||||
int parseArgument()
|
||||
@@ -242,8 +248,8 @@ public abstract class MessageParser {
|
||||
assert columns * columns == count
|
||||
assert countArg != ""
|
||||
assert paramType == "GLfloat"
|
||||
dataSetter = "builder.setData(parseMatrix(%d, %d * builder.getArg%d()));" % (
|
||||
columns, count, paramNames.index(countArg))
|
||||
dataSetter = "builder.setData(parseMatrix(%d, builder.getArg%d()));" % (
|
||||
columns, paramNames.index(countArg))
|
||||
elif annotation == "GLstring":
|
||||
dataSetter = "builder.setData(parseString());"
|
||||
elif paramType.find("void") >= 0:
|
||||
|
||||
Reference in New Issue
Block a user