Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
pipeline_compile_queue_gles.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PIPELINE_COMPILE_QUEUE_GLES_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PIPELINE_COMPILE_QUEUE_GLES_H_
7
12
13namespace impeller {
14
15//------------------------------------------------------------------------------
16/// @brief A task queue designed for managing compilation of pipeline state
17/// objects for OpenGL ES backend.
18///
19/// This subclass uses a fml::TaskRunner as the worker task runner
20/// and implements a sequential job processing mechanism to prevent
21/// blocking the IO task runner.
22///
23/// Key characteristics:
24/// - Uses fml::RefPtr<fml::TaskRunner> for worker_task_runner_
25/// - Processes jobs sequentially: loads one job at a time before
26/// proceeding to the next, preventing IO task runner blocking
27/// - Uses DrainPendingJobs() to recursively process jobs one by one
28/// - Employs is_processing_ flag and processing_mutex_ to control
29/// sequential processing
30///
31/// The sequential processing ensures that pipeline compilation jobs
32/// do not overwhelm the task runner, which is particularly
33/// important for GLES backend where resource loading patterns
34/// differ from Vulkan.
35///
37 public:
38 static std::shared_ptr<PipelineCompileQueueGLES> Create(
39 std::shared_ptr<fml::BasicTaskRunner> worker_task_runner);
40
42
44
46
47 void PostJob(const fml::closure& job) override;
48
49 void OnJobAdded() override;
50
51 private:
53 std::shared_ptr<fml::BasicTaskRunner> worker_task_runner);
54 void DrainPendingJobs();
55
56 std::shared_ptr<fml::BasicTaskRunner> worker_task_runner_;
57 Mutex processing_mutex_;
58 bool is_processing_ IPLR_GUARDED_BY(processing_mutex_) = false;
59};
60
61} // namespace impeller
62
63#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_PIPELINE_COMPILE_QUEUE_GLES_H_
A task queue designed for managing compilation of pipeline state objects for OpenGL ES backend.
void PostJob(const fml::closure &job) override
Post a compilation job to the worker task runner.
PipelineCompileQueueGLES(const PipelineCompileQueueGLES &)=delete
void OnJobAdded() override
Called by PostJobForDescriptor after a job has been successfully added to the queue....
PipelineCompileQueueGLES & operator=(const PipelineCompileQueueGLES &)=delete
static std::shared_ptr< PipelineCompileQueueGLES > Create(std::shared_ptr< fml::BasicTaskRunner > worker_task_runner)
A task queue designed for managing compilation of pipeline state objects.
std::function< void()> closure
Definition closure.h:14
#define IPLR_GUARDED_BY(x)