Skip to content

ScratchSurfaceExtensions class

Scratch-surface acquisition for offscreen caches. Callers ask for the size they actually paint; the pool behind ResourceCache may reuse a larger allocation. The returned logical view always reports the requested dimensions; the allocation size remains internal.

public static class ScratchSurfaceExtensions
name description
static AcquireScratchSurface(…) Returns a surface at least pixelWidth x pixelHeight, reusing a pooled one when available. Content is undefined. Hand it back via ReleaseScratchSurface instead of disposing.
static ReleaseScratchSurface(…) Hands a surface obtained from AcquireScratchSurface back for reuse. Disposes it when the device has no pool or the pool is over budget.