struct RowLayerState {
push_cmd_idx: usize,
span: Option<Span>,
}Expand description
Each recorded layer by itself already stores a bounding box. However, we want to take this one step further and track a horizontal bounding box of each row band individually. This allows us to save a lot of work when clearing buffers during fine rasterization.
For example, let’s say that we are rendering a triangle with the points (0, 0), (500, 0) and (250, 250). The bounding box would be (0, 0) and (500, 500). However, the triangle gets much more narrow as we advance through the rows. If we just chose the coarse bounding box, we would always end up clearing a whole width of 500 pixels during fine rasterization. By tracking the bounding box per row, we can reduce the work to the absolute minimum necessary for each row.
Fields§
§push_cmd_idx: usizeThe index in the command stream where the PushBuf command of the corresponding
layer lives.
span: Option<Span>The horizontal span of the layer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RowLayerState
impl RefUnwindSafe for RowLayerState
impl Send for RowLayerState
impl Sync for RowLayerState
impl Unpin for RowLayerState
impl UnsafeUnpin for RowLayerState
impl UnwindSafe for RowLayerState
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