5#ifndef FLUTTER_DISPLAY_LIST_DL_STORAGE_H_
6#define FLUTTER_DISPLAY_LIST_DL_STORAGE_H_
23 uint8_t*
base() {
return ptr_.get(); }
24 const uint8_t*
base()
const {
return ptr_.get(); }
27 size_t size()
const {
return used_; }
39 void trim() { realloc(used_); }
50 void realloc(
size_t count);
53 void operator()(uint8_t* p) { std::free(p); }
55 std::unique_ptr<uint8_t, FreeDeleter> ptr_;
58 size_t allocated_ = 0u;
void reset()
Resets the storage and allocation of the object to an empty state.
const uint8_t * base() const
DisplayListStorage & operator=(DisplayListStorage &&other)
uint8_t * base()
Returns a pointer to the base of the storage.
static size_t NextPowerOfTwoSize(size_t x)
Compute the next power of two from [x].
DisplayListStorage()=default
size_t size() const
Returns the currently allocated size.
uint8_t * allocate(size_t needed)
size_t capacity() const
Returns the maximum currently allocated space.
static const constexpr size_t kDLPageSize