Add slight delay before calling PixelHistory to allow for painting

This commit is contained in:
baldurk
2014-08-07 21:43:57 +01:00
parent 0202af73da
commit 6b74ce2f65
+15 -7
View File
@@ -2588,15 +2588,23 @@ namespace renderdocui.Windows
hist.Show(DockPanel);
m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
// add a short delay so that controls repainting after a new panel appears can get at the
// render thread before we insert the long blocking pixel history task
var delayedHistory = new BackgroundWorker();
delayedHistory.DoWork += delegate
{
history = r.PixelHistory(CurrentTexture.ID, (UInt32)m_PickedPoint.X, (UInt32)m_PickedPoint.Y);
this.BeginInvoke(new Action(() =>
Thread.Sleep(100);
m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
{
hist.SetHistory(history);
}));
});
history = r.PixelHistory(CurrentTexture.ID, (UInt32)m_PickedPoint.X, (UInt32)m_PickedPoint.Y);
this.BeginInvoke(new Action(() =>
{
hist.SetHistory(history);
}));
});
};
delayedHistory.RunWorkerAsync();
}
private void debugPixel_Click(object sender, EventArgs e)