Browse Source

Optimize SKRoundRectCache Clear Method for .NET 6+ (#17605)

This changes optimizes the `Clear` method in `SKRoundRectCache`. For .NET 6 and higher versions, a faster clearing technique is utilized, enhancing performance.
pull/18177/head
lindexi 1 year ago
committed by GitHub
parent
commit
1222399c08
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      src/Skia/Avalonia.Skia/SKRoundRectCache.cs

4
src/Skia/Avalonia.Skia/SKRoundRectCache.cs

@ -91,9 +91,13 @@ namespace Avalonia.Skia
base.Clear();
// Clear out the cache of SKPoint arrays.
#if NET6_0_OR_GREATER
_radiiCache.Clear();
#else
while (_radiiCache.TryTake(out var item))
{
}
#endif
}
}
}

Loading…
Cancel
Save