pub struct HardwareBufferUsage {
pub gpu_sampled: bool,
pub gpu_color_output: bool,
pub composer_overlay: bool,
pub cpu_read: bool,
}Expand description
What a buffer can be used for, named after its users, as Android’s AHardwareBuffer usage is:
what the GPU does with it, which a texture imported of it allows
(Platform::import_texture), whether the system’s
compositor shows it as an overlay, and whether the CPU reads it. A video encoder joins as it is
needed.
The usage an app allocates a buffer for is the least the buffer is for, and the buffer answers
all it is for (HardwareBuffer::usage), which every check reads: a system that gives a buffer
more than it was asked, as Apple’s give any IOSurface every use, says so there rather than
hiding it. Android gives a buffer what it was allocated for, as AHardwareBuffer_describe
answers.
Fields§
§gpu_sampled: boolThe GPU samples it in its shaders: Android’s GPU_SAMPLED_IMAGE.
gpu_color_output: boolThe GPU draws into it, as a render pass’s colour output, and copies into it: Android’s
GPU_COLOR_OUTPUT.
composer_overlay: boolThe system’s compositor may show it as a plane of the display, without compositing it on
the GPU: Android’s COMPOSER_OVERLAY, which a buffer presented to a composition layer
there wants and SurfaceFlinger otherwise draws with the GPU, at a cost in power. Core
Animation shows any IOSurface so, and every buffer on Apple’s systems has it.
cpu_read: boolThe CPU reads it, through HardwareBuffer::read_pixels, which answers
ImageErrorKind::Unsupported for a
buffer without it: Android’s CPU_READ_RARELY or CPU_READ_OFTEN. The CPU reads any
IOSurface while it is locked, and every buffer on Apple’s systems has it.
Implementations§
Source§impl HardwareBufferUsage
impl HardwareBufferUsage
Sourcepub const GPU_SAMPLED: HardwareBufferUsage
pub const GPU_SAMPLED: HardwareBufferUsage
Sampled by the GPU only, as a decoded image’s buffer and a video frame’s are.
Sourcepub const ALL: HardwareBufferUsage
pub const ALL: HardwareBufferUsage
Every use, as any IOSurface has.
Trait Implementations§
Source§impl Clone for HardwareBufferUsage
impl Clone for HardwareBufferUsage
impl Copy for HardwareBufferUsage
Source§impl Debug for HardwareBufferUsage
impl Debug for HardwareBufferUsage
Source§impl Default for HardwareBufferUsage
impl Default for HardwareBufferUsage
impl Eq for HardwareBufferUsage
Source§impl PartialEq for HardwareBufferUsage
impl PartialEq for HardwareBufferUsage
impl StructuralPartialEq for HardwareBufferUsage
Auto Trait Implementations§
impl Forget for HardwareBufferUsage
impl Freeze for HardwareBufferUsage
impl Move for HardwareBufferUsage
impl RefUnwindSafe for HardwareBufferUsage
impl Send for HardwareBufferUsage
impl Sync for HardwareBufferUsage
impl Unpin for HardwareBufferUsage
impl UnsafeUnpin for HardwareBufferUsage
impl UnwindSafe for HardwareBufferUsage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.