Support sending sequences of points when drawing lines.

This allows the graph widgets to avoid having to create temporary arrays just to draw these lines, which reduces GC pressure.
This commit is contained in:
RoosterDragon
2015-12-23 22:58:53 +00:00
parent 387d0d0e3f
commit 5c14044138
3 changed files with 23 additions and 11 deletions

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Widgets
foreach (var item in PerfHistory.Items.Values)
{
cr.DrawLine(item.Samples()
.Select((sample, i) => origin + new float2(i, (float)sample) * basis).ToArray(),
.Select((sample, i) => origin + new float2(i, (float)sample) * basis),
1, item.C);
var u = new float2(rect.Left, rect.Top);