Struct webrender::scene::SceneProperties

source ·
pub struct SceneProperties {
    transform_properties: FastHashMap<PropertyBindingId, LayoutTransform>,
    float_properties: FastHashMap<PropertyBindingId, f32>,
    color_properties: FastHashMap<PropertyBindingId, ColorF>,
    current_properties: DynamicProperties,
    pending_properties: Option<DynamicProperties>,
}
Expand description

Stores a map of the animated property bindings for the current display list. These can be used to animate the transform and/or opacity of a display list without re-submitting the display list itself.

Fields§

§transform_properties: FastHashMap<PropertyBindingId, LayoutTransform>§float_properties: FastHashMap<PropertyBindingId, f32>§color_properties: FastHashMap<PropertyBindingId, ColorF>§current_properties: DynamicProperties§pending_properties: Option<DynamicProperties>

Implementations§

source§

impl SceneProperties

source

pub fn new() -> Self

source

pub fn reset_properties(&mut self)

Reset the pending properties without flush.

source

pub fn add_properties(&mut self, properties: DynamicProperties)

Add to the current property list for this display list.

source

pub fn add_transforms( &mut self, transforms: Vec<PropertyValue<LayoutTransform>>, )

Add to the current transform property list for this display list.

source

pub fn flush_pending_updates(&mut self) -> bool

Flush any pending updates to the scene properties. Returns true if the properties have changed since the last flush was called. This code allows properties to be changed by multiple reset_properties, add_properties and add_transforms calls during a single transaction, and still correctly determine if any properties have changed. This can have significant power saving implications, allowing a frame build to be skipped if the properties haven’t changed in many cases.

source

pub fn resolve_layout_transform( &self, property: &PropertyBinding<LayoutTransform>, ) -> LayoutTransform

Get the current value for a transform property.

source

pub fn resolve_float(&self, property: &PropertyBinding<f32>) -> f32

Get the current value for a float property.

source

pub fn float_properties(&self) -> &FastHashMap<PropertyBindingId, f32>

source

pub fn resolve_color(&self, property: &PropertyBinding<ColorF>) -> ColorF

Get the current value for a color property.

source

pub fn color_properties(&self) -> &FastHashMap<PropertyBindingId, ColorF>

Trait Implementations§

source§

impl Serialize for SceneProperties

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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>,

§

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.