<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry exported="true" kind="lib" path="lib/host-libprotobuf-java-2.3.0-lite.jar"/>
+ <classpathentry kind="lib" path="lib/host-libprotobuf-java-2.3.0-lite.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="lib/liblzf.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: lib/host-libprotobuf-java-2.3.0-lite.jar,
+ lib/liblzf.jar,
.
.,\\r
icons/,\\r
contexts.xml,\\r
- lib/host-libprotobuf-java-2.3.0-lite.jar\r
+ lib/host-libprotobuf-java-2.3.0-lite.jar,\
+ lib/liblzf.jar
package com.android.glesv2debugger;
import com.android.glesv2debugger.DebuggerMessage.Message;
+import com.android.glesv2debugger.DebuggerMessage.Message.Function;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
public class MessageData {
- public Message.Function function;
+ public final Message msg;
public Image image; // texture
public String shader; // shader source
public String[] columns;
public GLEnum dataType; // could be float, int; mainly for formatting use
public MessageData(final Device device, final Message msg) {
+ this.msg = msg;
image = null;
shader = null;
data = null;
StringBuilder builder = new StringBuilder();
- function = msg.getFunction();
+ final Function function = msg.getFunction();
ImageData imageData = null;
if (function != Message.Function.ACK)
assert msg.hasTime();
MessageDialog.openError(null, "MessageProcessor", message);
}
- static byte[] RLEDecode(final byte[] data) {
- byte dataSize = data[0];
- int a = data[1] & 0xff, b = data[2] & 0xff, c = data[3] & 0xff, d = data[4] & 0xff;
- int count = (d << 24) | (c << 16) | (b << 8) | a;
- byte[] buffer = new byte[count * dataSize];
- int write = 0;
- int i = 5;
- for (i = 5; i < data.length;) {
- byte flag = data[i];
- int repeat = (flag & 0x7f) + 1;
- assert 0 < repeat && repeat < 129;
- i++;
- if (0x80 == (flag & 0x80)) {
- for (int j = 0; j < repeat; j++)
- for (int k = 0; k < dataSize; k++)
- buffer[write++] = data[i + k];
- i += dataSize;
- } else // literal runs
- {
- for (int j = 0; j < repeat; j++)
- for (int k = 0; k < dataSize; k++)
- buffer[write++] = data[i++];
- }
- }
- assert write == count * dataSize;
- assert i == data.length;
- return buffer;
- }
-
public static ImageData ReceiveImage(int width, int height, int format,
int type, byte[] data) {
assert width > 0 && height > 0;
showError("unsupported texture format: " + format);
return null;
}
- // data = RLEDecode(data);
+ byte[] pixels = new byte[width * height * (bpp / 8)];
+ int decompressed = org.liblzf.CLZF.lzf_decompress(data, data.length, pixels, pixels.length);
+ assert decompressed == width * height * (bpp / 8);
+
PaletteData palette = new PaletteData(redMask, greenMask, blueMask);
- return new ImageData(width, height, bpp, palette, 1, data);
+ return new ImageData(width, height, bpp, palette, 1, pixels);
}
static public float[] ReceiveData(final GLEnum type, final ByteString data) {
DataOutputStream dos = null;
HashMap<Integer, ArrayList<Message>> incoming = new HashMap<Integer, ArrayList<Message>>();
try {
- socket.connect(new java.net.InetSocketAddress("127.0.0.1", 5039));
+ socket.connect(new java.net.InetSocketAddress("127.0.0.1", Integer
+ .parseInt(sampleView.actionPort.getText())));
dis = new DataInputStream(socket.getInputStream());
dos = new DataOutputStream(socket.getOutputStream());
} catch (Exception e) {
Action actionAutoScroll;
Action actionFilter;
Action actionCapture;
+ Action actionPort;
Point origin = new Point(0, 0); // for smooth scrolling canvas
String[] filters = null;
manager.update(true);
}
});
+
+ actionPort = new Action("5039", Action.AS_DROP_DOWN_MENU)
+ {
+ @Override
+ public void run() {
+ org.eclipse.jface.dialogs.InputDialog dialog = new org.eclipse.jface.dialogs.InputDialog(
+ shell, "Port",
+ "Debugger port",
+ actionPort.getText(), null);
+ if (Window.OK == dialog.open()) {
+ actionPort.setText(dialog.getValue());
+ manager.update(true);
+ }
+ }
+ };
+ manager.add(actionPort);
}
private void ConnectDisconnect() {
MessageData msgData = (MessageData) objects[i];
if (null == msgData)
continue;
- totalTime += Float.parseFloat(msgData.columns[1]);
+ totalTime += msgData.msg.getTime();
}
viewer.getTable().getColumn(1).setText(Float.toString(totalTime));
return;