pub struct ThreePhaseRanges {
pub bg: Range<u32>,
pub extra_bg: Range<u32>,
pub text: Range<u32>,
pub cursor_overlays: Range<u32>,
}Expand description
Absolute instance ranges for one three-phase cell draw.
ARC-004: the pane path suballocates the shared instance buffers, so a pane’s
instances no longer start at index 0. Every range here is absolute into
bg_instance_buffer / text_instance_buffer, which lets several panes stay
resident at once and be drawn from a single command encoder.
Fields§
§bg: Range<u32>Phase 1 — cell background quads (includes the pane’s viewport fill quad).
extra_bg: Range<u32>Phase 1b — separator / gutter quads that live after the cursor overlays. Empty on the pane path, which packs separators before the overlays.
text: Range<u32>Phase 2 — glyph and underline quads.
cursor_overlays: Range<u32>Phase 3 — cursor overlays, drawn last so they sit on top of the glyphs.
Implementations§
Source§impl ThreePhaseRanges
impl ThreePhaseRanges
Sourcepub fn draw_sequence(&self) -> [(CellDrawPhase, Range<u32>); 4]
pub fn draw_sequence(&self) -> [(CellDrawPhase, Range<u32>); 4]
The phases in the order they must be drawn, with the range each covers.
This is the single source of truth for the ordering.
CellRenderer::emit_three_phase_draw_calls walks exactly this sequence,
so the order cannot be changed there without changing it here — which is
what makes the invariant testable without a GPU.
Sourcepub fn for_single_grid(
layout: &SingleGridLayout,
actual_bg_instances: usize,
actual_text_instances: usize,
) -> Self
pub fn for_single_grid( layout: &SingleGridLayout, actual_bg_instances: usize, actual_text_instances: usize, ) -> Self
Draw ranges for the single-grid layout build_instance_buffers writes.
actual_bg_instances is clamped up to the end of the overlay slots so a
grid that has not been built yet cannot produce an inverted range.
Sourcepub fn for_pane(
bg: Range<usize>,
cursor_overlays: Range<usize>,
text: Range<usize>,
) -> Self
pub fn for_pane( bg: Range<usize>, cursor_overlays: Range<usize>, text: Range<usize>, ) -> Self
Draw ranges for one pane’s slice of the shared instance buffers.
The pane builder packs separators before the cursor overlays and emits
the overlays immediately after its background run, so phase 1b is empty
and the overlays are contiguous with bg.
Trait Implementations§
Source§impl Clone for ThreePhaseRanges
impl Clone for ThreePhaseRanges
Source§fn clone(&self) -> ThreePhaseRanges
fn clone(&self) -> ThreePhaseRanges
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ThreePhaseRanges
impl Debug for ThreePhaseRanges
impl Eq for ThreePhaseRanges
Source§impl PartialEq for ThreePhaseRanges
impl PartialEq for ThreePhaseRanges
impl StructuralPartialEq for ThreePhaseRanges
Auto Trait Implementations§
impl Freeze for ThreePhaseRanges
impl RefUnwindSafe for ThreePhaseRanges
impl Send for ThreePhaseRanges
impl Sync for ThreePhaseRanges
impl Unpin for ThreePhaseRanges
impl UnsafeUnpin for ThreePhaseRanges
impl UnwindSafe for ThreePhaseRanges
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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