pub(crate) struct ScreenshotReadbacks {
pub(crate) slots: Vec<(Arc<ReadbackSlot>, Instant)>,
pub(crate) storage: Option<Option<unsafe extern "system" fn(u32, isize, *const c_void, u32)>>,
}Expand description
The persistently mapped pixel-pack buffers GLES screenshots are read back into, so the
compositor only issues the transfer and the caller copies the pixels out once the GPU has
written them. Without GL_EXT_buffer_storage, or with PIXELFLUX_SCREENSHOT_SYNC set, the
compositor reads back synchronously into the caller’s buffer instead. Declared ahead of the
renderer in AppState, so its drop forgets every mapping, waiting
out a copy under way, before the GL context goes away.
Fields§
§slots: Vec<(Arc<ReadbackSlot>, Instant)>§storage: Option<Option<unsafe extern "system" fn(u32, isize, *const c_void, u32)>>The entry point, once looked up: None before the first GLES screenshot.
Implementations§
Source§impl ScreenshotReadbacks
impl ScreenshotReadbacks
pub(crate) fn lookup( gl: &Gles2, ) -> Option<unsafe extern "system" fn(u32, isize, *const c_void, u32)>
Sourcepub(crate) fn acquire(
&mut self,
gl: &Gles2,
len: usize,
now: Instant,
) -> Option<Arc<ReadbackSlot>>
pub(crate) fn acquire( &mut self, gl: &Gles2, len: usize, now: Instant, ) -> Option<Arc<ReadbackSlot>>
A free slot of len bytes, made when none is; None sends the screenshot down the
synchronous readback.
pub(crate) fn create( gl: &Gles2, storage: unsafe extern "system" fn(u32, isize, *const c_void, u32), len: usize, ) -> Option<ReadbackSlot>
pub(crate) fn delete(gl: &Gles2, slot: &ReadbackSlot)
Sourcepub(crate) fn has_idle(&self, now: Instant) -> bool
pub(crate) fn has_idle(&self, now: Instant) -> bool
Whether a free slot has gone unused long enough to be deleted.
pub(crate) fn reap_idle(&mut self, gl: &Gles2, now: Instant)
Trait Implementations§
Source§impl Default for ScreenshotReadbacks
impl Default for ScreenshotReadbacks
Source§fn default() -> ScreenshotReadbacks
fn default() -> ScreenshotReadbacks
Returns the “default value” for a type. Read more
Source§impl Drop for ScreenshotReadbacks
impl Drop for ScreenshotReadbacks
Auto Trait Implementations§
impl Freeze for ScreenshotReadbacks
impl RefUnwindSafe for ScreenshotReadbacks
impl Send for ScreenshotReadbacks
impl Sync for ScreenshotReadbacks
impl Unpin for ScreenshotReadbacks
impl UnsafeUnpin for ScreenshotReadbacks
impl UnwindSafe for ScreenshotReadbacks
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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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> ⓘ
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 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> ⓘ
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().