diff options
author | Siva Velusamy <vsiva@google.com> | 2012-09-21 15:53:00 -0700 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2012-09-21 15:53:01 -0700 |
commit | 646cdd6982c4d66927cd010dcb33a46e678b2665 (patch) | |
tree | 5af1dd04b7232ab45dc30f7dcf18c8fd6fc1e99a | |
parent | d2cd79f968e942d4494ae551f181e3b63b18d6fc (diff) | |
parent | 889236adfd5086c1ec8286c6d04806965711d00e (diff) | |
download | sdk-646cdd6982c4d66927cd010dcb33a46e678b2665.zip sdk-646cdd6982c4d66927cd010dcb33a46e678b2665.tar.gz sdk-646cdd6982c4d66927cd010dcb33a46e678b2665.tar.bz2 |
Merge "gltrace: Preserve alpha information"
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() { |