| Flutter Impeller |

unique_handle_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_UNIQUE_HANDLE_GLES_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_UNIQUE_HANDLE_GLES_H_
7
8 #include "impeller/renderer/backend/gles/handle_gles.h"
9 #include "impeller/renderer/backend/gles/reactor_gles.h"
10
11 namespace impeller {
12
13 //------------------------------------------------------------------------------
14 /// @brief A unique handle to an OpenGL object. The collection of this
15 /// handle scheduled the destruction of the associated OpenGL object
16 /// in the reactor.
17 ///
18 class UniqueHandleGLES {
19 public:
20 UniqueHandleGLES(std::shared_ptr<ReactorGLES> reactor, HandleType type);
21
22 static UniqueHandleGLES MakeUntracked(std::shared_ptr<ReactorGLES> reactor,
23 HandleType type);
24
25 UniqueHandleGLES(std::shared_ptr<ReactorGLES> reactor, HandleGLES handle);
26
27 ~UniqueHandleGLES();
28
29 UniqueHandleGLES(UniqueHandleGLES&&);
30
31 UniqueHandleGLES(const UniqueHandleGLES&) = delete;
32
33 UniqueHandleGLES& operator=(const UniqueHandleGLES&) = delete;
34
35 const HandleGLES& Get() const;
36
37 bool IsValid() const;
38
39 private:
40 std::shared_ptr<ReactorGLES> reactor_ = nullptr;
41 HandleGLES handle_ = HandleGLES::DeadHandle();
42 };
43
44 } // namespace impeller
45
46 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_UNIQUE_HANDLE_GLES_H_
type
GLenum type
Definition: blit_command_gles.cc:151
impeller::HandleGLES
Represents a handle to an underlying OpenGL object. Unlike OpenGL object handles, these handles can b...
Definition: handle_gles.h:37
impeller::HandleGLES::DeadHandle
static HandleGLES DeadHandle()
Creates a dead handle.
Definition: handle_gles.h:44
impeller::UniqueHandleGLES
A unique handle to an OpenGL object. The collection of this handle scheduled the destruction of the a...
Definition: unique_handle_gles.h:18
impeller::UniqueHandleGLES::MakeUntracked
static UniqueHandleGLES MakeUntracked(std::shared_ptr< ReactorGLES > reactor, HandleType type)
Definition: unique_handle_gles.cc:20
impeller::UniqueHandleGLES::UniqueHandleGLES
UniqueHandleGLES(std::shared_ptr< ReactorGLES > reactor, HandleType type)
Definition: unique_handle_gles.cc:11
impeller::UniqueHandleGLES::operator=
UniqueHandleGLES & operator=(const UniqueHandleGLES &)=delete
impeller::UniqueHandleGLES::Get
const HandleGLES & Get() const
Definition: unique_handle_gles.cc:38
impeller::UniqueHandleGLES::UniqueHandleGLES
UniqueHandleGLES(const UniqueHandleGLES &)=delete
impeller::UniqueHandleGLES::IsValid
bool IsValid() const
Definition: unique_handle_gles.cc:42
impeller::UniqueHandleGLES::~UniqueHandleGLES
~UniqueHandleGLES()
Definition: unique_handle_gles.cc:32
handle_gles.h
impeller
Definition: allocation.cc:12
impeller::HandleType
HandleType
Definition: handle_gles.h:18
reactor_gles.h