adding quick timers to track draw performance

This commit is contained in:
Lars Brubaker 2022-08-30 17:24:56 -07:00
parent 034565965e
commit 6eb78e73e1
4 changed files with 38 additions and 15 deletions

View file

@ -528,12 +528,32 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.RenderRunningTasks(theme, ApplicationController.Instance.Tasks);
}
public override void OnDraw(Graphics2D graphics2D)
bool showQuickTiming = false;
public override void OnKeyDown(KeyEventArgs keyEvent)
{
base.OnDraw(graphics2D);
#if DEBUG
if (keyEvent.KeyCode == Keys.F3)
{
showQuickTiming = !showQuickTiming;
Invalidate();
}
#endif
// AggContext.DefaultFont.ShowDebugInfo(graphics2D);
base.OnKeyDown(keyEvent);
}
public override void OnDraw(Graphics2D graphics2D)
{
using (new QuickTimerReport("MainViewWidget.OnDraw"))
{
base.OnDraw(graphics2D);
}
if (showQuickTiming)
{
QuickTimerReport.ReportAndRestart(graphics2D, 10, Height - 26);
}
}
private void ShowUpdateAvailableAnimation()
{

View file

@ -1332,21 +1332,24 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
base.OnLoad(args);
}
public override void OnDraw(Graphics2D graphics2D)
public override void OnDraw(Graphics2D graphics2D)
{
var selectedItem = Scene.SelectedItem;
if (selectedItem != null)
using (new QuickTimerReport("View3DWidget.OnDraw"))
{
foreach (var volume in this.Object3DControlLayer.Object3DControls)
var selectedItem = Scene.SelectedItem;
if (selectedItem != null)
{
volume.SetPosition(selectedItem, CurrentSelectInfo);
foreach (var volume in this.Object3DControlLayer.Object3DControls)
{
volume.SetPosition(selectedItem, CurrentSelectInfo);
}
}
TrackballTumbleWidget.RecalculateProjection();
base.OnDraw(graphics2D);
}
TrackballTumbleWidget.RecalculateProjection();
base.OnDraw(graphics2D);
}
private void AfterDraw3DContent(object sender, DrawEventArgs e)

@ -1 +1 @@
Subproject commit 42401e1aff4c8a327e7c28af70168499e6d36c29
Subproject commit ecc289e5b6d9f43be6a0d1bd2d0d7ca4ada1cf33

@ -1 +1 @@
Subproject commit 2cfd64bdeacd33f5be83556f54757b15101af146
Subproject commit b702f66317da46a93343be83f1cda51bb29913c8