From faf9beb02d34e98d635244aaf1cef810160ad26b Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Tue, 25 Aug 2020 18:59:13 +0100 Subject: [PATCH 1/3] potential fix for gpu texture leak. --- build/SkiaSharp.props | 2 +- src/Skia/Avalonia.Skia/Gpu/OpenGl/GlRenderTarget.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build/SkiaSharp.props b/build/SkiaSharp.props index bbef48050e..fc326b8023 100644 --- a/build/SkiaSharp.props +++ b/build/SkiaSharp.props @@ -1,6 +1,6 @@  - + diff --git a/src/Skia/Avalonia.Skia/Gpu/OpenGl/GlRenderTarget.cs b/src/Skia/Avalonia.Skia/Gpu/OpenGl/GlRenderTarget.cs index 2bb739f372..a90faf1448 100644 --- a/src/Skia/Avalonia.Skia/Gpu/OpenGl/GlRenderTarget.cs +++ b/src/Skia/Avalonia.Skia/Gpu/OpenGl/GlRenderTarget.cs @@ -31,10 +31,11 @@ namespace Avalonia.Skia public GlGpuSession(GRContext grContext, GRBackendRenderTarget backendRenderTarget, - SKSurface surface, + SKSurface surface, IGlPlatformSurfaceRenderingSession glSession) { GrContext = grContext; + GrContext.PurgeResources(); _backendRenderTarget = backendRenderTarget; _surface = surface; _glSession = glSession; @@ -45,6 +46,7 @@ namespace Avalonia.Skia _surface.Dispose(); _backendRenderTarget.Dispose(); GrContext.Flush(); + GrContext.PurgeResources(); _glSession.Dispose(); } @@ -93,7 +95,7 @@ namespace Avalonia.Skia } finally { - if(!success) + if (!success) glSession.Dispose(); } } From 90193c99a48e21be7c46732df3ff9fbccc43b710 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Tue, 25 Aug 2020 22:28:20 +0100 Subject: [PATCH 2/3] update to latest skia preview on nuget. --- build/SkiaSharp.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/SkiaSharp.props b/build/SkiaSharp.props index fc326b8023..f429c84e08 100644 --- a/build/SkiaSharp.props +++ b/build/SkiaSharp.props @@ -1,6 +1,6 @@  - + From 966e76bb9f4fb8250e5e0f797d150308d272a757 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Tue, 25 Aug 2020 23:04:32 +0100 Subject: [PATCH 3/3] update linux native package. --- build/SkiaSharp.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/SkiaSharp.props b/build/SkiaSharp.props index f429c84e08..d7d04c7971 100644 --- a/build/SkiaSharp.props +++ b/build/SkiaSharp.props @@ -1,6 +1,6 @@  - +