pub struct MockHardwareBuffer {
pub width: u32,
pub height: u32,
pub format: HardwareBufferFormat,
pub usage: HardwareBufferUsage,
}Expand description
A hardware buffer of a size, in the format the test gives, with no pixels on any GPU: it is imported as no texture, as a buffer a device cannot take, which a drawing skips, and its pixels read back opaque black where it is in BGRA.
Fields§
§width: u32§height: u32§format: HardwareBufferFormat§usage: HardwareBufferUsageTrait Implementations§
Source§impl Clone for MockHardwareBuffer
impl Clone for MockHardwareBuffer
impl Copy for MockHardwareBuffer
Source§impl Debug for MockHardwareBuffer
impl Debug for MockHardwareBuffer
impl Eq for MockHardwareBuffer
Source§impl HardwareBuffer for MockHardwareBuffer
impl HardwareBuffer for MockHardwareBuffer
Source§fn usage(&self) -> HardwareBufferUsage
fn usage(&self) -> HardwareBufferUsage
What the buffer can be used for: at least what it was allocated for, and on some systems
more (see
HardwareBufferUsage). A texture imported of it allows what this allows, and
read_pixels reads it only where this has
cpu_read.Source§fn format(&self) -> HardwareBufferFormat
fn format(&self) -> HardwareBufferFormat
How the buffer lays out its pixels: one plane of colour, or a video decoder’s planes.
Source§fn read_pixels(&self) -> ImageFuture<PixelBuffer>
fn read_pixels(&self) -> ImageFuture<PixelBuffer>
The buffer’s pixels copied into the app’s memory, in the layout the buffer holds them, for a
buffer of one plane: BGRA on Apple platforms, RGBA on Android. It reads what the GPU has
finished writing, so an app that drew into the buffer waits for that work first, as it
does before presenting it;
ImageErrorKind::Unsupported for a
buffer whose usage lacks
cpu_read, on every system, and for one whose pixels are
in no PixelFormat, as a decoder’s planes
(HardwareBufferFormat::Nv12 and P010) are.Source§impl PartialEq for MockHardwareBuffer
impl PartialEq for MockHardwareBuffer
impl StructuralPartialEq for MockHardwareBuffer
Auto Trait Implementations§
impl Forget for MockHardwareBuffer
impl Freeze for MockHardwareBuffer
impl Move for MockHardwareBuffer
impl RefUnwindSafe for MockHardwareBuffer
impl Send for MockHardwareBuffer
impl Sync for MockHardwareBuffer
impl Unpin for MockHardwareBuffer
impl UnsafeUnpin for MockHardwareBuffer
impl UnwindSafe for MockHardwareBuffer
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
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
Compare self to
key and return true if they are equal.