Merge "GLES2Dbg: use liblzf for compressing images"
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<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.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="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="lib" path="lib/liblzf.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
1
tools/glesv2debugger/.gitignore
vendored
Normal file
1
tools/glesv2debugger/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
lib/*.jar
|
||||||
@@ -9,4 +9,5 @@ Require-Bundle: org.eclipse.ui,
|
|||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Bundle-ClassPath: lib/host-libprotobuf-java-2.3.0-lite.jar,
|
Bundle-ClassPath: lib/host-libprotobuf-java-2.3.0-lite.jar,
|
||||||
|
lib/liblzf.jar,
|
||||||
.
|
.
|
||||||
|
|||||||
@@ -5,4 +5,5 @@ bin.includes = plugin.xml,\
|
|||||||
.,\
|
.,\
|
||||||
icons/,\
|
icons/,\
|
||||||
contexts.xml,\
|
contexts.xml,\
|
||||||
lib/host-libprotobuf-java-2.3.0-lite.jar
|
lib/host-libprotobuf-java-2.3.0-lite.jar,\
|
||||||
|
lib/liblzf.jar
|
||||||
|
|||||||
Binary file not shown.
@@ -17,13 +17,14 @@
|
|||||||
package com.android.glesv2debugger;
|
package com.android.glesv2debugger;
|
||||||
|
|
||||||
import com.android.glesv2debugger.DebuggerMessage.Message;
|
import com.android.glesv2debugger.DebuggerMessage.Message;
|
||||||
|
import com.android.glesv2debugger.DebuggerMessage.Message.Function;
|
||||||
|
|
||||||
import org.eclipse.swt.graphics.Device;
|
import org.eclipse.swt.graphics.Device;
|
||||||
import org.eclipse.swt.graphics.Image;
|
import org.eclipse.swt.graphics.Image;
|
||||||
import org.eclipse.swt.graphics.ImageData;
|
import org.eclipse.swt.graphics.ImageData;
|
||||||
|
|
||||||
public class MessageData {
|
public class MessageData {
|
||||||
public Message.Function function;
|
public final Message msg;
|
||||||
public Image image; // texture
|
public Image image; // texture
|
||||||
public String shader; // shader source
|
public String shader; // shader source
|
||||||
public String[] columns;
|
public String[] columns;
|
||||||
@@ -32,11 +33,12 @@ public class MessageData {
|
|||||||
public GLEnum dataType; // could be float, int; mainly for formatting use
|
public GLEnum dataType; // could be float, int; mainly for formatting use
|
||||||
|
|
||||||
public MessageData(final Device device, final Message msg) {
|
public MessageData(final Device device, final Message msg) {
|
||||||
|
this.msg = msg;
|
||||||
image = null;
|
image = null;
|
||||||
shader = null;
|
shader = null;
|
||||||
data = null;
|
data = null;
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
function = msg.getFunction();
|
final Function function = msg.getFunction();
|
||||||
ImageData imageData = null;
|
ImageData imageData = null;
|
||||||
if (function != Message.Function.ACK)
|
if (function != Message.Function.ACK)
|
||||||
assert msg.hasTime();
|
assert msg.hasTime();
|
||||||
|
|||||||
@@ -30,35 +30,6 @@ public class MessageProcessor {
|
|||||||
MessageDialog.openError(null, "MessageProcessor", message);
|
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,
|
public static ImageData ReceiveImage(int width, int height, int format,
|
||||||
int type, byte[] data) {
|
int type, byte[] data) {
|
||||||
assert width > 0 && height > 0;
|
assert width > 0 && height > 0;
|
||||||
@@ -121,9 +92,12 @@ public class MessageProcessor {
|
|||||||
showError("unsupported texture format: " + format);
|
showError("unsupported texture format: " + format);
|
||||||
return null;
|
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);
|
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) {
|
static public float[] ReceiveData(final GLEnum type, final ByteString data) {
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ public class MessageQueue implements Runnable {
|
|||||||
DataOutputStream dos = null;
|
DataOutputStream dos = null;
|
||||||
HashMap<Integer, ArrayList<Message>> incoming = new HashMap<Integer, ArrayList<Message>>();
|
HashMap<Integer, ArrayList<Message>> incoming = new HashMap<Integer, ArrayList<Message>>();
|
||||||
try {
|
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());
|
dis = new DataInputStream(socket.getInputStream());
|
||||||
dos = new DataOutputStream(socket.getOutputStream());
|
dos = new DataOutputStream(socket.getOutputStream());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ public class SampleView extends ViewPart implements Runnable {
|
|||||||
Action actionAutoScroll;
|
Action actionAutoScroll;
|
||||||
Action actionFilter;
|
Action actionFilter;
|
||||||
Action actionCapture;
|
Action actionCapture;
|
||||||
|
Action actionPort;
|
||||||
|
|
||||||
Point origin = new Point(0, 0); // for smooth scrolling canvas
|
Point origin = new Point(0, 0); // for smooth scrolling canvas
|
||||||
String[] filters = null;
|
String[] filters = null;
|
||||||
@@ -473,6 +474,22 @@ public class SampleView extends ViewPart implements Runnable {
|
|||||||
manager.update(true);
|
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() {
|
private void ConnectDisconnect() {
|
||||||
@@ -564,7 +581,7 @@ public class SampleView extends ViewPart implements Runnable {
|
|||||||
MessageData msgData = (MessageData) objects[i];
|
MessageData msgData = (MessageData) objects[i];
|
||||||
if (null == msgData)
|
if (null == msgData)
|
||||||
continue;
|
continue;
|
||||||
totalTime += Float.parseFloat(msgData.columns[1]);
|
totalTime += msgData.msg.getTime();
|
||||||
}
|
}
|
||||||
viewer.getTable().getColumn(1).setText(Float.toString(totalTime));
|
viewer.getTable().getColumn(1).setText(Float.toString(totalTime));
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user