Skip to main content

Module style_shared

Module style_shared 

Source
Expand description

Colors, brushes and corner radii resolved against the properties of a graphics layer.

Enums§

DrawPlacement
Which half of a draw command is drawn, relative to the content of the node.
ResolvedBrush
A layer-resolved brush, split at the solid/gradient boundary.

Functions§

apply_layer_to_brush
Resolves brush against layer: its colors take the layer’s alpha and color filter, and a gradient’s geometry takes the layer’s scale.
apply_layer_to_color
The colour a primitive is actually painted in, once this layer has had its say.
compose_color_filters
Combines two optional color filters into one. With only one present, that filter is returned.
primitives_for_placement
Records command at size and returns the primitives that placement draws, or an empty list when the command has no part for that placement.
quad_bounds
Returns the axis-aligned bounds containing all four points.
recording_for_placement_reusing
Records command into storage, a recording the caller kept from an earlier frame so its buffers keep the capacity they earned, and names the segments placement draws: everything for a behind or overlay command, the part before or after the last content marker for a with-content command. None when the command has no placement half, in which case storage is not acquired and nothing is recorded.
resolve_layer_brush
apply_layer_to_brush without the solid-brush clone: the borrowed brush’s color is copied (or layer-adjusted) inline, and only gradients are cloned. Produces exactly the values apply_layer_to_brush would — both branches below mirror its fast path and its Solid arm verbatim.
scale_corner_radii
Multiplies every corner radius by scale.