Flutter Impeller
impeller::testing::FailingAllocator Class Reference
Inheritance diagram for impeller::testing::FailingAllocator:
impeller::Allocator

Public Member Functions

 FailingAllocator (std::shared_ptr< Allocator > delegate)
 
 ~FailingAllocator ()=default
 
std::shared_ptr< DeviceBufferOnCreateBuffer (const DeviceBufferDescriptor &desc)
 
std::shared_ptr< TextureOnCreateTexture (const TextureDescriptor &desc)
 
ISize GetMaxTextureSizeSupported () const override
 
- Public Member Functions inherited from impeller::Allocator
virtual ~Allocator ()
 
bool IsValid () const
 
std::shared_ptr< DeviceBufferCreateBuffer (const DeviceBufferDescriptor &desc)
 
std::shared_ptr< TextureCreateTexture (const TextureDescriptor &desc)
 
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< DeviceBufferCreateBufferWithCopy (const uint8_t *buffer, size_t length)
 
std::shared_ptr< DeviceBufferCreateBufferWithCopy (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)
inlineexplicit

Definition at line 195 of file host_buffer_unittests.cc.

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

◆ ~FailingAllocator()

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

Member Function Documentation

◆ GetMaxTextureSizeSupported()

ISize impeller::testing::FailingAllocator::GetMaxTextureSizeSupported ( ) const
inlineoverridevirtual

Implements impeller::Allocator.

Definition at line 213 of file host_buffer_unittests.cc.

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

◆ OnCreateBuffer()

std::shared_ptr<DeviceBuffer> impeller::testing::FailingAllocator::OnCreateBuffer ( const DeviceBufferDescriptor desc)
inlinevirtual

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  }
static constexpr const size_t kMagicFailingAllocation

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

◆ OnCreateTexture()

std::shared_ptr<Texture> impeller::testing::FailingAllocator::OnCreateTexture ( const TextureDescriptor desc)
inlinevirtual

Implements impeller::Allocator.

Definition at line 209 of file host_buffer_unittests.cc.

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

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