5 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_EGL_MANAGER_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_EGL_MANAGER_H_
10 #include <EGL/eglext.h>
11 #include <EGL/eglplatform.h>
12 #include <GLES2/gl2.h>
13 #include <GLES2/gl2ext.h>
20 #include <wrl/client.h>
24 #include "flutter/fml/macros.h"
59 static std::unique_ptr<Manager>
Create(
61 bool allow_inverted_surface,
88 EGLClientBuffer handle,
89 const EGLint* attributes)
const;
122 bool allow_inverted_surface,
127 static int instance_count_;
130 static std::optional<LUID> GetGpuLuidByPreference(
131 DXGI_GPU_PREFERENCE preference);
135 bool allow_inverted_surface,
139 bool InitializeConfig();
142 bool InitializeContexts();
145 bool InitializeDevice();
150 bool is_valid_ =
false;
156 EGLint surface_orientation_ = 0;
159 EGLDisplay display_ = EGL_NO_DISPLAY;
162 EGLConfig config_ =
nullptr;
165 std::unique_ptr<Context> render_context_;
168 std::unique_ptr<Context> resource_context_;
171 Microsoft::WRL::ComPtr<ID3D11Device> resolved_device_ =
nullptr;
173 FML_DISALLOW_COPY_AND_ASSIGN(
Manager);
virtual Context * resource_context() const
EGLConfig egl_config() const
static std::unique_ptr< Manager > Create(GpuPreference gpu_preference, bool allow_inverted_surface, std::optional< D3DFeatureLevel > max_feature_level=std::nullopt)
virtual bool surface_origin_is_top_left() const
EGLSurface CreateSurfaceFromHandle(EGLenum handle_type, EGLClientBuffer handle, const EGLint *attributes) const
static std::optional< LUID > GetLowPowerGpuLuid()
virtual Context * render_context() const
static std::optional< LUID > GetHighPerformanceGpuLuid()
virtual std::unique_ptr< WindowSurface > CreateWindowSurface(HWND hwnd, size_t width, size_t height)
bool GetDevice(ID3D11Device **device)
Manager(GpuPreference gpu_preference, bool allow_inverted_surface, std::optional< D3DFeatureLevel > max_feature_level=std::nullopt)
EGLDisplay egl_display() const
std::optional< egl::D3DFeatureLevel > max_feature_level
@ HighPerformancePreference