Skip to main content

GpuValueCache

Struct GpuValueCache 

Source
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

Source

pub fn empty() -> Self

Creates an empty GPU value cache.

Source

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

Source§

fn clone(&self) -> GpuValueCache

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GpuValueCache

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GpuValueCache

Source§

fn default() -> GpuValueCache

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.