KiteBitmapCache
Platform bitmaps that a canvas built from images, so that an image drawn many times on a page, such as a tiled background or a row of icons, converts once (#117). A viewer can keep one cache across draws without retaining decoded source images (#371).
A bitmap is kept for one image identity and one KiteImageSampling: the same image drawn at another size needs another bitmap. The cache holds at most budgetBytes of bitmaps and drops the bitmap used least recently first. A bitmap larger than the whole budget is not kept. A nonpositive budget disables retention. Entries retain only opaque identities and bitmaps, never source image buffers. Map operations are synchronized; conversions and size callbacks run outside the lock.
Properties
Functions
The bitmap for image drawn with sampling. On a miss, build makes it and sizeOf gives its size in bytes. Returns null when build does. A nonpositive size is not retained. Concurrent misses may build twice; the first retained result wins and both callers receive it. No callback runs while the cache lock is held.