Flutter Impeller
impeller::UniqueHandleGLES Class Reference

A unique handle to an OpenGL object. The collection of this handle scheduled the destruction of the associated OpenGL object in the reactor. More...

#include <unique_handle_gles.h>

Public Member Functions

 UniqueHandleGLES (std::shared_ptr< ReactorGLES > reactor, HandleType type)
 
 UniqueHandleGLES (std::shared_ptr< ReactorGLES > reactor, HandleGLES handle)
 
 ~UniqueHandleGLES ()
 
 UniqueHandleGLES (UniqueHandleGLES &&)
 
 UniqueHandleGLES (const UniqueHandleGLES &)=delete
 
UniqueHandleGLESoperator= (const UniqueHandleGLES &)=delete
 
const HandleGLESGet () const
 
bool IsValid () const
 

Static Public Member Functions

static UniqueHandleGLES MakeUntracked (std::shared_ptr< ReactorGLES > reactor, HandleType type)
 

Detailed Description

A unique handle to an OpenGL object. The collection of this handle scheduled the destruction of the associated OpenGL object in the reactor.

Definition at line 18 of file unique_handle_gles.h.

Constructor & Destructor Documentation

◆ UniqueHandleGLES() [1/4]

impeller::UniqueHandleGLES::UniqueHandleGLES ( std::shared_ptr< ReactorGLES reactor,
HandleType  type 
)

Definition at line 11 of file unique_handle_gles.cc.

13  : reactor_(std::move(reactor)) {
14  if (reactor_) {
15  handle_ = reactor_->CreateHandle(type);
16  }
17 }
GLenum type

References type.

Referenced by MakeUntracked().

◆ UniqueHandleGLES() [2/4]

impeller::UniqueHandleGLES::UniqueHandleGLES ( std::shared_ptr< ReactorGLES reactor,
HandleGLES  handle 
)

Definition at line 28 of file unique_handle_gles.cc.

30  : reactor_(std::move(reactor)), handle_(handle) {}

◆ ~UniqueHandleGLES()

impeller::UniqueHandleGLES::~UniqueHandleGLES ( )

Definition at line 32 of file unique_handle_gles.cc.

32  {
33  if (!handle_.IsDead() && reactor_) {
34  reactor_->CollectHandle(handle_);
35  }
36 }
constexpr bool IsDead() const
Determines if the handle is dead.
Definition: handle_gles.h:53

References impeller::HandleGLES::IsDead().

◆ UniqueHandleGLES() [3/4]

impeller::UniqueHandleGLES::UniqueHandleGLES ( UniqueHandleGLES &&  other)

Definition at line 46 of file unique_handle_gles.cc.

46  {
47  std::swap(reactor_, other.reactor_);
48  std::swap(handle_, other.handle_);
49 }

◆ UniqueHandleGLES() [4/4]

impeller::UniqueHandleGLES::UniqueHandleGLES ( const UniqueHandleGLES )
delete

Member Function Documentation

◆ Get()

const HandleGLES & impeller::UniqueHandleGLES::Get ( ) const

Definition at line 38 of file unique_handle_gles.cc.

38  {
39  return handle_;
40 }

Referenced by impeller::testing::TEST().

◆ IsValid()

bool impeller::UniqueHandleGLES::IsValid ( ) const

Definition at line 42 of file unique_handle_gles.cc.

42  {
43  return !handle_.IsDead();
44 }

References impeller::HandleGLES::IsDead().

◆ MakeUntracked()

UniqueHandleGLES impeller::UniqueHandleGLES::MakeUntracked ( std::shared_ptr< ReactorGLES reactor,
HandleType  type 
)
static

Definition at line 20 of file unique_handle_gles.cc.

22  {
23  FML_DCHECK(reactor);
24  HandleGLES handle = reactor->CreateUntrackedHandle(type);
25  return UniqueHandleGLES(std::move(reactor), handle);
26 }
UniqueHandleGLES(std::shared_ptr< ReactorGLES > reactor, HandleType type)

References type, and UniqueHandleGLES().

Referenced by impeller::testing::TEST().

◆ operator=()

UniqueHandleGLES& impeller::UniqueHandleGLES::operator= ( const UniqueHandleGLES )
delete

The documentation for this class was generated from the following files: