split D3D/GLES texture creation

This commit is contained in:
Nick Fisher
2024-11-04 17:17:24 +08:00
parent f3e96fe94a
commit bdcbd90ec6
26 changed files with 897 additions and 646 deletions

View File

@@ -39,7 +39,34 @@ abstract class ThermionFlutterPlatform extends PlatformInterface {
/// call this yourself. May not be supported on all platforms.
///
Future<ThermionFlutterTexture?> createTexture(
t.View view, int width, int height);
int width, int height);
///
///
///
///
Future<ThermionFlutterTexture?> resizeTexture(
ThermionFlutterTexture texture,
int width, int height);
///
///
///
Future destroyTexture(ThermionFlutterTexture texture);
///
///
///
Future markTextureFrameAvailable(ThermionFlutterTexture texture);
///
/// Binds a rendering surface to the given View.
///
/// This is internal; unless you are [thermion_*] package developer, don't
/// call this yourself. May not be supported on all platforms.
///
Future bind(
t.View view, ThermionFlutterTexture texture);
///
/// Create a rendering window.

View File

@@ -1,17 +1,13 @@
abstract class ThermionFlutterTexture {
class ThermionFlutterTexture {
int get width;
int get height;
final int width;
final int height;
int get flutterId;
int get hardwareId;
final int flutterId;
final int hardwareId;
///
/// Destroy a texture and clean up the texture cache (if applicable).
///
Future destroy();
final int window;
Future resize(int width, int height, int left, int top);
ThermionFlutterTexture({required this.width, required this.height, required this.flutterId, required this.hardwareId, required this.window});
Future markFrameAvailable();
}