pub struct DisplayList {
pub ops: Vec<DisplayOp>,
pub bounds: LayoutRect,
}Expand description
An ordered list of DisplayOps ready to be consumed by a Renderer.
The display list is the final output of the Fission pipeline before pixels. It is serializable, so it can be sent to a separate render thread or process.
§Example
use fission_render::*;
let bounds = LayoutRect::new(0.0, 0.0, 800.0, 600.0);
let mut list = DisplayList::new(bounds);
list.push(DisplayOp::Save);
list.push(DisplayOp::DrawRect {
rect: LayoutRect::new(10.0, 10.0, 100.0, 50.0),
fill: Some(Fill { color: Color { r: 0, g: 0, b: 0, a: 255 } }),
stroke: None,
corner_radius: 0.0,
shadow: None,
bounds: LayoutRect::new(10.0, 10.0, 100.0, 50.0),
node_id: None,
});
list.push(DisplayOp::Restore);
assert_eq!(list.ops.len(), 3);Fields§
§ops: Vec<DisplayOp>The ordered sequence of rendering commands.
bounds: LayoutRectThe bounding rectangle of the entire scene (typically the viewport).
Implementations§
Source§impl DisplayList
impl DisplayList
Trait Implementations§
Source§impl Clone for DisplayList
impl Clone for DisplayList
Source§fn clone(&self) -> DisplayList
fn clone(&self) -> DisplayList
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 DisplayList
impl Debug for DisplayList
Source§impl<'de> Deserialize<'de> for DisplayList
impl<'de> Deserialize<'de> for DisplayList
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DisplayList
impl PartialEq for DisplayList
Source§impl Serialize for DisplayList
impl Serialize for DisplayList
impl StructuralPartialEq for DisplayList
Auto Trait Implementations§
impl Freeze for DisplayList
impl RefUnwindSafe for DisplayList
impl Send for DisplayList
impl Sync for DisplayList
impl Unpin for DisplayList
impl UnsafeUnpin for DisplayList
impl UnwindSafe for DisplayList
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