528 {
530 return;
531 }
532 FML_DCHECK(nodes_.find(kRootNodeId) != nodes_.end() ||
534 << "AccessibilityBridge received an update with out ever getting a root "
535 "node.";
536
537 FuchsiaAtomicUpdate atomic_update;
538 bool has_root_node_update = false;
539
540
541
542
543
544 for (
const auto& [flutter_node_id, flutter_node] :
update) {
545 size_t this_node_size = sizeof(fuchsia::accessibility::semantics::Node);
546
547
548
549
550
551
552 if (flutter_node.id == kRootNodeId) {
553 root_flutter_semantics_node_ = flutter_node;
554 has_root_node_update = true;
555 continue;
556 }
557
558 nodes_[flutter_node.id].data = flutter_node;
559
560 fuchsia::accessibility::semantics::Node fuchsia_node;
561 std::vector<uint32_t> child_ids;
562
563
564 for (int32_t flutter_child_id : flutter_node.childrenInTraversalOrder) {
566 }
567
568
569 fuchsia_node.set_node_id(flutter_node.id)
570 .set_role(GetNodeRole(flutter_node))
571 .set_location(GetNodeLocation(flutter_node))
572 .set_transform(GetNodeTransform(flutter_node))
573 .set_attributes(GetNodeAttributes(flutter_node, &this_node_size))
574 .set_states(GetNodeStates(flutter_node, &this_node_size))
575 .set_actions(GetNodeActions(flutter_node, &this_node_size))
576 .set_child_ids(child_ids);
577 this_node_size +=
578 kNodeIdSize * flutter_node.childrenInTraversalOrder.size();
579
580 atomic_update.AddNodeUpdate(std::move(fuchsia_node), this_node_size);
581 }
582
583
584 if (has_root_node_update || last_seen_view_pixel_ratio_ != view_pixel_ratio) {
585 last_seen_view_pixel_ratio_ = view_pixel_ratio;
586 size_t root_node_size;
587 fuchsia::accessibility::semantics::Node root_update =
588 GetRootNodeUpdate(root_node_size);
589 atomic_update.AddNodeUpdate(std::move(root_update), root_node_size);
590 }
591
592 PruneUnreachableNodes(&atomic_update);
593 UpdateScreenRects();
594
595 atomic_updates_->push(std::move(atomic_update));
596 if (atomic_updates_->size() == 1) {
597
598 Apply(&atomic_updates_->front());
599 }
600}
static constexpr size_t kNodeIdSize
#define FML_DCHECK(condition)
static uint32_t FlutterIdToFuchsiaId(int32_t flutter_node_id)