Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
impeller
renderer
backend
gles
allocator_gles.cc
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
#include "
impeller/renderer/backend/gles/allocator_gles.h
"
6
7
#include <memory>
8
9
#include "
impeller/base/allocation.h
"
10
#include "
impeller/base/config.h
"
11
#include "
impeller/renderer/backend/gles/device_buffer_gles.h
"
12
#include "
impeller/renderer/backend/gles/texture_gles.h
"
13
14
namespace
impeller
{
15
16
AllocatorGLES::AllocatorGLES(
ReactorGLES::Ref
reactor)
17
: reactor_(
std
::move(reactor)), is_valid_(
true
) {}
18
19
// |Allocator|
20
AllocatorGLES::~AllocatorGLES() =
default
;
21
22
// |Allocator|
23
bool
AllocatorGLES::IsValid()
const
{
24
return
is_valid_;
25
}
26
27
// |Allocator|
28
std::shared_ptr<DeviceBuffer> AllocatorGLES::OnCreateBuffer(
29
const
DeviceBufferDescriptor
& desc) {
30
auto
backing_store = std::make_shared<Allocation>();
31
if
(!backing_store->Truncate(desc.size)) {
32
return
nullptr
;
33
}
34
return
std::make_shared<DeviceBufferGLES>(desc,
//
35
reactor_,
//
36
std::move(backing_store)
//
37
);
38
}
39
40
// |Allocator|
41
std::shared_ptr<Texture> AllocatorGLES::OnCreateTexture(
42
const
TextureDescriptor
& desc) {
43
return
std::make_shared<TextureGLES>(reactor_, desc);
44
}
45
46
// |Allocator|
47
ISize
AllocatorGLES::GetMaxTextureSizeSupported()
const
{
48
return
reactor_->GetProcTable().GetCapabilities()->max_texture_size;
49
}
50
51
}
// namespace impeller
allocator_gles.h
config.h
impeller::ReactorGLES::Ref
std::shared_ptr< ReactorGLES > Ref
Definition
reactor_gles.h:87
device_buffer_gles.h
allocation.h
impeller
Definition
texture.h:18
std
Definition
ref_ptr.h:256
impeller::DeviceBufferDescriptor
Definition
device_buffer_descriptor.h:14
impeller::TSize< int64_t >
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
texture_gles.h
true
true
Definition
verylargebitmap.cpp:163
Generated on Fri Apr 26 2024 06:14:11 for Flutter Engine by
1.9.8