Conversation
This was referenced Jun 12, 2022
Member
Author
|
@dvc94ch Assuming you have more rights to this repo, can you turn on Thanks! |
Contributor
|
Nope, don't have access |
Member
Author
|
@francesca64 maybe? |
msiglreith
approved these changes
Jul 5, 2022
…helper conversion function These `AHardwareBuffer` functions all return [standard `errno.h` error codes] which can be communicated back to the user in ergonomic form instead of appearing as a newtyped struct holding a "meaningless" `i32`. Perform the same conversion to just `NativeWindow::set_buffers_geometry` which also returns `errno.h` codes: this change is small enough to not warrant _yet another_ PR, as we've already changed the exact same for `InputQueueError` in [#292]. (Note that this is intentionally omitted from the changelog since `set_buffers_geometry()` is only making its debut in the upcoming release, this change isn't breaking). This pattern is now prevalent across the codebase (`hardware_buffer`, `surface_texture`, and `native_window` all use it), warranting the new `status_to_io_result()` helper function to be introduced in an also-new `utils.rs` module. [standard `errno.h` error codes]: https://cs.android.com/android/platform/superproject/+/master:frameworks/native/libs/nativewindow/AHardwareBuffer.cpp;drc=4120991d92a0265ce480672f704612556328057e [#292]: #292
a04d578 to
d9e44b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Depends on #294
These
AHardwareBufferfunctions all return standarderrno.herror codes which can be communicated back to the user in ergonomic form instead of appearing as a newtyped struct holding a "meaningless"i32.Perform the same conversion to just
NativeWindow::set_buffers_geometrywhich also returnserrno.hcodes: this change is small enough to not warrant yet another PR, as we've already changed the exact same forInputQueueErrorin #292. (Note that this is intentionally omitted from the changelog sinceset_buffers_geometry()is only making its debut in the upcoming release, this change isn't breaking).This pattern is now prevalent across the codebase (
hardware_buffer,surface_texture, andnative_windowall use it), warranting the newstatus_to_io_result()helper function to be introduced in an also-newutils.rsmodule.