5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CONTEXT_GLES_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_CONTEXT_GLES_H_
25 public std::enable_shared_from_this<ContextGLES> {
27 static std::shared_ptr<ContextGLES>
Create(
28 std::unique_ptr<ProcTableGLES> gl,
29 const std::vector<std::shared_ptr<fml::Mapping>>& shader_libraries,
30 bool enable_gpu_tracing);
38 const std::shared_ptr<ReactorGLES>&
GetReactor()
const;
41 const std::shared_ptr<ReactorGLES::Worker>& worker);
45 std::shared_ptr<GPUTracerGLES>
GetGPUTracer()
const {
return gpu_tracer_; }
48 std::shared_ptr<ReactorGLES> reactor_;
49 std::shared_ptr<ShaderLibraryGLES> shader_library_;
50 std::shared_ptr<PipelineLibraryGLES> pipeline_library_;
51 std::shared_ptr<SamplerLibraryGLES> sampler_library_;
52 std::shared_ptr<AllocatorGLES> resource_allocator_;
53 std::shared_ptr<CommandQueue> command_queue_;
54 std::shared_ptr<GPUTracerGLES> gpu_tracer_;
59 std::shared_ptr<const Capabilities> device_capabilities_;
60 bool is_valid_ =
false;
63 std::unique_ptr<ProcTableGLES> gl,
64 const std::vector<std::shared_ptr<fml::Mapping>>& shader_libraries,
65 bool enable_gpu_tracing);
68 std::string DescribeGpuModel()
const override;
71 bool IsValid()
const override;
74 std::shared_ptr<Allocator> GetResourceAllocator()
const override;
77 std::shared_ptr<ShaderLibrary> GetShaderLibrary()
const override;
80 std::shared_ptr<SamplerLibrary> GetSamplerLibrary()
const override;
83 std::shared_ptr<PipelineLibrary> GetPipelineLibrary()
const override;
86 std::shared_ptr<CommandBuffer> CreateCommandBuffer()
const override;
89 const std::shared_ptr<const Capabilities>& GetCapabilities()
const override;
92 std::shared_ptr<CommandQueue> GetCommandQueue()
const override;
95 void Shutdown()
override;
98 bool AddTrackingFence(
const std::shared_ptr<Texture>& texture)
const override;
101 void ResetThreadLocalState()
const override;
104 [[nodiscard]]
bool EnqueueCommandBuffer(
105 std::shared_ptr<CommandBuffer> command_buffer)
override;
108 [[nodiscard]]
bool FlushCommandBuffers()
override;
BackendType GetBackendType() const override
Get the graphics backend of an Impeller context.
bool RemoveReactorWorker(ReactorGLES::WorkerID id)
const std::shared_ptr< ReactorGLES > & GetReactor() const
std::shared_ptr< GPUTracerGLES > GetGPUTracer() const
static std::shared_ptr< ContextGLES > Create(std::unique_ptr< ProcTableGLES > gl, const std::vector< std::shared_ptr< fml::Mapping >> &shader_libraries, bool enable_gpu_tracing)
std::optional< ReactorGLES::WorkerID > AddReactorWorker(const std::shared_ptr< ReactorGLES::Worker > &worker)
To do anything rendering related with Impeller, you need a context.