aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2012-09-21 15:42:32 -0700
committerSiva Velusamy <vsiva@google.com>2012-09-21 15:51:56 -0700
commit889236adfd5086c1ec8286c6d04806965711d00e (patch)
tree5af1dd04b7232ab45dc30f7dcf18c8fd6fc1e99a
parentd2cd79f968e942d4494ae551f181e3b63b18d6fc (diff)
downloadsdk-889236adfd5086c1ec8286c6d04806965711d00e.zip
sdk-889236adfd5086c1ec8286c6d04806965711d00e.tar.gz
sdk-889236adfd5086c1ec8286c6d04806965711d00e.tar.bz2
gltrace: Preserve alpha information
While reading in framebuffer data into an SWT ImageData, the alpha values have to be set explicitly. This CL also moves toolbars to the right of filter bar. Change-Id: I628752382c82ff9df729590459fba09bf4f340b0
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/ProtoBufUtils.java7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java70
2 files changed, 41 insertions, 36 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/ProtoBufUtils.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/ProtoBufUtils.java
index d08b726..074e440 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/ProtoBufUtils.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/ProtoBufUtils.java
@@ -52,8 +52,13 @@ public class ProtoBufUtils {
palette,
1, // scan line padding
uncompressed);
- imageData = imageData.scaledTo(imageData.width, -imageData.height);
+ byte[] alpha = new byte[width*height];
+ for (int i = 0; i < width * height; i++) {
+ alpha[i] = uncompressed[i * 4 + 3];
+ }
+ imageData.alphaData = alpha;
+ imageData = imageData.scaledTo(imageData.width, -imageData.height);
return imageData;
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java
index 50ee717..fa506e2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java
@@ -383,6 +383,41 @@ public class GLFunctionTraceViewer extends EditorPart implements ISelectionProvi
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
c.setLayoutData(gd);
+ Label l = new Label(c, SWT.NONE);
+ l.setText("Filter:");
+
+ mFilterText = new Text(c, SWT.BORDER | SWT.ICON_SEARCH | SWT.SEARCH | SWT.ICON_CANCEL);
+ mFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ mFilterText.setMessage(DEFAULT_FILTER_MESSAGE);
+ mFilterText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ updateAppliedFilters();
+ }
+ });
+
+ if (mShowContextSwitcher) {
+ mContextSwitchCombo = new Combo(c, SWT.BORDER | SWT.READ_ONLY);
+
+ // Setup the combo such that "All Contexts" is the first item,
+ // and then we have an item for each context.
+ mContextSwitchCombo.add("All Contexts");
+ mContextSwitchCombo.select(0);
+ mCurrentlyDisplayedContext = -1; // showing all contexts
+ for (int i = 0; i < mTrace.getContexts().size(); i++) {
+ mContextSwitchCombo.add("Context " + i);
+ }
+
+ mContextSwitchCombo.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ selectContext(mContextSwitchCombo.getSelectionIndex() - 1);
+ }
+ });
+ } else {
+ mCurrentlyDisplayedContext = 0;
+ }
+
ToolBar toolBar = new ToolBar(c, SWT.FLAT | SWT.BORDER);
mExpandAllToolItem = new ToolItem(toolBar, SWT.PUSH);
@@ -422,41 +457,6 @@ public class GLFunctionTraceViewer extends EditorPart implements ISelectionProvi
mExpandAllToolItem.addSelectionListener(toolbarSelectionListener);
mCollapseAllToolItem.addSelectionListener(toolbarSelectionListener);
mSaveAsToolItem.addSelectionListener(toolbarSelectionListener);
-
- Label l = new Label(c, SWT.NONE);
- l.setText("Filter:");
-
- mFilterText = new Text(c, SWT.BORDER | SWT.ICON_SEARCH | SWT.SEARCH | SWT.ICON_CANCEL);
- mFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- mFilterText.setMessage(DEFAULT_FILTER_MESSAGE);
- mFilterText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- updateAppliedFilters();
- }
- });
-
- if (mShowContextSwitcher) {
- mContextSwitchCombo = new Combo(c, SWT.BORDER | SWT.READ_ONLY);
-
- // Setup the combo such that "All Contexts" is the first item,
- // and then we have an item for each context.
- mContextSwitchCombo.add("All Contexts");
- mContextSwitchCombo.select(0);
- mCurrentlyDisplayedContext = -1; // showing all contexts
- for (int i = 0; i < mTrace.getContexts().size(); i++) {
- mContextSwitchCombo.add("Context " + i);
- }
-
- mContextSwitchCombo.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectContext(mContextSwitchCombo.getSelectionIndex() - 1);
- }
- });
- } else {
- mCurrentlyDisplayedContext = 0;
- }
}
private void updateAppliedFilters() {