46 {
47 constexpr size_t kBytesPerNode = 48 * sizeof(int32_t);
48 constexpr size_t kBytesPerChild = sizeof(int32_t);
49 constexpr size_t kBytesPerCustomAction = sizeof(int32_t);
50 constexpr size_t kBytesPerAction = 4 * sizeof(int32_t);
51 constexpr size_t kBytesPerStringAttribute = 4 * sizeof(int32_t);
52
53 {
54 size_t num_bytes = 0;
56 num_bytes += kBytesPerNode;
57 num_bytes +=
58 value.second.childrenInTraversalOrder.size() * kBytesPerChild;
59 num_bytes +=
value.second.childrenInHitTestOrder.size() * kBytesPerChild;
60 num_bytes +=
value.second.customAccessibilityActions.size() *
61 kBytesPerCustomAction;
62 num_bytes +=
63 value.second.labelAttributes.size() * kBytesPerStringAttribute;
64 num_bytes +=
65 value.second.valueAttributes.size() * kBytesPerStringAttribute;
66 num_bytes +=
value.second.increasedValueAttributes.size() *
67 kBytesPerStringAttribute;
68 num_bytes +=
value.second.decreasedValueAttributes.size() *
69 kBytesPerStringAttribute;
70 num_bytes +=
71 value.second.hintAttributes.size() * kBytesPerStringAttribute;
72 }
73
74
75
76
77
78
79
80
81 std::vector<uint8_t>
buffer(num_bytes);
82 int32_t* buffer_int32 =
reinterpret_cast<int32_t*
>(&
buffer[0]);
83 float* buffer_float32 =
reinterpret_cast<float*
>(&
buffer[0]);
84
85 std::vector<std::string> strings;
86 std::vector<std::vector<uint8_t>> string_attribute_args;
87 size_t position = 0;
89
90
91
93 buffer_int32[position++] = node.
id;
94 buffer_int32[position++] = node.
flags;
95 buffer_int32[position++] = node.
actions;
103 buffer_float32[position++] =
static_cast<float>(node.
scrollPosition);
106
108 buffer_int32[position++] = -1;
109 } else {
110 buffer_int32[position++] = strings.size();
112 }
113
114 if (node.
label.empty()) {
115 buffer_int32[position++] = -1;
116 } else {
117 buffer_int32[position++] = strings.size();
118 strings.push_back(node.
label);
119 }
120
122 position, string_attribute_args);
123 if (node.
value.empty()) {
124 buffer_int32[position++] = -1;
125 } else {
126 buffer_int32[position++] = strings.size();
127 strings.push_back(node.
value);
128 }
129
131 position, string_attribute_args);
133 buffer_int32[position++] = -1;
134 } else {
135 buffer_int32[position++] = strings.size();
137 }
138
140 position, string_attribute_args);
142 buffer_int32[position++] = -1;
143 } else {
144 buffer_int32[position++] = strings.size();
146 }
147
149 position, string_attribute_args);
150
151 if (node.
hint.empty()) {
152 buffer_int32[position++] = -1;
153 } else {
154 buffer_int32[position++] = strings.size();
155 strings.push_back(node.
hint);
156 }
157
159 string_attribute_args);
160
162 buffer_int32[position++] = -1;
163 } else {
164 buffer_int32[position++] = strings.size();
165 strings.push_back(node.
tooltip);
166 }
167
169 buffer_float32[position++] = node.
rect.
left();
170 buffer_float32[position++] = node.
rect.
top();
171 buffer_float32[position++] = node.
rect.
right();
172 buffer_float32[position++] = node.
rect.
bottom();
174 position += 16;
175
178 buffer_int32[position++] = child;
179 }
180
182 buffer_int32[position++] = child;
183 }
184
187 buffer_int32[position++] = child;
188 }
189 }
190
191
192 size_t num_action_bytes = actions.size() * kBytesPerAction;
193 std::vector<uint8_t> actions_buffer(num_action_bytes);
194 int32_t* actions_buffer_int32 =
195 reinterpret_cast<int32_t*>(&actions_buffer[0]);
196
197 std::vector<std::string> action_strings;
198 size_t actions_position = 0;
199 for (
const auto&
value : actions) {
200
201
202
204 actions_buffer_int32[actions_position++] =
action.id;
205 actions_buffer_int32[actions_position++] =
action.overrideId;
206 if (
action.label.empty()) {
207 actions_buffer_int32[actions_position++] = -1;
208 } else {
209 actions_buffer_int32[actions_position++] = action_strings.size();
210 action_strings.push_back(
action.label);
211 }
212 if (
action.hint.empty()) {
213 actions_buffer_int32[actions_position++] = -1;
214 } else {
215 actions_buffer_int32[actions_position++] = action_strings.size();
216 action_strings.push_back(
action.hint);
217 }
218 }
219
220
221
222 if (!actions_buffer.empty()) {
223 jni_facade_->FlutterViewUpdateCustomAccessibilityActions(actions_buffer,
224 action_strings);
225 }
226
228 jni_facade_->FlutterViewUpdateSemantics(
buffer, strings,
229 string_attribute_args);
230 }
231 }
232}
void getColMajor(SkScalar v[]) const
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
void putStringAttributesIntoBuffer(const StringAttributes &attributes, int32_t *buffer_int32, size_t &position, std::vector< std::vector< uint8_t > > &string_attribute_args)
constexpr float left() const
constexpr float top() const
constexpr float right() const
constexpr float bottom() const
StringAttributes decreasedValueAttributes
std::string increasedValue
StringAttributes hintAttributes
StringAttributes increasedValueAttributes
StringAttributes valueAttributes
StringAttributes labelAttributes
std::vector< int32_t > childrenInHitTestOrder
int32_t textSelectionExtent
int32_t currentValueLength
std::vector< int32_t > customAccessibilityActions
std::string decreasedValue
std::vector< int32_t > childrenInTraversalOrder
int32_t textSelectionBase