merge native setImage with setImageWithDepth

This commit is contained in:
Nick Fisher
2025-06-17 13:25:53 +08:00
parent a91aaae131
commit 65ca59ff22
9 changed files with 94 additions and 378 deletions

View File

@@ -636,30 +636,6 @@ external bool Texture_loadImage(
int level,
);
@ffi.Native<
ffi.Bool Function(
ffi.Pointer<TEngine>,
ffi.Pointer<TTexture>,
ffi.Uint32,
ffi.Pointer<ffi.Uint8>,
ffi.Size,
ffi.Uint32,
ffi.Uint32,
ffi.Uint32,
ffi.Uint32,
ffi.Uint32)>(isLeaf: true)
external bool Texture_setImage(
ffi.Pointer<TEngine> tEngine,
ffi.Pointer<TTexture> tTexture,
int level,
ffi.Pointer<ffi.Uint8> data,
int size,
int width,
int height,
int channels,
int bufferFormat,
int pixelDataType,
);
@ffi.Native<
ffi.Bool Function(
@@ -677,7 +653,7 @@ external bool Texture_setImage(
ffi.Uint32,
ffi.Uint32,
ffi.Uint32)>(isLeaf: true)
external bool Texture_setImageWithDepth(
external bool Texture_setImage(
ffi.Pointer<TEngine> tEngine,
ffi.Pointer<TTexture> tTexture,
int level,
@@ -2531,33 +2507,6 @@ external void Texture_loadImageRenderThread(
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Bool)>> onComplete,
);
@ffi.Native<
ffi.Void Function(
ffi.Pointer<TEngine>,
ffi.Pointer<TTexture>,
ffi.Uint32,
ffi.Pointer<ffi.Uint8>,
ffi.Size,
ffi.Uint32,
ffi.Uint32,
ffi.Uint32,
ffi.Uint32,
ffi.Uint32,
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Bool)>>)>(
isLeaf: true)
external void Texture_setImageRenderThread(
ffi.Pointer<TEngine> tEngine,
ffi.Pointer<TTexture> tTexture,
int level,
ffi.Pointer<ffi.Uint8> data,
int size,
int width,
int height,
int channels,
int bufferFormat,
int pixelDataType,
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Bool)>> onComplete,
);
@ffi.Native<
ffi.Void Function(
@@ -2574,10 +2523,9 @@ external void Texture_setImageRenderThread(
ffi.Uint32,
ffi.Uint32,
ffi.Uint32,
ffi.Uint32,
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Bool)>>)>(
isLeaf: true)
external void Texture_setImageWithDepthRenderThread(
external void Texture_setImageRenderThread(
ffi.Pointer<TEngine> tEngine,
ffi.Pointer<TTexture> tTexture,
int level,
@@ -2588,7 +2536,6 @@ external void Texture_setImageWithDepthRenderThread(
int z_offset,
int width,
int height,
int channels,
int depth,
int bufferFormat,
int pixelDataType,

View File

@@ -752,19 +752,8 @@ extension type NativeLibrary(JSObject _) implements JSObject {
int pixelDataType,
int level,
);
external int _Texture_setImage(
Pointer<TEngine> tEngine,
Pointer<TTexture> tTexture,
int level,
Pointer<Uint8> data,
size_t size,
int width,
int height,
int channels,
int bufferFormat,
int pixelDataType,
);
external int _Texture_setImageWithDepth(
Pointer<TEngine> tEngine,
Pointer<TTexture> tTexture,
int level,
@@ -775,7 +764,6 @@ extension type NativeLibrary(JSObject _) implements JSObject {
int z_offset,
int width,
int height,
int channels,
int depth,
int bufferFormat,
int pixelDataType,
@@ -1748,19 +1736,6 @@ extension type NativeLibrary(JSObject _) implements JSObject {
Pointer<self.NativeFunction<void Function(bool)>> onComplete,
);
external void _Texture_setImageRenderThread(
Pointer<TEngine> tEngine,
Pointer<TTexture> tTexture,
int level,
Pointer<Uint8> data,
size_t size,
int width,
int height,
int channels,
int bufferFormat,
int pixelDataType,
Pointer<self.NativeFunction<void Function(bool)>> onComplete,
);
external void _Texture_setImageWithDepthRenderThread(
Pointer<TEngine> tEngine,
Pointer<TTexture> tTexture,
int level,
@@ -1771,7 +1746,6 @@ extension type NativeLibrary(JSObject _) implements JSObject {
int z_offset,
int width,
int height,
int channels,
int depth,
int bufferFormat,
int pixelDataType,
@@ -3024,23 +2998,6 @@ bool Texture_loadImage(
}
bool Texture_setImage(
self.Pointer<TEngine> tEngine,
self.Pointer<TTexture> tTexture,
int level,
self.Pointer<Uint8> data,
Dart__darwin_size_t size,
int width,
int height,
int channels,
int bufferFormat,
int pixelDataType,
) {
final result = _lib._Texture_setImage(tEngine.cast(), tTexture.cast(), level,
data, size, width, height, channels, bufferFormat, pixelDataType);
return result == 1;
}
bool Texture_setImageWithDepth(
self.Pointer<TEngine> tEngine,
self.Pointer<TTexture> tTexture,
int level,
@@ -3051,12 +3008,11 @@ bool Texture_setImageWithDepth(
int z_offset,
int width,
int height,
int channels,
int depth,
int bufferFormat,
int pixelDataType,
) {
final result = _lib._Texture_setImageWithDepth(
final result = _lib._Texture_setImage(
tEngine.cast(),
tTexture.cast(),
level,
@@ -3067,7 +3023,6 @@ bool Texture_setImageWithDepth(
z_offset,
width,
height,
channels,
depth,
bufferFormat,
pixelDataType);
@@ -5083,46 +5038,17 @@ void Texture_setImageRenderThread(
int level,
self.Pointer<Uint8> data,
Dart__darwin_size_t size,
int x_offset,
int y_offset,
int z_offset,
int width,
int height,
int channels,
int depth,
int bufferFormat,
int pixelDataType,
self.Pointer<self.NativeFunction<void Function(bool)>> onComplete,
) {
final result = _lib._Texture_setImageRenderThread(
tEngine.cast(),
tTexture.cast(),
level,
data,
size,
width,
height,
channels,
bufferFormat,
pixelDataType,
onComplete.cast());
return result;
}
void Texture_setImageWithDepthRenderThread(
self.Pointer<TEngine> tEngine,
self.Pointer<TTexture> tTexture,
int level,
self.Pointer<Uint8> data,
Dart__darwin_size_t size,
int x_offset,
int y_offset,
int z_offset,
int width,
int height,
int channels,
int depth,
int bufferFormat,
int pixelDataType,
self.Pointer<self.NativeFunction<void Function(bool)>> onComplete,
) {
final result = _lib._Texture_setImageWithDepthRenderThread(
tEngine.cast(),
tTexture.cast(),
level,
@@ -5133,7 +5059,6 @@ void Texture_setImageWithDepthRenderThread(
z_offset,
width,
height,
channels,
depth,
bufferFormat,
pixelDataType,