IDisplayView, render statistics
This commit is contained in:
@@ -13,20 +13,30 @@ public readonly ref struct RenderContext
|
||||
public readonly bool ForceRerender;
|
||||
public readonly IColor? Foreground;
|
||||
public readonly IColor? Background;
|
||||
public readonly RenderStatistics Statistics;
|
||||
|
||||
public RenderContext(
|
||||
IConsoleDriver consoleDriver,
|
||||
bool forceRerender,
|
||||
IColor? foreground,
|
||||
IColor? background)
|
||||
IConsoleDriver consoleDriver,
|
||||
bool forceRerender,
|
||||
IColor? foreground,
|
||||
IColor? background,
|
||||
RenderStatistics statistics)
|
||||
{
|
||||
RenderId = _renderId++;
|
||||
|
||||
|
||||
ConsoleDriver = consoleDriver;
|
||||
ForceRerender = forceRerender;
|
||||
Foreground = foreground;
|
||||
Background = background;
|
||||
Statistics = statistics;
|
||||
}
|
||||
|
||||
public static RenderContext Empty => new(null!, false, null, null);
|
||||
|
||||
public static RenderContext Empty =>
|
||||
new(
|
||||
null!,
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
new RenderStatistics()
|
||||
);
|
||||
}
|
||||
11
src/Library/TerminalUI/Models/RenderStatistics.cs
Normal file
11
src/Library/TerminalUI/Models/RenderStatistics.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace TerminalUI.Models;
|
||||
|
||||
[DebuggerDisplay("RenderedViews = {RenderedViews}, RenderedDisplayViews = {RenderedDisplayViews}, ProcessedViews = {ProcessedViews}")]
|
||||
public class RenderStatistics
|
||||
{
|
||||
public ulong RenderedViews { get; set; }
|
||||
public ulong RenderedDisplayViews { get; set; }
|
||||
public ulong ProcessedViews { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user