pub struct GpuValueCache {
pub transform_keys: BTreeMap<NodeId, TransformKey>,
pub current_transform_values: BTreeMap<NodeId, ComputedTransform3D>,
pub opacity_keys: BTreeMap<NodeId, OpacityKey>,
pub current_opacity_values: BTreeMap<NodeId, f32>,
pub scrollbar_v_opacity_keys: BTreeMap<(DomId, NodeId), OpacityKey>,
pub scrollbar_h_opacity_keys: BTreeMap<(DomId, NodeId), OpacityKey>,
pub scrollbar_v_opacity_values: BTreeMap<(DomId, NodeId), f32>,
pub scrollbar_h_opacity_values: BTreeMap<(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- Maps node IDs to their WebRender transform keyscurrent_transform_values- Current computed transform for each nodeopacity_keys- Maps node IDs to their WebRender opacity keyscurrent_opacity_values- Current opacity value for each nodescrollbar_v_opacity_keys- Maps (DomId, NodeId) to vertical scrollbar opacity keysscrollbar_h_opacity_keys- Maps (DomId, NodeId) to horizontal scrollbar opacity keysscrollbar_v_opacity_values- Current vertical scrollbar opacity valuesscrollbar_h_opacity_values- Current horizontal scrollbar opacity values
Fields§
§transform_keys: BTreeMap<NodeId, TransformKey>§current_transform_values: BTreeMap<NodeId, ComputedTransform3D>§opacity_keys: BTreeMap<NodeId, OpacityKey>§current_opacity_values: BTreeMap<NodeId, f32>§scrollbar_v_opacity_keys: BTreeMap<(DomId, NodeId), OpacityKey>§scrollbar_h_opacity_keys: BTreeMap<(DomId, NodeId), OpacityKey>§scrollbar_v_opacity_values: BTreeMap<(DomId, NodeId), f32>§scrollbar_h_opacity_values: BTreeMap<(DomId, NodeId), f32>Implementations§
Source§impl GpuValueCache
impl GpuValueCache
Sourcepub fn synchronize<'a>(&mut self, styled_dom: &StyledDom) -> GpuEventChanges
pub fn synchronize<'a>(&mut self, styled_dom: &StyledDom) -> GpuEventChanges
Synchronizes the cache with the current StyledDom, generating change events.
This method:
- Computes current transform and opacity values from CSS properties
- Compares with cached values to detect changes
- Generates events for additions, changes, and removals
- Updates the internal cache state
§Performance
On x86_64, this function detects and uses SSE/AVX instructions for optimized transform calculations.
§Returns
GpuEventChanges containing all transform and opacity change events.
Trait Implementations§
Source§impl Clone for GpuValueCache
impl Clone for GpuValueCache
Source§fn clone(&self) -> GpuValueCache
fn clone(&self) -> GpuValueCache
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GpuValueCache
impl Debug for GpuValueCache
Source§impl Default for GpuValueCache
impl Default for GpuValueCache
Source§fn default() -> GpuValueCache
fn default() -> GpuValueCache
Returns the “default value” for a type. Read more
Source§impl PartialEq for GpuValueCache
impl PartialEq for GpuValueCache
Source§impl PartialOrd for GpuValueCache
impl PartialOrd for GpuValueCache
impl StructuralPartialEq for GpuValueCache
Auto Trait Implementations§
impl Freeze for GpuValueCache
impl RefUnwindSafe for GpuValueCache
impl Send for GpuValueCache
impl Sync for GpuValueCache
impl Unpin for GpuValueCache
impl UnwindSafe for GpuValueCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more