 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_BASE_ALLOCATION_H_
6 #define FLUTTER_IMPELLER_BASE_ALLOCATION_H_
11 #include "flutter/fml/mapping.h"
86 uint8_t* buffer_ =
nullptr;
90 [[nodiscard]]
bool Reserve(
Bytes reserved);
92 [[nodiscard]]
bool ReserveNPOT(
Bytes reserved);
124 const std::shared_ptr<Allocation>& allocation);
137 std::shared_ptr<const std::string>
string);
152 #endif // FLUTTER_IMPELLER_BASE_ALLOCATION_H_
~Allocation()
Destroys the allocation.
static uint32_t NextPowerOfTwoSize(uint32_t x)
Gets the next power of two size.
std::shared_ptr< fml::Mapping > CreateMappingFromAllocation(const std::shared_ptr< Allocation > &allocation)
Creates a mapping from allocation.
bool Truncate(Bytes length, bool npot=true)
Resize the underlying allocation to at least given number of bytes.
Allocation()
Constructs a new zero-sized allocation.
uint8_t * GetBuffer() const
Gets the pointer to the start of the allocation.
Describes an allocation on the heap.
std::shared_ptr< fml::Mapping > CreateMappingWithCopy(const uint8_t *contents, Bytes length)
Creates a mapping with copy of the bytes.
std::shared_ptr< fml::Mapping > CreateMappingWithString(std::string string)
Creates a mapping with string data.
Bytes GetReservedLength() const
Gets the reserved length of the allocation. Calls to truncate may be ignored till the length exceeds ...
Bytes GetLength() const
Gets the length of the allocation.