pub struct DisplayListBuilder { /* private fields */ }Expand description
Builder for constructing a display list incrementally.
Chrome equivalent: PaintController (the state machine that
tracks current property state and builds chunks).
§Usage
ⓘ
let mut builder = DisplayList::builder();
builder.push(DisplayItem::Draw(DrawCommand::Rect { ... }));
builder.push_state(new_property_state);
builder.push(DisplayItem::Draw(DrawCommand::Text { ... }));
let display_list = builder.finish();Implementations§
Source§impl DisplayListBuilder
impl DisplayListBuilder
Sourcepub fn push(&mut self, item: DisplayItem)
pub fn push(&mut self, item: DisplayItem)
Push a display item into the current chunk.
Sourcepub fn set_state(&mut self, state: PropertyState)
pub fn set_state(&mut self, state: PropertyState)
Change the property state, starting a new chunk if different.
Chrome equivalent: PaintController::UpdateCurrentPaintChunkProperties().
Sourcepub fn finish(self) -> DisplayList
pub fn finish(self) -> DisplayList
Finish building and return the display list.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DisplayListBuilder
impl !RefUnwindSafe for DisplayListBuilder
impl Send for DisplayListBuilder
impl Sync for DisplayListBuilder
impl Unpin for DisplayListBuilder
impl UnsafeUnpin for DisplayListBuilder
impl !UnwindSafe for DisplayListBuilder
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> 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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert