| Flutter Impeller |

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