Skip to main content

Module layer_composition

Module layer_composition 

Source
Expand description

Rules for when a graphics layer is drawn into its own offscreen buffer and with which alpha.

Structs§

LayerIsolation
What a layer needs to be composited from its own offscreen buffer.

Functions§

effective_layer_isolation
Returns what layer needs to be composited from its own buffer, or None when it can be drawn directly.
folded_layer_alpha
The alpha layer’s content draws with when the layer is drawn in place: its own, or the 8-bit alpha of the isolated composite it needs.
layer_composite_params
The composite alpha and blend mode an isolated layer contributes at its parent, for callers that never read the isolation’s render effect and would otherwise deep-clone it once per layer per frame.
layer_for_content
Returns the layer to draw the content with inside the offscreen buffer: layer with its alpha reset to one when isolation moves the alpha to the composite step.
layer_requires_isolation
Whether layer must be drawn into an offscreen buffer first, given its compositing strategy, effect, blend mode and alpha.
local_content_layer_for
The alpha and colour filter of layer_for_content(layer, isolation) folded in place, without building it. The content layer differs from layer only in the alpha the isolation moves to the composite step, and only that alpha and the colour filter pass to the content, so the two clones the composed form performs — one GraphicsLayer, one RenderEffect — are pure waste.