Julien Lebosquain
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
19 additions and
3 deletions
-
src/Avalonia.Wayland/Server/Transient/Rendering/WaylandEglWsiSurface.cs
|
|
|
@ -37,16 +37,27 @@ internal sealed class WaylandEglWsiSurface : EglGlPlatformSurfaceBase, IPlatform |
|
|
|
private IntPtr _eglWindow; |
|
|
|
private EglSurface? _eglSurface; |
|
|
|
private PixelSize _currentSize; |
|
|
|
private bool _disposed; |
|
|
|
|
|
|
|
public RenderTarget(WSurface surface, EglContext context) : base(context) |
|
|
|
{ |
|
|
|
_surface = surface; |
|
|
|
_surface.RegisterRenderTarget(this); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected override bool SkipWaits => true; |
|
|
|
|
|
|
|
public override PlatformRenderTargetState State => |
|
|
|
IsCorrupted ? PlatformRenderTargetState.Corrupted : _surface.State; |
|
|
|
public override PlatformRenderTargetState State |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
if (_disposed) |
|
|
|
return PlatformRenderTargetState.Disposed; |
|
|
|
if (IsCorrupted) |
|
|
|
return PlatformRenderTargetState.Corrupted; |
|
|
|
return _surface.State; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public override IGlPlatformSurfaceRenderingSession BeginDrawCore(IRenderTarget.RenderTargetSceneInfo sceneInfo) |
|
|
|
{ |
|
|
|
@ -89,6 +100,11 @@ internal sealed class WaylandEglWsiSurface : EglGlPlatformSurfaceBase, IPlatform |
|
|
|
|
|
|
|
public override void Dispose() |
|
|
|
{ |
|
|
|
if (_disposed) |
|
|
|
return; |
|
|
|
|
|
|
|
_disposed = true; |
|
|
|
_surface.UnregisterRenderTarget(this); |
|
|
|
_eglSurface?.Dispose(); |
|
|
|
_eglSurface = null; |
|
|
|
if (_eglWindow != IntPtr.Zero) |
|
|
|
|