5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_HANDLE_GLES_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_HANDLE_GLES_H_
11 #include <type_traits>
13 #include "flutter/fml/hash_combine.h"
53 constexpr
bool IsDead()
const {
return !name_.has_value(); }
70 return lhs.type_ == rhs.type_ && lhs.name_ == rhs.name_;
75 const std::optional<UniqueID>&
GetName()
const {
return name_; }
76 std::size_t
GetHash()
const {
return hash_; }
80 std::optional<UniqueID> name_;
82 std::optional<uint64_t> untracked_id_;
89 hash_(
fml::HashCombine(
90 static_cast<
std::underlying_type_t<decltype(p_type)>>(p_type),
96 hash_(
fml::HashCombine(
97 static_cast<
std::underlying_type_t<decltype(p_type)>>(p_type),
101 return HandleGLES{
type, UniqueID{}};
115 const std::optional<impeller::UniqueID>& name = handle.
GetName();
116 if (name.has_value()) {
117 out << name.value().id;
Represents a handle to an underlying OpenGL object. Unlike OpenGL object handles, these handles can b...
constexpr bool IsDead() const
Determines if the handle is dead.
const std::optional< UniqueID > & GetName() const
HandleType GetType() const
std::size_t GetHash() const
static HandleGLES DeadHandle()
Creates a dead handle.
The reactor attempts to make thread-safe usage of OpenGL ES easier to reason about.
ScopedObject< Object > Create(CtorArgs &&... args)
std::string HandleTypeToString(HandleType type)
std::ostream & operator<<(std::ostream &out, const impeller::Arc &a)
A comparer used to test the equality of two handles.
bool operator()(const HandleGLES &lhs, const HandleGLES &rhs) const
Get the hash value of this handle. Handles can be used as map keys.
std::size_t operator()(const HandleGLES &handle) const