Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Public Attributes | List of all members
impeller::testing::TestAllocator Class Reference
Inheritance diagram for impeller::testing::TestAllocator:
impeller::Allocator

Public Member Functions

 TestAllocator ()=default
 
 ~TestAllocator ()=default
 
ISize GetMaxTextureSizeSupported () const override
 
std::shared_ptr< DeviceBufferOnCreateBuffer (const DeviceBufferDescriptor &desc) override
 
virtual std::shared_ptr< TextureOnCreateTexture (const TextureDescriptor &desc) 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 ISize GetMaxTextureSizeSupported () const =0
 
virtual void DebugTraceMemoryStatistics () const
 Write debug memory usage information to the dart timeline in debug and profile modes. More...
 

Public Attributes

bool should_fail = false
 

Additional Inherited Members

- Protected Member Functions inherited from impeller::Allocator
 Allocator ()
 
virtual std::shared_ptr< DeviceBufferOnCreateBuffer (const DeviceBufferDescriptor &desc)=0
 
virtual std::shared_ptr< TextureOnCreateTexture (const TextureDescriptor &desc)=0
 

Detailed Description

Definition at line 22 of file render_target_cache_unittests.cc.

Constructor & Destructor Documentation

◆ TestAllocator()

impeller::testing::TestAllocator::TestAllocator ( )
default

◆ ~TestAllocator()

impeller::testing::TestAllocator::~TestAllocator ( )
default

Member Function Documentation

◆ GetMaxTextureSizeSupported()

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

Implements impeller::Allocator.

Definition at line 28 of file render_target_cache_unittests.cc.

28 {
29 return ISize(1024, 1024);
30 };
ISize64 ISize
Definition: size.h:140

◆ OnCreateBuffer()

std::shared_ptr< DeviceBuffer > impeller::testing::TestAllocator::OnCreateBuffer ( const DeviceBufferDescriptor desc)
inlineoverridevirtual

Implements impeller::Allocator.

Definition at line 32 of file render_target_cache_unittests.cc.

33 {
34 if (should_fail) {
35 return nullptr;
36 }
37 return std::make_shared<MockDeviceBuffer>(desc);
38 };

◆ OnCreateTexture()

virtual std::shared_ptr< Texture > impeller::testing::TestAllocator::OnCreateTexture ( const TextureDescriptor desc)
inlineoverridevirtual

Implements impeller::Allocator.

Definition at line 40 of file render_target_cache_unittests.cc.

41 {
42 if (should_fail) {
43 return nullptr;
44 }
45 return std::make_shared<MockTexture>(desc);
46 };

Member Data Documentation

◆ should_fail

bool impeller::testing::TestAllocator::should_fail = false

Definition at line 48 of file render_target_cache_unittests.cc.


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