in ExampleGallery/SpriteBatchPerf.xaml.cs [142:192]
async Task RunScenarios()
{
var device = CanvasDevice.GetSharedDevice();
int maxValue;
switch (CurrentGraphMode)
{
case GraphMode.DrawCount:
maxValue = (int)DrawCountSlider.Maximum;
break;
case GraphMode.BitmapCount:
maxValue = (int)BitmapCountSlider.Maximum;
break;
default:
throw new Exception();
}
for (int value = 0; value <= maxValue; value += (maxValue / 100))
{
switch (CurrentGraphMode)
{
case GraphMode.DrawCount:
DrawCount = value;
break;
case GraphMode.BitmapCount:
value = Math.Max(1, value);
BitmapCount = value;
break;
}
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("DrawCount"));
PropertyChanged(this, new PropertyChangedEventArgs("BitmapCount"));
}
using (var scenarioData = new ScenarioData(device, DrawCount, BitmapCount, value))
{
foreach (var scenario in Scenarios)
{
await scenario.Go(currentProfilingTaskCancellation.Token, device, scenarioData);
}
}
InvalidateGraphs();
}
}