Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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"
11
12namespace impeller {
13
14class 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_
std::shared_ptr< DeviceBuffer > OnCreateBuffer(const DeviceBufferDescriptor &desc) override
std::shared_ptr< Texture > OnCreateTexture(const TextureDescriptor &desc) override
ISize GetMaxTextureSizeSupported() const override
An object that allocates device memory.
Definition allocator.h:22
std::shared_ptr< ReactorGLES > Ref
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...