pub struct CursorSource { /* private fields */ }Expand description
A cursor presented as a scene layer.
Static cursors are painted once. An animated one repaints when the frame under the clock changes, and says so as full-frame damage.
Implementations§
Source§impl CursorSource
impl CursorSource
Sourcepub fn from_argb(
device: &Device,
pixels: &[u32],
width: u32,
height: u32,
xhot: u32,
yhot: u32,
) -> Result<Self, SourceError>
pub fn from_argb( device: &Device, pixels: &[u32], width: u32, height: u32, xhot: u32, yhot: u32, ) -> Result<Self, SourceError>
Build a static cursor from raw premultiplied 0xAARRGGBB pixels.
The themeless fallback: what a caller uses when there is no cursor theme on the system, which is most embedded images.
§Errors
SourceError::Failed with EINVAL if a dimension is zero or oversize
or the pixel count does not match the dimensions, or whatever the
allocation failed with.
Trait Implementations§
Source§impl Debug for CursorSource
impl Debug for CursorSource
Source§impl LayerBufferSource for CursorSource
impl LayerBufferSource for CursorSource
Source§fn acquire(&mut self) -> Result<AcquiredBuffer, SourceError>
fn acquire(&mut self) -> Result<AcquiredBuffer, SourceError>
Produce this frame’s buffer. Read more
Source§fn release(&mut self, _acquired: AcquiredBuffer)
fn release(&mut self, _acquired: AcquiredBuffer)
Return a buffer to the free pool. Read more
Source§fn binding_model(&self) -> BindingModel
fn binding_model(&self) -> BindingModel
Which binding contract this source participates in.
Source§fn format(&self) -> SourceFormat
fn format(&self) -> SourceFormat
The buffer’s shape, read during layer lowering to populate the
properties the allocator consults.
Source§fn map(&mut self, access: MapAccess) -> Result<Mapping<'_>, SourceError>
fn map(&mut self, access: MapAccess) -> Result<Mapping<'_>, SourceError>
Acquire a CPU view of the pixel storage. Read more
Source§fn on_session_paused(&mut self)
fn on_session_paused(&mut self)
The session is losing DRM master; issue no ioctls until resumed.
Source§fn on_session_resumed(&mut self, device: &Device) -> Result<(), SourceError>
fn on_session_resumed(&mut self, device: &Device) -> Result<(), SourceError>
The session is back with a fresh device. Read more
Source§fn release_with_fence(
&mut self,
acquired: AcquiredBuffer,
release_fence: Option<SyncFence>,
)
fn release_with_fence( &mut self, acquired: AcquiredBuffer, release_fence: Option<SyncFence>, )
Release carrying the
OUT_FENCE of the commit that displaced this
buffer. Read moreSource§fn wants_release_fence(&self) -> bool
fn wants_release_fence(&self) -> bool
Whether this source wants the per-buffer release fence. Read more
Source§fn has_fresh_content(&self) -> bool
fn has_fresh_content(&self) -> bool
Whether a producer submitted something new since the last commit. Read more
Source§fn on_retired(&mut self)
fn on_retired(&mut self)
The scene acquires from this source no more: its layer was removed. Read more
Source§fn with_mapping(
&mut self,
access: MapAccess,
f: &mut dyn FnMut(&mut Mapping<'_>),
) -> Result<(), SourceError>
fn with_mapping( &mut self, access: MapAccess, f: &mut dyn FnMut(&mut Mapping<'_>), ) -> Result<(), SourceError>
Source§fn export_dma_buf(&mut self) -> Result<DmaBufDesc<'_>, SourceError>
fn export_dma_buf(&mut self) -> Result<DmaBufDesc<'_>, SourceError>
Export the currently-acquired buffer’s DMA-BUF planes. Read more
Source§fn bind_to_plane(&mut self, plane_id: u32) -> Result<(), SourceError>
fn bind_to_plane(&mut self, plane_id: u32) -> Result<(), SourceError>
Bind a driver-owned producer to a plane. Read more
Source§fn unbind_from_plane(&mut self, plane_id: u32)
fn unbind_from_plane(&mut self, plane_id: u32)
Unbind from a plane, when the layer is reassigned or retired. Dormant,
as
bind_to_plane is.Auto Trait Implementations§
impl Freeze for CursorSource
impl RefUnwindSafe for CursorSource
impl Send for CursorSource
impl Sync for CursorSource
impl Unpin for CursorSource
impl UnsafeUnpin for CursorSource
impl UnwindSafe for CursorSource
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
Mutably borrows from an owned value. Read more