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
impl SceneProperties
pub fn new() -> Self
sourcepub fn reset_properties(&mut self)
pub fn reset_properties(&mut self)
Reset the pending properties without flush.
sourcepub fn add_properties(&mut self, properties: DynamicProperties)
pub fn add_properties(&mut self, properties: DynamicProperties)
Add to the current property list for this display list.
sourcepub fn add_transforms(
&mut self,
transforms: Vec<PropertyValue<LayoutTransform>>,
)
pub fn add_transforms( &mut self, transforms: Vec<PropertyValue<LayoutTransform>>, )
Add to the current transform property list for this display list.
sourcepub fn flush_pending_updates(&mut self) -> bool
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.
sourcepub fn resolve_layout_transform(
&self,
property: &PropertyBinding<LayoutTransform>,
) -> LayoutTransform
pub fn resolve_layout_transform( &self, property: &PropertyBinding<LayoutTransform>, ) -> LayoutTransform
Get the current value for a transform property.
sourcepub fn resolve_float(&self, property: &PropertyBinding<f32>) -> f32
pub fn resolve_float(&self, property: &PropertyBinding<f32>) -> f32
Get the current value for a float property.
pub fn float_properties(&self) -> &FastHashMap<PropertyBindingId, f32>
sourcepub fn resolve_color(&self, property: &PropertyBinding<ColorF>) -> ColorF
pub fn resolve_color(&self, property: &PropertyBinding<ColorF>) -> ColorF
Get the current value for a color property.
pub fn color_properties(&self) -> &FastHashMap<PropertyBindingId, ColorF>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SceneProperties
impl RefUnwindSafe for SceneProperties
impl Send for SceneProperties
impl Sync for SceneProperties
impl Unpin for SceneProperties
impl UnwindSafe for SceneProperties
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
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>
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>
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