remove custom platform creation

This commit is contained in:
Nick Fisher
2023-10-23 01:35:21 +11:00
parent 73db953564
commit 600905f7f2

View File

@@ -5,8 +5,6 @@
#include <flutter/standard_method_codec.h>
#include <flutter/texture_registrar.h>
#include "backend/platforms/PlatformEGL.h"
#include <thread>
namespace polyvox_filament {
@@ -69,6 +67,10 @@ void FlutterAngleTexture::RenderCallback() {
_D3D11DeviceContext->Flush();
}
FlutterAngleTexture::~FlutterAngleTexture() {
}
FlutterAngleTexture::FlutterAngleTexture(
flutter::PluginRegistrarWindows *pluginRegistrar,
flutter::TextureRegistrar *textureRegistrar,
@@ -193,11 +195,6 @@ FlutterAngleTexture::FlutterAngleTexture(
glGetIntegerv(GL_MAJOR_VERSION, &major);
glGetIntegerv(GL_MINOR_VERSION, &minor);
// platform = new filament::backend::PlatformANGLE(_internalD3DTextureHandle,
// width, height);
platform = new filament::backend::PlatformEGL(); //_internalD3DTextureHandle,
//width, height);
_textureDescriptor = std::make_unique<FlutterDesktopGpuSurfaceDescriptor>();
_textureDescriptor->struct_size = sizeof(FlutterDesktopGpuSurfaceDescriptor);
_textureDescriptor->handle = _externalD3DTextureHandle;
@@ -212,7 +209,9 @@ FlutterAngleTexture::FlutterAngleTexture(
texture =
std::make_unique<flutter::TextureVariant>(flutter::GpuSurfaceTexture(
kFlutterDesktopGpuSurfaceTypeDxgiSharedHandle,
[&](auto, auto) { return _textureDescriptor.get(); }));
[&](size_t width, size_t height) {
return _textureDescriptor.get();
}));
flutterTextureId = _textureRegistrar->RegisterTexture(texture.get());
std::cout << "Registered Flutter texture ID " << flutterTextureId
@@ -225,6 +224,4 @@ FlutterAngleTexture::FlutterAngleTexture(
result->Success(resultList);
}
FlutterAngleTexture::~FlutterAngleTexture() {}
} // namespace polyvox_filament