Skip to content

Commit

Permalink
Remove public reexports of HardwareBufferFormat (#436)
Browse files Browse the repository at this point in the history
This was previously reexported from `hardware_buffer` in #276 to
maintain backwards compatibility when the type was originally defined
inside that module.  However, the type was also strangely reexported
from `native_window` (probably a copy-paste error) while it is
accessible from the public `hardware_buffer_format` module leading
to **three** individual modules where `HardwareBufferFormat` can be
imported from.

Reduce this duplication and confusion by forcing it to only be reachable
from the canonical `hardware_buffer_format` module.
  • Loading branch information
MarijnS95 committed Oct 10, 2023
1 parent 3b124fa commit 091764f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions ndk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- **Breaking:** bitmap: Strip `Android` prefix from structs and enums, and `Bitmap` from `Result`. (#430)
- **Breaking:** `raw-window-handle 0.5` support is now behind an _optional_ `rwh_05` crate feature and `raw-window-handle` `0.4` and `0.6` support is provided via the new `rwh_04` and (default-enabled) `rwh_06` crate features. (#434)
- **Breaking:** looper: Provide `event` value to file descriptor poll callback. (#435)
- **Breaking:** `HardwareBufferFormat` is no longer exported from `hardware_buffer` and `native_window`, and can only be reached through the `hardware_buffer_format` module. (#436)

# 0.7.0 (2022-07-24)

Expand Down
8 changes: 4 additions & 4 deletions ndk/src/hardware_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

#![cfg(feature = "api-level-26")]

use crate::utils::status_to_io_result;

pub use super::hardware_buffer_format::HardwareBufferFormat;
use jni_sys::{jobject, JNIEnv};
use std::{
io::Result,
mem::MaybeUninit,
Expand All @@ -19,6 +15,10 @@ use std::{
ptr::NonNull,
};

use jni_sys::{jobject, JNIEnv};

use super::{hardware_buffer_format::HardwareBufferFormat, utils::status_to_io_result};

#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct HardwareBufferUsage(pub ffi::AHardwareBuffer_UsageFlags);

Expand Down
6 changes: 3 additions & 3 deletions ndk/src/native_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
//!
//! [`ANativeWindow`]: https://developer.android.com/ndk/reference/group/a-native-window#anativewindow

use crate::utils::status_to_io_result;
use std::{ffi::c_void, io, mem::MaybeUninit, ptr::NonNull};

pub use super::hardware_buffer_format::HardwareBufferFormat;
use jni_sys::{jobject, JNIEnv};
use std::{ffi::c_void, io, mem::MaybeUninit, ptr::NonNull};

use super::{hardware_buffer_format::HardwareBufferFormat, utils::status_to_io_result};

pub type Rect = ffi::ARect;

Expand Down

0 comments on commit 091764f

Please sign in to comment.