72 const auto source_byte_size = size_.
Area() * bpp;
73 if (allocation_->GetSize() < source_byte_size) {
77 auto rgba_allocation = std::make_shared<Allocation>();
78 if (!rgba_allocation->Truncate(size_.
Area() * 4u,
false)) {
82 const uint8_t*
source = allocation_->GetMapping();
83 uint8_t* dest = rgba_allocation->GetBuffer();
85 for (
size_t i = 0, j = 0; i < source_byte_size; i += bpp, j += 4u) {
91 dest[j + 3] = std::numeric_limits<uint8_t>::max();
94 dest[j + 0] = std::numeric_limits<uint8_t>::max();
95 dest[j + 1] = std::numeric_limits<uint8_t>::max();
96 dest[j + 2] = std::numeric_limits<uint8_t>::max();
100 dest[j + 0] =
source[i + 0];
101 dest[j + 1] =
source[i + 1];
102 dest[j + 2] =
source[i + 2];
103 dest[j + 3] = std::numeric_limits<uint8_t>::max();
116 std::make_shared<fml::NonOwnedMapping>(
117 rgba_allocation->GetBuffer(),
118 rgba_allocation->GetLength(),
119 [rgba_allocation](
auto,
auto) {})
uint32_t uint32_t * format