| 253 | } |
| 254 | |
| 255 | private ViewRange GetMainThreadUpdateRange() |
| 256 | { |
| 257 | if (_events != null && _events.Count != 0) |
| 258 | { |
| 259 | var threads = _events.Get(_mainChart.SelectedSampleIndex); |
| 260 | if (threads != null) |
| 261 | { |
| 262 | for (int j = 0; j < threads.Length; j++) |
| 263 | { |
| 264 | var thread = threads[j]; |
| 265 | if (thread.Name != "Main" || thread.Events == null) |
| 266 | continue; |
| 267 | for (int i = 0; i < thread.Events.Length; i++) |
| 268 | { |
| 269 | ref var e = ref thread.Events[i]; |
| 270 | if (e.Depth == 0 && e.Name == "Update") |
| 271 | return new ViewRange(ref e); |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | return ViewRange.Full; |
| 277 | } |
| 278 | |
| 279 | private void AddEvent(double startTime, int maxDepth, float xOffset, int depthOffset, int index, ProfilerCPU.Event[] events, ContainerControl parent) |
| 280 | { |