Struct webrender::texture_cache::TexturePage [] [src]

pub struct TexturePage {
    texture_id: CacheTextureId,
    texture_size: DeviceUintSize,
    free_list: FreeRectList,
    coalesce_vec: Vec<DeviceUintRect>,
    allocations: u32,
    dirty: bool,
}

A texture allocator using the guillotine algorithm with the rectangle merge improvement. See sections 2.2 and 2.2.5 in "A Thousand Ways to Pack the Bin - A Practical Approach to Two- Dimensional Rectangle Bin Packing":

http://clb.demon.fi/files/RectangleBinPack.pdf

This approach was chosen because of its simplicity, good performance, and easy support for dynamic texture deallocation.

Fields

Methods

impl TexturePage
[src]

[src]

[src]

[src]

Find a suitable rect in the free list. We choose the smallest such rect in terms of area (Best-Area-Fit, BAF).

[src]

[src]

[src]

[src]

Combine rects that have the same width and are adjacent.

[src]

Combine rects that have the same height and are adjacent.

[src]

[src]

[src]

[src]

[src]

impl TexturePage
[src]

[src]

[src]