11 #include "flutter/fml/closure.h"
12 #include "flutter/fml/macros.h"
31 using Ref = std::shared_ptr<ReactorGLES>;
56 [[nodiscard]]
bool React();
60 std::optional<GLuint> name;
61 std::optional<std::string> pending_debug_label;
62 bool pending_collection =
false;
64 LiveHandle() =
default;
66 explicit LiveHandle(std::optional<GLuint> p_name)
67 : name(
std::move(p_name)) {}
69 constexpr
bool IsLive()
const {
return name.has_value(); }
72 std::unique_ptr<ProcTableGLES> proc_table_;
74 mutable Mutex ops_mutex_;
75 std::vector<Operation> ops_ IPLR_GUARDED_BY(ops_mutex_);
79 using LiveHandles = std::unordered_map<HandleGLES,
83 mutable RWMutex handles_mutex_;
84 LiveHandles handles_ IPLR_GUARDED_BY(handles_mutex_);
86 mutable Mutex workers_mutex_;
87 mutable std::map<WorkerID, std::weak_ptr<Worker>> workers_
88 IPLR_GUARDED_BY(workers_mutex_);
90 bool can_set_debug_labels_ =
false;
91 bool is_valid_ =
false;
95 bool HasPendingOperations()
const;
97 bool CanReactOnCurrentThread()
const;
99 bool ConsolidateHandles();