rust-mobile / ndk

Rust bindings to the Android NDK
Apache License 2.0
1.11k stars 110 forks source link

ndk/hardware_buffer: Convert `HardwareBufferUsage` to `bitflags` #461

Closed MarijnS95 closed 7 months ago

MarijnS95 commented 8 months ago

HardwareBufferUsage really is a structure that comprises various usage flags, and was modeled as a hard-to-get u64 value while being wrapped inside two newtypes (one in the ndk, one in ndk-sys) and without the typical bit-ops (i.e. BitOr) one comes to expect.

This is all provided out of the box - and more helper functions - via bitflags with more convenient access to the raw value to beat.

Also inherit the upstream docs for convenience and completeness.