pub struct AndroidSurfaceControlHandle { /* private fields */ }Available on Android only.
Expand description
ASurfaceControl* compositor layer (API 29+).
Implementations§
Source§impl AndroidSurfaceControlHandle
impl AndroidSurfaceControlHandle
Sourcepub unsafe fn try_from_raw(
surface_control: *mut c_void,
keep_alive: Option<KeepAlive>,
) -> Result<Self, InvalidHandleError>
pub unsafe fn try_from_raw( surface_control: *mut c_void, keep_alive: Option<KeepAlive>, ) -> Result<Self, InvalidHandleError>
Wrap an ASurfaceControl* compositor layer (API 29+). Borrowing:
the handle is stored non-owningly, this type has no Drop, and
every obligation below extends to each Clone.
§Safety
surface_controlmust point to a liveASurfaceControlcreated byASurfaceControl_create/ASurfaceControl_createFromWindowand not yetASurfaceControl_released. Null is rejected asInvalidHandleError::NullPointerand is not a caller obligation.- Refcount: no
ASurfaceControl_acquireis issued and there is noDropthat releases. The caller’s reference must outlive this value and everyCloneof it — park it inkeep_alive, or hold it directly when that isNone. - Like
AndroidNativeWindowHandle, this is an output-side handle: the interop layer submits transactions against it and never imports from it. AndroidSurfaceControlHandleisSend + Sync; the caller asserts the layer may be driven from the interop thread.ASurfaceTransactionbatching is itself thread-safe, but the caller must not interleave its own transactions on the same layer in a way that reorders the interop layer’s.
pub fn surface_control(&self) -> *mut c_void
pub fn keep_alive(&self) -> Option<&KeepAlive>
Trait Implementations§
Source§impl Clone for AndroidSurfaceControlHandle
impl Clone for AndroidSurfaceControlHandle
Source§impl Debug for AndroidSurfaceControlHandle
impl Debug for AndroidSurfaceControlHandle
impl Send for AndroidSurfaceControlHandle
impl Sync for AndroidSurfaceControlHandle
Auto Trait Implementations§
impl !RefUnwindSafe for AndroidSurfaceControlHandle
impl !UnwindSafe for AndroidSurfaceControlHandle
impl Freeze for AndroidSurfaceControlHandle
impl Unpin for AndroidSurfaceControlHandle
impl UnsafeUnpin for AndroidSurfaceControlHandle
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