콘텐츠로 이동

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)

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.