pub struct XSurfaceFrame<'a> { /* private fields */ }x11 only.Expand description
๐ โฌก Borrowed mutable X11 surface for direct frame rendering.
๐ sys/device/display/x11::XSurfaceFrame
๐ฆ size_of::<XSurfaceFrame<'_>>() == 32 bytes / 256 bits #๏ธโฃ #[cfg(target_pointer_width = โ64โ)]
โ๏ธOption<T> ๐ฐ T
This exposes the retained X11 presentation surface for one frame.
Drawing into this surface avoids the intermediate scene-to-surface copy
used by XRasterRenderer.
XSurfaceFrame is the X11 direct-surface path.
It exposes the retained X11 surface for one frame, allowing callers to render directly into the CPU/SHM presentation buffer.
Use it when X11-specific performance or surface control matters.
Implementationsยง
Sourceยงimpl<'a> XSurfaceFrame<'a>
impl<'a> XSurfaceFrame<'a>
Sourcepub const fn bits_per_pixel(&self) -> u8
pub const fn bits_per_pixel(&self) -> u8
Returns the number of stored bits per pixel.
Sourcepub const fn bytes_per_pixel(&self) -> Option<u8> โ
pub const fn bytes_per_pixel(&self) -> Option<u8> โ
Returns the number of stored bytes per pixel, when byte-aligned.
Sourcepub const fn bytes_per_line(&self) -> u32
pub const fn bytes_per_line(&self) -> u32
Returns the byte stride between consecutive rows.
Sourcepub const fn mode(&self) -> XImageMode
pub const fn mode(&self) -> XImageMode
Returns the active surface backing mode.
Sourcepub const fn is_tight_rows(&self) -> bool
pub const fn is_tight_rows(&self) -> bool
Returns whether each row has no backend padding.
Sourcepub const fn raster_layout(&self) -> Option<RasterLayout> โ
pub const fn raster_layout(&self) -> Option<RasterLayout> โ
Returns this surfaceโs byte-addressable raster layout.
The layout describes its pixel extent, stored bytes per pixel, row stride, and upper-first row orientation. It does not describe the pixel color or channel encoding.
Returns None when the stored pixel width is not byte-aligned.
Sourcepub const fn supports_rgb8(&self) -> bool
pub const fn supports_rgb8(&self) -> bool
Returns whether RGB8 colors can be encoded and written directly to this surface.
Sourcepub const fn encode_rgb8(&self, rgb: [u8; 3]) -> Option<u32> โ
pub const fn encode_rgb8(&self, rgb: [u8; 3]) -> Option<u32> โ
Encodes an RGB8 color as this X11 surfaceโs native pixel value.
Returns None when this surface does not support direct RGB8 encoding.
Sourcepub fn write_rgb8(&mut self, coord: Position2<u32>, rgb: [u8; 3]) -> bool
pub fn write_rgb8(&mut self, coord: Position2<u32>, rgb: [u8; 3]) -> bool
Encodes and writes an RGB8 color at coord.
Returns whether the pixel was written.
Sourcepub const fn supports_native_pixel(&self) -> bool
pub const fn supports_native_pixel(&self) -> bool
Returns whether native pixel values can be written directly to this surface.
Auto Trait Implementationsยง
impl<'a> !Send for XSurfaceFrame<'a>
impl<'a> !Sync for XSurfaceFrame<'a>
impl<'a> !UnwindSafe for XSurfaceFrame<'a>
impl<'a> Freeze for XSurfaceFrame<'a>
impl<'a> RefUnwindSafe for XSurfaceFrame<'a>
impl<'a> Unpin for XSurfaceFrame<'a>
impl<'a> UnsafeUnpin for XSurfaceFrame<'a>
Blanket Implementationsยง
Sourceยงimpl<T> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.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> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice only.