public MemoryMapDiffPane(UIState s, IViewPaneEventListener l, VisualElement toolbarExtension) : base(s, l) { CurrentTableView = (TableDisplayMode)UnityEditor.EditorPrefs.GetInt("Unity.MemoryProfiler.Editor.UI.MemoryMapPaneDiff.TableDisplayMode", (int)TableDisplayMode.Regions); m_ToolbarExtension = toolbarExtension; m_ToolbarExtensionPane = new IMGUIContainer(new Action(OnGUIToolbarExtension)); s.CurrentMode.ViewPaneChanged += OnViewPaneChanged; s.ModeChanged += OnModeChanged; string[] displayElements = Enum.GetNames(typeof(MemoryMap.MemoryMapDiff.DisplayElements)); m_DisplayElementsList = new GUIContent[displayElements.Length]; for (int i = 0; i < displayElements.Length; ++i) m_DisplayElementsList[i] = new GUIContent(displayElements[i]); string[] colorSchemes = Enum.GetNames(typeof(MemoryMap.MemoryMapDiff.ColorScheme)); m_ColorSchemeList = new GUIContent[colorSchemes.Length]; for (int i = 0; i < colorSchemes.Length; ++i) m_ColorSchemeList[i] = new GUIContent(colorSchemes[i]); ulong maxSize = 256 * 1024 * 1024; // 256,128, 64,32,16,8, 4,2,1,512, 256,128,64,32 m_BytesInRowList = new RowSize[14]; for (int i = 0; i < m_BytesInRowList.Length; ++i) m_BytesInRowList[i] = new RowSize(maxSize >> i); UIState.SnapshotMode mode1 = m_UIState.FirstMode as UIState.SnapshotMode; UIState.SnapshotMode mode2 = m_UIState.SecondMode as UIState.SnapshotMode; m_ActiveMode = mode1; m_MemoryMap = new MemoryMap.MemoryMapDiff(); m_MemoryMap.Setup(mode1.snapshot, mode2.snapshot); m_MemoryMap.RegionSelected += OnSelectRegions; }
public override ViewPane GetDefaultView(UIState uiState, IViewPaneEventListener viewPaneEventListener) { //TODO: delete this method once the default for diff is treemap Database.Table table = null; for (int i = 1; i < uiState.CurrentMode.TableNames.Length; i++) { if (uiState.CurrentMode.TableNames[i].Contains(k_DefaultDiffViewTable)) { table = uiState.CurrentMode.GetTableByIndex(i - 1); } } if (table == null) { table = uiState.CurrentMode.GetTableByIndex(Mathf.Min(0, m_TableNames.Length - 1)); } if (table.Update()) { UpdateTableSelectionNames(); } var pane = new UI.SpreadsheetPane(uiState, viewPaneEventListener); pane.OpenTable(new Database.TableReference(table.GetName()), table); return(pane); }
public MemoryMapPane(UIState s, IViewPaneEventListener l, VisualElement toolbarExtension) : base(s, l) { CurrentTableView = (TableDisplayMode)UnityEditor.EditorPrefs.GetInt("Unity.MemoryProfilerForExtension.Editor.UI.MemoryMapPane.TableDisplayMode", (int)TableDisplayMode.Regions); m_ToolbarExtension = toolbarExtension; m_ToolbarExtensionPane = new IMGUIContainer(new Action(OnGUIToolbarExtension)); s.CurrentMode.ViewPaneChanged += OnViewPaneChanged; s.ModeChanged += OnModeChanged; string[] displayElements = Enum.GetNames(typeof(MemoryMap.MemoryMap.DisplayElements)); m_DisplayElementsList = new GUIContent[displayElements.Length]; for (int i = 0; i < displayElements.Length; ++i) { m_DisplayElementsList[i] = new GUIContent(displayElements[i]); } ulong maxSize = 256 * 1024 * 1024; //256 128 64,32,16,8, 4,2,1,512, 256,128,64,32 m_BytesInRowList = new RowSize[14]; for (int i = 0; i < m_BytesInRowList.Length; ++i) { m_BytesInRowList[i] = new RowSize(maxSize >> i); } m_MemoryMap = new MemoryMap.MemoryMap(); m_MemoryMap.Setup(m_UIState.snapshotMode.snapshot); m_MemoryMap.RegionSelected += OnSelectRegions; }
public override ViewPane GetDefaultView(UIState uiState, IViewPaneEventListener viewPaneEventListener) { if (uiState.snapshotMode != null && uiState.snapshotMode.snapshot != null) { return(new UI.TreeMapPane(uiState, viewPaneEventListener)); } else { return(null); } }
public TreeMapPane(UIState s, IViewPaneEventListener l) : base(s, l) { m_TreeMap = new UI.Treemap.TreeMapView(s.snapshotMode.snapshot); m_TreeMap.Setup(); m_TreeMap.OnClickItem = OnClickItem; m_TreeMap.OnClickGroup = OnClickGroup; m_TreeMap.OnOpenItem = OnOpenItem; ShowAllObjects(null, false); }
public abstract ViewPane GetDefaultView(UIState uiState, IViewPaneEventListener viewPaneEventListener);
public ViewPane(UIState s, IViewPaneEventListener l) { m_UIState = s; m_EventListener = l; }
public SpreadsheetPane(UIState s, IViewPaneEventListener l) : base(s, l) { }