| Flutter Impeller |

Public Member Functions | List of all members
impeller::testing::FailingAllocator Class Reference
Inheritance diagram for impeller::testing::FailingAllocator:

## Public Member Functions
| FailingAllocator (std::shared_ptr< Allocator > delegate)
| ~FailingAllocator ()=default
std::shared_ptr< DeviceBuffer > | OnCreateBuffer (const DeviceBufferDescriptor &desc)
std::shared_ptr< Texture > | OnCreateTexture (const TextureDescriptor &desc, bool threadsafe)
ISize | GetMaxTextureSizeSupported () const override
Public Member Functions inherited from impeller::Allocator
virtual | ~Allocator ()
bool | IsValid () const
std::shared_ptr< DeviceBuffer > | CreateBuffer (const DeviceBufferDescriptor &desc)
std::shared_ptr< Texture > | CreateTexture (const TextureDescriptor &desc, bool threadsafe=false)
| Creates a new texture. More...
virtual uint16_t | MinimumBytesPerRow (PixelFormat format) const
| Minimum value for `row_bytes` on a Texture. The row bytes parameter of that method must be aligned to this value. More...
std::shared_ptr< DeviceBuffer > | CreateBufferWithCopy (const uint8_t *buffer, size_t length)
std::shared_ptr< DeviceBuffer > | CreateBufferWithCopy (const fml::Mapping &mapping)
virtual void | DebugTraceMemoryStatistics () const
| Write debug memory usage information to the dart timeline in debug and profile modes. More...
virtual Bytes | DebugGetHeapUsage () const

## Additional Inherited Members
Protected Member Functions inherited from impeller::Allocator
| Allocator ()

## Detailed Description

Definition at line 193 of file host_buffer_unittests.cc.

## Constructor & Destructor Documentation

## ◆ FailingAllocator()

impeller::testing::FailingAllocator::FailingAllocator | ( | std::shared_ptr< Allocator > | delegate | ) |
| inline explicit

Definition at line 195 of file host_buffer_unittests.cc.

196 : Allocator(), delegate_(std::move(delegate)) {}
impeller::Allocator::Allocator
Allocator()

## ◆ ~FailingAllocator()

impeller::testing::FailingAllocator::~FailingAllocator | ( |  | ) |
| default

## Member Function Documentation

## ◆ GetMaxTextureSizeSupported()

ISize impeller::testing::FailingAllocator::GetMaxTextureSizeSupported | ( |  | ) | const
| inline override virtual

Implements impeller::Allocator.

Definition at line 214 of file host_buffer_unittests.cc.

214 {
215 return delegate_->GetMaxTextureSizeSupported();
216 }

## ◆ OnCreateBuffer()

std::shared_ptr<DeviceBuffer> impeller::testing::FailingAllocator::OnCreateBuffer | ( | const DeviceBufferDescriptor & | desc | ) |
| inline virtual

Implements impeller::Allocator.

Definition at line 200 of file host_buffer_unittests.cc.

201 {
202 // Magic number used in test below to trigger failure.
203 if (desc.size == kMagicFailingAllocation) {
204 return nullptr;
205 }
206 return delegate_->CreateBuffer(desc);
207 }
impeller::testing::kMagicFailingAllocation
static constexpr const size_t kMagicFailingAllocation
Definition: host_buffer_unittests.cc:191

References impeller::testing::kMagicFailingAllocation, and impeller::DeviceBufferDescriptor::size.

## ◆ OnCreateTexture()

std::shared_ptr<Texture> impeller::testing::FailingAllocator::OnCreateTexture | ( | const TextureDescriptor & | desc,
|  | bool | threadsafe
| ) |  |
| inline virtual

Implements impeller::Allocator.

Definition at line 209 of file host_buffer_unittests.cc.

210 {
211 return delegate_->CreateTexture(desc);
212 }

The documentation for this class was generated from the following file:

- impeller/entity/contents/host_buffer_unittests.cc