Skip to main content

Module damage

Module damage 

Expand description

Damage in device pixels: the pixels a list of rectangles covers, how a long list merges into a few, and where a relayout moved widgets.

Functionsยง

coalesce_damage
rects without the ones another contains, merged down to at most limit rectangles when there are more. Each merge joins the pair whose union adds the least area, so a caret blinking at one place stays one small rectangle however many frames repeated it. Merging only ever repaints more than the damage, which is correct; it never loses a pixel.
coalesce_regions
Merge only overlap/touching damage whose bounding union costs no more pixels than the independent passes. The cap bounds the repeated-pair scan while preserving far-apart scrollbars and overlays.
damage_area
The pixels rects cover, each counted once however many rectangles overlap it.
pixel_rect
The device pixels rect touches inside a width x height target, rounded out; None when that is empty.
without_contained
rects without the ones another contains, in their original order; of equal ones the first stays.