class FakeGpuAllocator

Defined at line 22 of file ../../src/ui/lib/escher/test/vk/fake_gpu_allocator.h

This fake gpu allocator does not have a dependency on a functional

vk::Device. It will make objects with mapped memory, but without working

Vulkan objects. This should be sufficient for tests that push bits in buffers

or manage object lifetimes, but will not work for tests that actually want to

execute Vulkan commands.

All three factory methods can be called with a null ResourceManager.

Public Methods

size_t GetUnusedBytesAllocated ()

|GpuAllocator|

Defined at line 44 of file ../../src/ui/lib/escher/test/vk/fake_gpu_allocator.h

void FakeGpuAllocator ()

Defined at line 55 of file ../../src/ui/lib/escher/test/vk/fake_gpu_allocator.cc

void ~FakeGpuAllocator ()

Defined at line 56 of file ../../src/ui/lib/escher/test/vk/fake_gpu_allocator.cc

GpuMemPtr AllocateMemory (vk::MemoryRequirements reqs, vk::MemoryPropertyFlags flags)

|GpuAllocator|

Defined at line 58 of file ../../src/ui/lib/escher/test/vk/fake_gpu_allocator.cc

BufferPtr AllocateBuffer (ResourceManager * manager, vk::DeviceSize size, vk::BufferUsageFlags usage_flags, vk::MemoryPropertyFlags memory_property_flags, GpuMemPtr * out_ptr)

|GpuAllocator|

Defined at line 63 of file ../../src/ui/lib/escher/test/vk/fake_gpu_allocator.cc

ImagePtr AllocateImage (ResourceManager * manager, const escher::ImageInfo & info, GpuMemPtr * out_ptr)

|GpuAllocator|

Defined at line 77 of file ../../src/ui/lib/escher/test/vk/fake_gpu_allocator.cc

size_t GetTotalBytesAllocated ()

|GpuAllocator|

Defined at line 90 of file ../../src/ui/lib/escher/test/vk/fake_gpu_allocator.cc

void OnAllocation (uint64_t size)

These functions are public because this is a test class, and unit tests may

wish to indirectly mock GetTotalBytesAllocated() behavior.

Defined at line 92 of file ../../src/ui/lib/escher/test/vk/fake_gpu_allocator.cc

void OnDeallocation (uint64_t size)

Defined at line 94 of file ../../src/ui/lib/escher/test/vk/fake_gpu_allocator.cc