Browse Source

potential fix for gpu texture leak.

pull/4554/head
Dan Walmsley 6 years ago
parent
commit
faf9beb02d
  1. 2
      build/SkiaSharp.props
  2. 6
      src/Skia/Avalonia.Skia/Gpu/OpenGl/GlRenderTarget.cs

2
build/SkiaSharp.props

@ -1,6 +1,6 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="SkiaSharp" Version="2.80.1" />
<PackageReference Include="SkiaSharp" Version="2.80.2-pr.1478.3" />
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="SkiaSharp.NativeAssets.Linux" Version="2.80.0" />
</ItemGroup>
</Project>

6
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();
}
}

Loading…
Cancel
Save