Skip to main content

BackbufferBand

Struct BackbufferBand 

Source
pub struct BackbufferBand {
    pub overscan_top: f64,
    pub overscan_bottom: f64,
    pub blit_dy: f64,
    pub dirty_strip_y: Option<(f64, f64)>,
}
Expand description

Over-scan band request for a scrolling backbuffered widget.

Returned by crate::widget::Widget::backbuffer_band. It lets a widget (today only crate::widgets::TextArea) raster a band of content taller than its own viewport — the visible rect plus an extra overscan_top above and overscan_bottom below — so that ordinary scrolling within the band becomes a pure blit-offset change instead of a full backbuffer re-raster.

§Contract

  • Units. overscan_top / overscan_bottom are extra logical pixels of content rastered above / below the widget bounds. blit_dy is the vertical blit offset in logical pixels (positive shifts the band’s content up in Y-up, revealing lower content). The band is anchored in content space by the widget; blit_dy is the residual between the live scroll offset and the anchor the band was rastered at.
  • Quantization. The framework quantizes both the overscan extents and blit_dy to whole physical pixels before sizing the buffer, translating the raster, and translating the blit — so the LCD subpixel structure is never resampled. The widget may pass raw (unquantized) logical values.
  • Who clips. The framework clips the band blit to the widget’s bounds on every backend, so the over-scan margins never paint over sibling widgets. The widget is responsible for painting opaque content across the whole band (including the over-scan margins) so no gap shows through as the band is scrolled, and for painting any fixed chrome (border) in paint_overlay so it does not scroll with the band.
  • Invalidation. The widget must keep the band’s anchor (and hence the rastered content) out of its backbuffer-cache signature, so scrolling within the band does not invalidate the cache. It must re-anchor and invalidate only when the live offset leaves the band (or the size / content / style changes).

Returning None (the default) opts out entirely and keeps the byte-for-byte original bounds-sized raster + 1:1 blit path.

Fields§

§overscan_top: f64

Extra logical pixels of content rastered above the widget’s top edge.

§overscan_bottom: f64

Extra logical pixels of content rastered below the widget’s bottom edge.

§blit_dy: f64

Vertical blit offset in logical pixels (live offset − band anchor). Positive shifts the band content up (Y-up), revealing lower content.

§dirty_strip_y: Option<(f64, f64)>

Widget-local Y-up logical (lo, hi) extent of the rows the widget will repaint if the framework grants a partial (partial_allowed) re-raster this paint. None means a granted partial would still repaint the whole band (no confined strip). The framework uses this to limit the top-down plane update to exactly those rows, so it must cover byte-for-byte the same extent the widget fills and clips during its strip repaint.

Trait Implementations§

Source§

impl Clone for BackbufferBand

Source§

fn clone(&self) -> BackbufferBand

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BackbufferBand

Source§

impl Debug for BackbufferBand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for BackbufferBand

Source§

fn eq(&self, other: &BackbufferBand) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BackbufferBand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &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)

Converts &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> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

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
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of this value.