Feat/row align bytes (#7)

* better bytes alignment

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* debug macos

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* debug linux

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* windows switch_rgba

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* better switch_rgba

Signed-off-by: fufesou <shuanglongchen@yeah.net>

---------

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-03-03 09:30:05 +08:00 • committed by GitHub
parent 044bb260d9
commit 873919902e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 94 additions and 60 deletions

View file

@ -1,9 +1,9 @@
import 'dart:ffi';
typedef F1 = Void Function(Pointer<Void> ptr, Pointer<Uint8> buffer,
Int32 width, Int32 height, Int stride_align);
typedef F1 = Void Function(Pointer<Void> ptr, Pointer<Uint8> buffer, Int len,
Int32 width, Int32 height, Int row_align_bytes);
typedef F1Dart = void Function(Pointer<Void> ptr, Pointer<Uint8> buffer,
int width, int height, int stride_align);
int len, int width, int height, int row_align_bytes);
class Native {
Native._();

View file

@ -24,9 +24,9 @@ class TextureRgbaRenderer {
/// Provide the rgba data to the texture.
Future<bool> onRgba(
int key, Uint8List data, int height, int width, int stride_align) {
int key, Uint8List data, int height, int width, int row_align_bytes) {
return TextureRgbaRendererPlatform.instance
.onRgba(key, data, height, width, stride_align);
.onRgba(key, data, height, width, row_align_bytes);
}
Future<int> getTexturePtr(int key) {

View file

@ -37,14 +37,14 @@ class MethodChannelTextureRgbaRenderer extends TextureRgbaRendererPlatform {
}
@override
Future<bool> onRgba(
int key, Uint8List data, int height, int width, int stride_align) async {
Future<bool> onRgba(int key, Uint8List data, int height, int width,
int row_align_bytes) async {
return await methodChannel.invokeMethod<bool>('onRgba', {
"data": data,
"height": height,
"width": width,
"key": key,
"stride_align": stride_align,
"row_align_bytes": row_align_bytes,
}) ??
false;
}

View file

@ -40,7 +40,7 @@ abstract class TextureRgbaRendererPlatform extends PlatformInterface {
}
Future<bool> onRgba(
int key, Uint8List data, int height, int width, int stride_align) {
int key, Uint8List data, int height, int width, int row_align_bytes) {
throw UnimplementedError('onRgba() has not been implemented.');
}