Revert "Fix/macos texture stride align"

This commit is contained in:
RustDesk
2023-03-03 13:18:34 +08:00
committed by GitHub
parent a35e0a1d84
commit 29abda56df
12 changed files with 52 additions and 65 deletions

View File

@@ -154,7 +154,7 @@ pub struct FlutterHandler {
#[cfg(feature = "flutter_texture_render")]
pub type FlutterRgbaRendererPluginOnRgba =
unsafe extern "C" fn(texture_rgba: *mut c_void, buffer: *const u8, len: c_int, width: c_int, height: c_int, stride: c_int);
unsafe extern "C" fn(texture_rgba: *mut c_void, buffer: *const u8, width: c_int, height: c_int);
// Video Texture Renderer in Flutter
#[cfg(feature = "flutter_texture_render")]
@@ -206,9 +206,7 @@ impl VideoRenderer {
self.width = width;
self.height = height;
self.data_len = if width > 0 && height > 0 {
let sa1 = crate::common::DST_STRIDE_RGBA - 1;
let row_bytes = (width as usize * 4 + sa1) & !sa1;
row_bytes * height as usize
(width * height * 4) as usize
} else {
0
};
@@ -223,10 +221,8 @@ impl VideoRenderer {
func(
self.ptr as _,
rgba.as_ptr() as _,
rgba.len() as _,
self.width as _,
self.height as _,
crate::common::DST_STRIDE_RGBA as _,
)
};
}