Unverified Commit 4beb57c3 authored by Yegor's avatar Yegor Committed by GitHub

Roll engine; pass semantics child orders (#16970)

* pass semantics children in traversal and hit test orders

* explain why we are inverting _children

* Roll engine
parent 7471ff8c
d2448888a11ab958beece5ef6df99c8d069d09db f876bd57106b527cf6ddc8c9a97d0beb4190f868
...@@ -1346,15 +1346,23 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { ...@@ -1346,15 +1346,23 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
void _addToUpdate(ui.SemanticsUpdateBuilder builder) { void _addToUpdate(ui.SemanticsUpdateBuilder builder) {
assert(_dirty); assert(_dirty);
final SemanticsData data = getSemanticsData(); final SemanticsData data = getSemanticsData();
Int32List children; Int32List childrenInTraversalOrder;
Int32List childrenInHitTestOrder;
if (!hasChildren || mergeAllDescendantsIntoThisNode) { if (!hasChildren || mergeAllDescendantsIntoThisNode) {
children = _kEmptyChildList; childrenInTraversalOrder = _kEmptyChildList;
childrenInHitTestOrder = _kEmptyChildList;
} else { } else {
final int childCount = _children.length;
final List<SemanticsNode> sortedChildren = _childrenInTraversalOrder(); final List<SemanticsNode> sortedChildren = _childrenInTraversalOrder();
final int childCount = sortedChildren.length; childrenInTraversalOrder = new Int32List(childCount);
children = new Int32List(childCount); for (int i = 0; i < childCount; i += 1) {
for (int i = 0; i < childCount; ++i) { childrenInTraversalOrder[i] = sortedChildren[i].id;
children[i] = sortedChildren[i].id; }
// _children is sorted in paint order, so we invert it to get the hit test
// order.
childrenInHitTestOrder = new Int32List(childCount);
for (int i = childCount - 1; i >= 0; i -= 1) {
childrenInHitTestOrder[i] = _children[i].id;
} }
} }
builder.updateNode( builder.updateNode(
...@@ -1374,7 +1382,8 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { ...@@ -1374,7 +1382,8 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
scrollExtentMax: data.scrollExtentMax != null ? data.scrollExtentMax : double.nan, scrollExtentMax: data.scrollExtentMax != null ? data.scrollExtentMax : double.nan,
scrollExtentMin: data.scrollExtentMin != null ? data.scrollExtentMin : double.nan, scrollExtentMin: data.scrollExtentMin != null ? data.scrollExtentMin : double.nan,
transform: data.transform?.storage ?? _kIdentityTransform, transform: data.transform?.storage ?? _kIdentityTransform,
children: children, childrenInTraversalOrder: childrenInTraversalOrder,
childrenInHitTestOrder: childrenInHitTestOrder,
); );
_dirty = false; _dirty = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment