pub struct GpuValueCache {
pub transform_keys: HashMap<NodeId, TransformKey>,
pub current_transform_values: HashMap<NodeId, ComputedTransform3D>,
pub h_transform_keys: HashMap<NodeId, TransformKey>,
pub h_current_transform_values: HashMap<NodeId, ComputedTransform3D>,
pub css_transform_keys: HashMap<NodeId, TransformKey>,
pub css_current_transform_values: HashMap<NodeId, ComputedTransform3D>,
pub opacity_keys: HashMap<NodeId, OpacityKey>,
pub current_opacity_values: HashMap<NodeId, f32>,
pub scrollbar_v_opacity_keys: HashMap<(DomId, NodeId), OpacityKey>,
pub scrollbar_h_opacity_keys: HashMap<(DomId, NodeId), OpacityKey>,
pub scrollbar_v_opacity_values: HashMap<(DomId, NodeId), f32>,
pub scrollbar_h_opacity_values: HashMap<(DomId, NodeId), f32>,
}Expand description
Caches GPU transform and opacity keys and their current values for all nodes.
This cache stores the WebRender keys and computed values for nodes with
CSS transforms or opacity. It’s synchronized with the StyledDom to detect
changes and generate minimal update events.
Fields§
§transform_keys: HashMap<NodeId, TransformKey>Vertical scrollbar thumb transform keys (keyed by scrollable node ID)
current_transform_values: HashMap<NodeId, ComputedTransform3D>Current vertical scrollbar thumb transform values
h_transform_keys: HashMap<NodeId, TransformKey>Horizontal scrollbar thumb transform keys (keyed by scrollable node ID)
h_current_transform_values: HashMap<NodeId, ComputedTransform3D>Current horizontal scrollbar thumb transform values
css_transform_keys: HashMap<NodeId, TransformKey>CSS transform keys (keyed by node ID) — for CSS transform property animation.
Separate from scrollbar transform keys to avoid SpatialTreeItemKey collisions.
css_current_transform_values: HashMap<NodeId, ComputedTransform3D>Current CSS transform values (keyed by node ID)
opacity_keys: HashMap<NodeId, OpacityKey>CSS opacity keys (keyed by node ID)
current_opacity_values: HashMap<NodeId, f32>Current CSS opacity values (keyed by node ID)
scrollbar_v_opacity_keys: HashMap<(DomId, NodeId), OpacityKey>Vertical scrollbar opacity keys (keyed by DOM ID and scrollable node ID)
scrollbar_h_opacity_keys: HashMap<(DomId, NodeId), OpacityKey>Horizontal scrollbar opacity keys (keyed by DOM ID and scrollable node ID)
scrollbar_v_opacity_values: HashMap<(DomId, NodeId), f32>Current vertical scrollbar opacity values
scrollbar_h_opacity_values: HashMap<(DomId, NodeId), f32>Current horizontal scrollbar opacity values
Implementations§
Source§impl GpuValueCache
impl GpuValueCache
Sourcepub fn synchronize(&mut self, styled_dom: &StyledDom) -> GpuEventChanges
pub fn synchronize(&mut self, styled_dom: &StyledDom) -> GpuEventChanges
Synchronizes the cache with the current StyledDom, generating change events
for CSS transform and opacity additions, modifications, and removals.
Trait Implementations§
Source§impl Clone for GpuValueCache
impl Clone for GpuValueCache
Source§fn clone(&self) -> GpuValueCache
fn clone(&self) -> GpuValueCache
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more