9 #include "flutter/fml/logging.h"
10 #include "flutter/shell/platform/embedder/embedder_struct_macros.h"
16 static constexpr int64_t kInvalidTexture = -1;
23 std::shared_ptr<egl::ProcTable> gl)
24 : engine_(engine), gl_(std::move(gl)) {}
29 return kInvalidTexture;
34 FML_LOG(ERROR) <<
"Invalid pixel buffer texture callback.";
35 return kInvalidTexture;
38 return EmplaceTexture(std::make_unique<flutter::ExternalTexturePixelBuffer>(
44 auto surface_type = SAFE_ACCESS(gpu_surface_config,
type,
50 FML_LOG(ERROR) <<
"Invalid GPU surface descriptor callback.";
51 return kInvalidTexture;
55 return EmplaceTexture(std::make_unique<flutter::ExternalTextureD3d>(
60 FML_LOG(ERROR) <<
"Attempted to register texture of unsupport type.";
61 return kInvalidTexture;
64 int64_t FlutterWindowsTextureRegistrar::EmplaceTexture(
65 std::unique_ptr<ExternalTexture> texture) {
68 std::lock_guard<std::mutex> lock(map_mutex_);
87 std::lock_guard<std::mutex> lock(map_mutex_);
89 if (it != textures_.end()) {
106 engine->MarkExternalTextureFrameAvailable(
texture_id);
115 FlutterOpenGLTexture* opengl_texture) {
118 std::lock_guard<std::mutex> lock(map_mutex_);
120 if (it == textures_.end()) {
123 texture = it->second.get();
virtual bool PopulateTexture(size_t width, size_t height, FlutterOpenGLTexture *opengl_texture)=0
TaskRunner * task_runner()
virtual bool PostRasterThreadTask(fml::closure callback) const
egl::Manager * egl_manager() const
bool PopulateTexture(int64_t texture_id, size_t width, size_t height, FlutterOpenGLTexture *texture)
int64_t RegisterTexture(const FlutterDesktopTextureInfo *texture_info)
FlutterWindowsTextureRegistrar(FlutterWindowsEngine *engine, std::shared_ptr< egl::ProcTable > gl)
void UnregisterTexture(int64_t texture_id, fml::closure callback=nullptr)
bool MarkTextureFrameAvailable(int64_t texture_id)
void RunNowOrPostTask(TaskClosure task)
@ kFlutterDesktopGpuSurfaceTypeDxgiSharedHandle
@ kFlutterDesktopGpuSurfaceTypeD3d11Texture2D
@ kFlutterDesktopGpuSurfaceTypeNone
@ kFlutterDesktopGpuSurfaceTexture
@ kFlutterDesktopPixelBufferTexture
FlutterDesktopBinaryReply callback
enum flutter::testing::@88::KeyboardChange::Type type
FlutterDesktopPixelBufferTextureCallback callback
FlutterDesktopGpuSurfaceTextureConfig gpu_surface_config
FlutterDesktopTextureType type
FlutterDesktopPixelBufferTextureConfig pixel_buffer_config