16 const FlutterBackingStoreConfig& config,
17 FlutterBackingStore* result) {
18 size_t size = config.size.width * config.size.height * 4;
19 void* allocation = std::calloc(size,
sizeof(uint8_t));
24 result->type = kFlutterBackingStoreTypeSoftware;
25 result->software.allocation = allocation;
26 result->software.height = config.size.height;
27 result->software.row_bytes = config.size.width * 4;
28 result->software.user_data =
nullptr;
29 result->software.destruction_callback = [](
void*
user_data) {
37 std::free(
const_cast<void*
>(store->software.allocation));
42 const FlutterLayer** layers,
43 size_t layers_count) {
50 if (layers_count == 0) {
56 FML_DCHECK(layers_count == 1);
57 FML_DCHECK(layers[0]->offset.x == 0 && layers[0]->offset.y == 0);
58 FML_DCHECK(layers[0]->
type == kFlutterLayerContentTypeBackingStore);
59 FML_DCHECK(layers[0]->backing_store->type ==
60 kFlutterBackingStoreTypeSoftware);
62 const auto& backing_store = layers[0]->backing_store->software;
65 backing_store.allocation, backing_store.row_bytes, backing_store.height);