ScratchSurfacePool.RentLease method
Rents a scratch surface lease with the exact requested pixel dimensions. Same-size requests reuse the same bucket; differently-sized requests miss the cache and allocate fresh.
public ScratchSurfaceLease RentLease(int pixelWidth, int pixelHeight)Remarks
Section titled “Remarks”Earlier revision rounded up to power-of-2 to bound bucket count, but that broke pixel layout in callers: GetWritablePixelSpan reports stride for the actual width, so a 100-wide source written into a 128-wide scratch buffer via flat Span smears the source rows into arbitrary scratch rows. Exact-size buckets eliminate the impedance mismatch at the cost of more cache entries; acceptable, as filter graphs typically reuse a single size for the duration of the source layer.
See Also
Section titled “See Also”- class ScratchSurfaceLease
- class ScratchSurfacePool
- namespace Aprillz.MewUI.Rendering.Filters