5#include "flutter/shell/platform/windows/flutter_windows_texture_registrar.h"
9#include "flutter/fml/logging.h"
10#include "flutter/shell/platform/embedder/embedder_struct_macros.h"
11#include "flutter/shell/platform/windows/external_texture_d3d.h"
12#include "flutter/shell/platform/windows/external_texture_pixelbuffer.h"
13#include "flutter/shell/platform/windows/flutter_windows_engine.h"
16static constexpr int64_t kInvalidTexture = -1;
23 std::shared_ptr<egl::ProcTable>
gl)
29 return kInvalidTexture;
34 FML_LOG(
ERROR) <<
"Invalid pixel buffer texture callback.";
35 return kInvalidTexture;
38 return EmplaceTexture(std::make_unique<flutter::ExternalTexturePixelBuffer>(
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;
64int64_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()) {
118 std::lock_guard<std::mutex> lock(map_mutex_);
120 if (it == textures_.end()) {
TaskRunner * task_runner()
egl::Manager * egl_manager() const
virtual bool PostRasterThreadTask(fml::closure callback) 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)
#define SAFE_ACCESS(pointer, member, default_value)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
@ kFlutterDesktopGpuSurfaceTypeDxgiSharedHandle
@ kFlutterDesktopGpuSurfaceTypeD3d11Texture2D
@ kFlutterDesktopGpuSurfaceTypeNone
@ kFlutterDesktopGpuSurfaceTexture
@ kFlutterDesktopPixelBufferTexture
#define FML_LOG(severity)
std::function< void()> closure
FlutterDesktopPixelBufferTextureCallback callback
FlutterDesktopGpuSurfaceTextureConfig gpu_surface_config
FlutterDesktopTextureType type
FlutterDesktopPixelBufferTextureConfig pixel_buffer_config