Skip to content

Commit 6dc2adc

Browse files
Make presentMode readonly; remove properties
1 parent c2e93f8 commit 6dc2adc

1 file changed

Lines changed: 1 addition & 31 deletions

File tree

src/ImageSharp.Drawing.WebGPU/WebGPUExternalSurface{TPixel}.cs

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public sealed class WebGPUExternalSurface<TPixel> : IDisposable
1616
where TPixel : unmanaged, IPixel<TPixel>
1717
{
1818
private readonly WebGPUSurfaceResources<TPixel> resources;
19-
private WebGPUPresentMode presentMode;
19+
private readonly WebGPUPresentMode presentMode;
2020
private Size framebufferSize;
2121
private bool isDisposed;
2222

@@ -62,43 +62,13 @@ public WebGPUExternalSurface(
6262
Guard.MustBeGreaterThan(framebufferSize.Width, 0, nameof(framebufferSize));
6363
Guard.MustBeGreaterThan(framebufferSize.Height, 0, nameof(framebufferSize));
6464

65-
this.Configuration = configuration;
6665
this.presentMode = options.PresentMode;
6766
this.framebufferSize = framebufferSize;
6867
this.resources = WebGPUSurfaceResources<TPixel>.Create(
6968
configuration,
7069
new SilkNativeSurfaceAdapter(host),
7170
this.presentMode,
7271
this.framebufferSize);
73-
this.Format = this.resources.Format;
74-
}
75-
76-
/// <summary>
77-
/// Gets the configuration provided when the external surface was created.
78-
/// </summary>
79-
public Configuration Configuration { get; }
80-
81-
/// <summary>
82-
/// Gets the swapchain texture format.
83-
/// </summary>
84-
public WebGPUTextureFormatId Format { get; }
85-
86-
/// <summary>
87-
/// Gets the current framebuffer size in pixels.
88-
/// </summary>
89-
public Size FramebufferSize => this.framebufferSize;
90-
91-
/// <summary>
92-
/// Gets or sets the swapchain present mode.
93-
/// </summary>
94-
public WebGPUPresentMode PresentMode
95-
{
96-
get => this.presentMode;
97-
set
98-
{
99-
this.presentMode = value;
100-
this.resources.ConfigureSurface(this.presentMode, this.framebufferSize);
101-
}
10272
}
10373

10474
/// <summary>

0 commit comments

Comments
 (0)