Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndk/hardware_buffer: Convert HardwareBufferUsage to bitflags #461

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

MarijnS95
Copy link
Member

@MarijnS95 MarijnS95 commented Dec 25, 2023

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.

@MarijnS95 MarijnS95 force-pushed the hardware-buffer-usage-bitflags branch from 24f4d4d to 2dfabcb Compare December 25, 2023 22:38
@MarijnS95 MarijnS95 added the impact: breaking API/ABI-breaking change label Dec 25, 2023
@MarijnS95 MarijnS95 force-pushed the hardware-buffer-usage-bitflags branch from 2dfabcb to 901903f Compare January 29, 2024 23:20
@MarijnS95 MarijnS95 requested a review from rib January 29, 2024 23:21
Copy link
Contributor

@rib rib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

`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.
@MarijnS95 MarijnS95 force-pushed the hardware-buffer-usage-bitflags branch from 901903f to 7d0cacd Compare February 4, 2024 16:16
@MarijnS95 MarijnS95 merged commit ec19614 into master Feb 4, 2024
38 checks passed
@MarijnS95 MarijnS95 deleted the hardware-buffer-usage-bitflags branch February 4, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: breaking API/ABI-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants