protected override Rect DoSeriesList(Rect position, int chartControlID, ProfilerModuleChartType chartType, ChartViewData cdata)
        {
            Rect       elementPosition = base.DoSeriesList(position, chartControlID, chartType, cdata);
            GUIContent label           = EditorGUIUtility.TempContent("Markers");
            Color      color           = ProfilerColors.chartAreaColors[cdata.numSeries % ProfilerColors.chartAreaColors.Length];

            DoSeriesToggle(elementPosition, label, ref showMarkers, color, cdata);

            elementPosition.y += elementPosition.height;
            return(elementPosition);
        }
示例#2
0
        protected ProfilerModule(ProfilerCounterDescriptor[] chartCounters, ProfilerModuleChartType defaultChartType = ProfilerModuleChartType.Line, string[] autoEnabledCategoryNames = null)
        {
            ChartCounters = chartCounters;
            ChartType     = defaultChartType;

            // By default, the module's auto-enabled categories are those used by the chart.
            if (autoEnabledCategoryNames == null || autoEnabledCategoryNames.Length == 0)
            {
                autoEnabledCategoryNames = UniqueCategoryNamesInCounters(chartCounters);
            }
            AutoEnabledCategoryNames = autoEnabledCategoryNames;
        }
示例#3
0
        protected override void DoLegendGUI(Rect position, ProfilerModuleChartType type, ChartViewData cdata, EventType evtType, bool active)
        {
            base.DoLegendGUI(position, type, cdata, evtType, active);

            // TODO Move to a GPU chart subclass would be better.
            if (m_Area == ProfilerArea.GPU)
            {
                const float rightMmargin = 2f;
                const float topMargin    = 4f;
                const float iconSize     = 16f;
                var         padding      = GUISkin.current.label.padding;
                float       width        = iconSize + padding.horizontal;

                GUI.Label(new Rect(position.xMax - width - rightMmargin, position.y + topMargin, width, iconSize + padding.vertical), performanceWarning);
            }
        }
示例#4
0
        public ProfilerChart(ProfilerArea area, ProfilerModuleChartType type, float dataScale, float maximumScaleInterpolationValue, int seriesCount, string name, string localizedName, string iconName) : base()
        {
            Debug.Assert(seriesCount <= k_MaximumSeriesCount);

            labelRange  = new Vector2(Mathf.Epsilon, Mathf.Infinity);
            graphRange  = new Vector2(Mathf.Epsilon, Mathf.Infinity);
            m_Area      = area;
            m_Type      = type;
            m_DataScale = dataScale;
            m_MaximumScaleInterpolationValue = maximumScaleInterpolationValue;
            m_Data          = new ChartViewData();
            m_Series        = new ChartSeriesViewData[seriesCount];
            m_Name          = name;
            m_LocalizedName = localizedName;
            m_IconName      = iconName;
            ShowGrid        = (type == ProfilerModuleChartType.StackedTimeArea);

            var localizedTooltipFormat = LocalizationDatabase.GetLocalizedString("A chart showing performance counters related to '{0}'.");

            Tooltip = string.Format(localizedTooltipFormat, m_LocalizedName);
        }
示例#5
0
 // We cannot provide counters in the constructor for legacy modules. All concrete module types now use a parameterless constructor that invokes this base constructor, causing this to be called in serialization. Access to ProfilerDriver.GetGraphStatisticsPropertiesForArea is banned during (de)serialization, which is used by these modules to construct their counter lists. Therefore, we initialize with a null list and provide it later in Initialize().
 protected ProfilerModuleBase(ProfilerModuleChartType defaultChartType = ProfilerModuleChartType.Line) : base(null, defaultChartType)
 {
 }
示例#6
0
 // Used by UIDetailsProfilerModule
 protected UIProfilerModule(ProfilerModuleChartType defaultChartType) : base(defaultChartType)
 {
 }
 public static bool IsStackedChartType(this ProfilerModuleChartType chartType)
 {
     return(chartType == ProfilerModuleChartType.StackedTimeArea || chartType == ProfilerModuleChartType.StackedArea);
 }
 public UISystemProfilerChart(ProfilerModuleChartType type, float dataScale, float maximumScaleInterpolationValue, int seriesCount, string name, string localizedName, string iconName) : base(ProfilerArea.UIDetails, type, dataScale, maximumScaleInterpolationValue, seriesCount, name, localizedName, iconName)
 {
 }