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_bottomare extra logical pixels of content rastered above / below the widget bounds.blit_dyis 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_dyis 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_dyto 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_overlayso 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: f64Extra logical pixels of content rastered above the widget’s top edge.
overscan_bottom: f64Extra logical pixels of content rastered below the widget’s bottom edge.
blit_dy: f64Vertical 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
impl Clone for BackbufferBand
Source§fn clone(&self) -> BackbufferBand
fn clone(&self) -> BackbufferBand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BackbufferBand
Source§impl Debug for BackbufferBand
impl Debug for BackbufferBand
Source§impl PartialEq for BackbufferBand
impl PartialEq for BackbufferBand
impl StructuralPartialEq for BackbufferBand
Auto Trait Implementations§
impl Freeze for BackbufferBand
impl RefUnwindSafe for BackbufferBand
impl Send for BackbufferBand
impl Sync for BackbufferBand
impl Unpin for BackbufferBand
impl UnsafeUnpin for BackbufferBand
impl UnwindSafe for BackbufferBand
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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for 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