Flutter Engine
The Flutter Engine
allocator_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_ALLOCATOR_GLES_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_ALLOCATOR_GLES_H_
7
10
11namespace impeller {
12
13class AllocatorGLES final : public Allocator {
14 public:
15 // |Allocator|
16 ~AllocatorGLES() override;
17
18 private:
19 friend class ContextGLES;
20
21 ReactorGLES::Ref reactor_;
22 bool is_valid_ = false;
23
24 explicit AllocatorGLES(ReactorGLES::Ref reactor);
25
26 // |Allocator|
27 bool IsValid() const;
28
29 // |Allocator|
30 std::shared_ptr<DeviceBuffer> OnCreateBuffer(
31 const DeviceBufferDescriptor& desc) override;
32
33 // |Allocator|
34 std::shared_ptr<Texture> OnCreateTexture(
35 const TextureDescriptor& desc) override;
36
37 // |Allocator|
38 ISize GetMaxTextureSizeSupported() const override;
39
40 AllocatorGLES(const AllocatorGLES&) = delete;
41
42 AllocatorGLES& operator=(const AllocatorGLES&) = delete;
43};
44
45} // namespace impeller
46
47#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_ALLOCATOR_GLES_H_
An object that allocates device memory.
Definition: allocator.h:22
std::shared_ptr< ReactorGLES > Ref
Definition: reactor_gles.h:86
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...