Show the pixel history tab early, fill it in with data when ready

This commit is contained in:
baldurk
2014-08-03 16:04:34 +01:00
parent 6fa46b359e
commit fb6b4a98b0
2 changed files with 25 additions and 8 deletions
+18 -3
View File
@@ -48,8 +48,7 @@ namespace renderdocui.Windows
int numChannels, channelIdx;
public PixelHistoryView(Core core, FetchTexture tex, Point pt,
float rangemin, float rangemax, bool[] channels,
PixelModification[] history)
float rangemin, float rangemax, bool[] channels)
{
InitializeComponent();
@@ -59,7 +58,6 @@ namespace renderdocui.Windows
texture = tex;
pixel = pt;
modifications = history;
rangeMin = rangemin;
rangeMax = rangemax;
visibleChannels = channels;
@@ -110,11 +108,28 @@ namespace renderdocui.Windows
eventsHidden.Text = "";
modifications = null;
events.BeginUpdate();
events.Nodes.Clear();
events.Nodes.Add(new object[] { "", "Loading...", "", "", "", "" });
events.EndUpdate();
}
public void SetHistory(PixelModification[] history)
{
modifications = history;
UpdateEventList();
}
void UpdateEventList()
{
if (modifications == null) return;
events.BeginUpdate();
events.Nodes.Clear();
+7 -5
View File
@@ -2582,17 +2582,19 @@ namespace renderdocui.Windows
{
PixelModification[] history = null;
PixelHistoryView hist = new PixelHistoryView(m_Core, CurrentTexture, m_PickedPoint,
m_TexDisplay.rangemin, m_TexDisplay.rangemax,
new bool[] { m_TexDisplay.Red, m_TexDisplay.Green, m_TexDisplay.Blue, m_TexDisplay.Alpha });
hist.Show(DockPanel);
m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
{
history = r.PixelHistory(CurrentTexture.ID, (UInt32)m_PickedPoint.X, (UInt32)m_PickedPoint.Y);
this.BeginInvoke(new Action(() =>
{
PixelHistoryView hist = new PixelHistoryView(m_Core, CurrentTexture, m_PickedPoint,
m_TexDisplay.rangemin, m_TexDisplay.rangemax,
new bool[] { m_TexDisplay.Red, m_TexDisplay.Green, m_TexDisplay.Blue, m_TexDisplay.Alpha },
history);
hist.Show(DockPanel);
hist.SetHistory(history);
}));
});
}