Struct webrender::rectangle_occlusion::FrontToBackBuilder
source · pub struct FrontToBackBuilder {
opaque_items: Vec<Item>,
alpha_items: Vec<Item>,
}
Expand description
A builder that applies occlusion culling with rectangles provided in front-to-back order.
Fields§
§opaque_items: Vec<Item>
§alpha_items: Vec<Item>
Implementations§
source§impl FrontToBackBuilder
impl FrontToBackBuilder
sourcepub fn with_capacity(opaque: usize, alpha: usize) -> Self
pub fn with_capacity(opaque: usize, alpha: usize) -> Self
Pre-allocating constructor.
sourcepub fn add(&mut self, rect: &DeviceBox2D, is_opaque: bool, key: usize) -> bool
pub fn add(&mut self, rect: &DeviceBox2D, is_opaque: bool, key: usize) -> bool
Add a rectangle, potentially splitting it and discarding the occluded parts if any.
Returns true the rectangle is at least partially visible.
sourcepub fn test(&self, rect: &DeviceBox2D) -> bool
pub fn test(&self, rect: &DeviceBox2D) -> bool
Returns true if the provided rect is at least partially visible, without adding it.
sourcepub fn opaque_items(&self) -> &[Item]
pub fn opaque_items(&self) -> &[Item]
The visible opaque rectangles (front-to-back order).
sourcepub fn alpha_items(&self) -> &[Item]
pub fn alpha_items(&self) -> &[Item]
The visible non-opaque rectangles (front-to-back order).
Auto Trait Implementations§
impl RefUnwindSafe for FrontToBackBuilder
impl Send for FrontToBackBuilder
impl Sync for FrontToBackBuilder
impl Unpin for FrontToBackBuilder
impl UnwindSafe for FrontToBackBuilder
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>where
F: FnOnce(&Self) -> bool,
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