pub(crate) struct SharedFramebuffer {
opcode: u8,
id: u32,
framebuffer: Mapping,
watch: Mapping,
event: OwnedFd,
pub width: u32,
pub height: u32,
stride: usize,
pixel_offset: usize,
tile: u32,
tiles_x: u32,
tiles_y: u32,
}Expand description
A watch on the framebuffer of the screen of one root window (module docblock).
Fields§
§opcode: u8§id: u32§framebuffer: Mapping§watch: Mapping§event: OwnedFd§width: u32§height: u32§stride: usize§pixel_offset: usize§tile: u32§tiles_x: u32§tiles_y: u32Implementations§
Sourcepub(crate) fn open(conn: &RustConnection, root: u32) -> Opened
pub(crate) fn open(conn: &RustConnection, root: u32) -> Opened
Watch the framebuffer of root’s screen, where the server offers one of 32 bits a pixel.
fn watch(conn: &RustConnection, opcode: u8, root: u32) -> Result<Self, String>
Sourcepub(crate) fn close(self, conn: &RustConnection)
pub(crate) fn close(self, conn: &RustConnection)
End the watch on the server; the mappings go with self.
Sourcepub(crate) fn retired(&self) -> bool
pub(crate) fn retired(&self) -> bool
Whether the screen has moved to another framebuffer (a resize): the watch is over.
Sourcepub(crate) fn drawn(&self) -> bool
pub(crate) fn drawn(&self) -> bool
Whether any tile was drawn into since the bitmap was last taken.
Sourcefn take(&self, into: impl FnMut(usize, u64))
fn take(&self, into: impl FnMut(usize, u64))
Take the tiles drawn since the last take, handing each nonzero word of the bitmap to
into with its index.
Sourcepub(crate) fn wait(&self, timeout: Duration) -> bool
pub(crate) fn wait(&self, timeout: Duration) -> bool
Wait at most timeout for a drawing operation to end on a tile not yet taken, or for the
framebuffer to retire: true where one did, or already had.
Sourcefn settled_seq(&self) -> Option<u64>
fn settled_seq(&self) -> Option<u64>
The drawing count once no operation runs, or None past DRAW_WAIT.
Sourcefn copy_tiles(
&self,
pending: &[u64],
dst: &mut [u8],
dst_stride: usize,
(x, y, width, height): (u32, u32, u32, u32),
)
fn copy_tiles( &self, pending: &[u64], dst: &mut [u8], dst_stride: usize, (x, y, width, height): (u32, u32, u32, u32), )
Copy the tiles pending marks within the region at (x, y) of width x height
into dst (dst_stride bytes a row, the region’s top-left at its start). Each row of
tiles lands in rows of dst of its own, so a change past PARALLEL_BYTES copies its
rows of tiles on COPY_THREADS threads: one thread copying a whole 2560x1600 screen took
1.2 to 6.7 ms, reading what the server had just drawn from another core’s cache, which
held a full-screen change back behind an XShm grab, the server’s copy from its own.
Sourcefn convert_tiles(
&self,
pending: &[u64],
planes: &mut Nv12Planes,
(x, y, width, height): (u32, u32, u32, u32),
bands: usize,
) -> bool
fn convert_tiles( &self, pending: &[u64], planes: &mut Nv12Planes, (x, y, width, height): (u32, u32, u32, u32), bands: usize, ) -> bool
Convert the rows of tiles pending marks within the region at (x, y) of width x
height to 8-bit 4:2:0 BT.709 limited range in planes (the region’s top-left at their
first pixel), as the NV12 x264 encodes in place, across the region’s whole width for each
run of such rows, split into bands of rows converted in parallel as the encode thread’s
own conversion is: the conversion reads the screen where the server keeps it, in place of
copying it out first. False where the conversion refused the geometry.
Auto Trait Implementations§
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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