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 
10 
11 namespace impeller {
12 
13 class AllocatorGLES final : public Allocator {
14  public:
15  // |Allocator|
16  ~AllocatorGLES() override;
17 
18  private:
19  friend class ContextGLES;
20 
21  std::shared_ptr<ReactorGLES> reactor_;
22  bool is_valid_ = false;
23 
24  explicit AllocatorGLES(std::shared_ptr<ReactorGLES> 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:24
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...