Skip to main content

AHardwareBufferUsageFlags

Struct AHardwareBufferUsageFlags 

Source
#[repr(transparent)]
pub struct AHardwareBufferUsageFlags(pub c_ulong);
Expand description

Buffer usage flags, specifying how the buffer will be accessed.

Tuple Fields§

§0: c_ulong

Implementations§

Source§

impl AHardwareBufferUsageFlags

Source

pub const CPU_READ_NEVER: AHardwareBufferUsageFlags

The buffer will never be locked for direct CPU reads using the AHardwareBuffer_lock() function. Note that reading the buffer using OpenGL or Vulkan functions or memory mappings is still allowed.

Source§

impl AHardwareBufferUsageFlags

Source

pub const CPU_READ_RARELY: AHardwareBufferUsageFlags

The buffer will sometimes be locked for direct CPU reads using the AHardwareBuffer_lock() function. Note that reading the buffer using OpenGL or Vulkan functions or memory mappings does not require the presence of this flag.

Source§

impl AHardwareBufferUsageFlags

Source

pub const CPU_READ_OFTEN: AHardwareBufferUsageFlags

The buffer will often be locked for direct CPU reads using the AHardwareBuffer_lock() function. Note that reading the buffer using OpenGL or Vulkan functions or memory mappings does not require the presence of this flag.

Source§

impl AHardwareBufferUsageFlags

Source

pub const CPU_READ_MASK: AHardwareBufferUsageFlags

CPU read value mask.

Source§

impl AHardwareBufferUsageFlags

Source

pub const CPU_WRITE_NEVER: AHardwareBufferUsageFlags

The buffer will never be locked for direct CPU writes using the AHardwareBuffer_lock() function. Note that writing the buffer using OpenGL or Vulkan functions or memory mappings is still allowed.

Source§

impl AHardwareBufferUsageFlags

Source

pub const CPU_WRITE_RARELY: AHardwareBufferUsageFlags

The buffer will sometimes be locked for direct CPU writes using the AHardwareBuffer_lock() function. Note that writing the buffer using OpenGL or Vulkan functions or memory mappings does not require the presence of this flag.

Source§

impl AHardwareBufferUsageFlags

Source

pub const CPU_WRITE_OFTEN: AHardwareBufferUsageFlags

The buffer will often be locked for direct CPU writes using the AHardwareBuffer_lock() function. Note that writing the buffer using OpenGL or Vulkan functions or memory mappings does not require the presence of this flag.

Source§

impl AHardwareBufferUsageFlags

Source

pub const CPU_WRITE_MASK: AHardwareBufferUsageFlags

CPU write value mask.

Source§

impl AHardwareBufferUsageFlags

Source

pub const GPU_SAMPLED_IMAGE: AHardwareBufferUsageFlags

The buffer will be read from by the GPU as a texture.

Source§

impl AHardwareBufferUsageFlags

Source

pub const GPU_FRAMEBUFFER: AHardwareBufferUsageFlags

The buffer will be written to by the GPU as a framebuffer attachment.

Source§

impl AHardwareBufferUsageFlags

Source

pub const GPU_COLOR_OUTPUT: AHardwareBufferUsageFlags

The buffer will be written to by the GPU as a framebuffer attachment.

Note that the name of this flag is somewhat misleading: it does not imply that the buffer contains a color format. A buffer with depth or stencil format that will be used as a framebuffer attachment should also have this flag. Use the equivalent flag AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER to avoid this confusion.

Source§

impl AHardwareBufferUsageFlags

Source

pub const COMPOSER_OVERLAY: AHardwareBufferUsageFlags

The buffer will be used as a composer HAL overlay layer.

This flag is currently only needed when using ASurfaceTransaction_setBuffer to set a buffer. In all other cases, the framework adds this flag internally to buffers that could be presented in a composer overlay. ASurfaceTransaction_setBuffer is special because it uses buffers allocated directly through AHardwareBuffer_allocate instead of buffers allocated by the framework.

Source§

impl AHardwareBufferUsageFlags

Source

pub const PROTECTED_CONTENT: AHardwareBufferUsageFlags

The buffer is protected from direct CPU access or being read by non-secure hardware, such as video encoders.

This flag is incompatible with CPU read and write flags. It is mainly used when handling DRM video. Refer to the EGL extension EGL_EXT_protected_content and GL extension GL_EXT_protected_textures for more information on how these buffers are expected to behave.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VIDEO_ENCODE: AHardwareBufferUsageFlags

The buffer will be read by a hardware video encoder.

Source§

impl AHardwareBufferUsageFlags

Source

pub const SENSOR_DIRECT_DATA: AHardwareBufferUsageFlags

The buffer will be used for direct writes from sensors. When this flag is present, the format must be AHARDWAREBUFFER_FORMAT_BLOB.

Source§

impl AHardwareBufferUsageFlags

Source

pub const GPU_DATA_BUFFER: AHardwareBufferUsageFlags

The buffer will be used as a shader storage or uniform buffer object. When this flag is present, the format must be AHARDWAREBUFFER_FORMAT_BLOB.

Source§

impl AHardwareBufferUsageFlags

Source

pub const GPU_CUBE_MAP: AHardwareBufferUsageFlags

The buffer will be used as a cube map texture. When this flag is present, the buffer must have a layer count that is a multiple of 6. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const GPU_MIPMAP_COMPLETE: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_0: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_1: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_2: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_3: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_4: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_5: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_6: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_7: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_8: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_9: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_10: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_11: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_12: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_13: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_14: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_15: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_16: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_17: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_18: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Source§

impl AHardwareBufferUsageFlags

Source

pub const VENDOR_19: AHardwareBufferUsageFlags

The buffer contains a complete mipmap hierarchy. Note that buffers with this flag must be bound to OpenGL textures using the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.

Trait Implementations§

Source§

impl BitAnd for AHardwareBufferUsageFlags

Source§

type Output = AHardwareBufferUsageFlags

The resulting type after applying the & operator.
Source§

fn bitand(self, other: Self) -> Self

Performs the & operation. Read more
Source§

impl BitAndAssign for AHardwareBufferUsageFlags

Source§

fn bitand_assign(&mut self, rhs: AHardwareBufferUsageFlags)

Performs the &= operation. Read more
Source§

impl BitOr for AHardwareBufferUsageFlags

Source§

type Output = AHardwareBufferUsageFlags

The resulting type after applying the | operator.
Source§

fn bitor(self, other: Self) -> Self

Performs the | operation. Read more
Source§

impl BitOrAssign for AHardwareBufferUsageFlags

Source§

fn bitor_assign(&mut self, rhs: AHardwareBufferUsageFlags)

Performs the |= operation. Read more
Source§

impl Clone for AHardwareBufferUsageFlags

Source§

fn clone(&self) -> AHardwareBufferUsageFlags

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for AHardwareBufferUsageFlags

Source§

impl Debug for AHardwareBufferUsageFlags

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AHardwareBufferUsageFlags

Source§

impl Hash for AHardwareBufferUsageFlags

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for AHardwareBufferUsageFlags

Source§

fn eq(&self, other: &AHardwareBufferUsageFlags) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for AHardwareBufferUsageFlags

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.