mono / SkiaSharp

SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
MIT License
4.14k stars 522 forks source link

[BUG] Canvas.DrawPath Cause Memory Leak on Windows 11 #2848

Open xiechuanjie opened 3 weeks ago

xiechuanjie commented 3 weeks ago

Description

Last bug Report <DrawPath cause Memory Leak on GPU context #2660> had fixed on Windows 10, But not fixed on windows 11. When the program run in windows 10, the momery usage is constant, but the same program run in windows 11, the memory increase linearly, when commented the canvas.DrawPath line out, momery usage is constant again. The SkiaSharp Version 2.88.8 is used.

Code

// some C# code here
using (var paintFill = new SKPaint { IsAntialias = true })
{
        paintFill.StrokeWidth = 0;
        paintFill.Style = SKPaintStyle.Fill;
        paintFill.PathEffect = null;
        paintFill.Shader = null;
        paintFill.Color = fillColor.ToSkia(opacity);
        canvas.DrawPath(path, paintFill); //this line cause memory leak in GPU context on Windows 11
}

Expected Behavior

No response

Actual Behavior

No response

Version of SkiaSharp

2.88.3 (Current)

Last Known Good Version of SkiaSharp

2.88.2 (Previous)

IDE / Editor

Visual Studio (Windows)

Platform / Operating System

Windows

Platform / Operating System Version

Windows 11

Devices

x64 desktop

Relevant Screenshots

No response

Relevant Log Output

No response

Code of Conduct

mattleibow commented 2 weeks ago

/similarissues