| Flutter Impeller |

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

## Public Member Functions
| TestAllocator ()=default
| ~TestAllocator ()=default
ISize | GetMaxTextureSizeSupported () const override
std::shared_ptr< DeviceBuffer > | OnCreateBuffer (const DeviceBufferDescriptor &desc) override
virtual std::shared_ptr< Texture > | OnCreateTexture (const TextureDescriptor &desc, bool threadsafe) 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

## Public Attributes
bool | should_fail = false

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

## Detailed Description

Definition at line 23 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 29 of file render_target_cache_unittests.cc.

29 {
30 return ISize(1024, 1024);
31 };
impeller::ISize
ISize64 ISize
Definition: size.h:162

## ◆ OnCreateBuffer()

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

Implements impeller::Allocator.

Definition at line 33 of file render_target_cache_unittests.cc.

34 {
35 if (should_fail) {
36 return nullptr;
37 }
38 return std::make_shared<MockDeviceBuffer>(desc);
39 };
impeller::testing::TestAllocator::should_fail
bool should_fail
Definition: render_target_cache_unittests.cc:50

References should_fail.

## ◆ OnCreateTexture()

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

Implements impeller::Allocator.

Definition at line 41 of file render_target_cache_unittests.cc.

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

References should_fail.

## Member Data Documentation

## ◆ should_fail

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

Definition at line 50 of file render_target_cache_unittests.cc.

Referenced by OnCreateBuffer(), and OnCreateTexture().

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

- impeller/entity/render_target_cache_unittests.cc