Roll Topaz/Tonic and call Dart_NewListOfType for TextBox lists (flutter/engine#4667)
Fixes https://github.com/flutter/flutter/issues/14555
This commit is contained in:
2
DEPS
2
DEPS
@@ -127,7 +127,7 @@ deps = {
|
||||
Var('fuchsia_git') + '/garnet' + '@' + 'b3ba6b6d6ab8ef658278cc43c9f839a8a8d1718e',
|
||||
|
||||
'src/topaz':
|
||||
Var('fuchsia_git') + '/topaz' + '@' + '531e2778d86b213bc663ea51bb0e0dde33d8ac8c',
|
||||
Var('fuchsia_git') + '/topaz' + '@' + 'acf6b391d5ddad479427260b8683799685319dba',
|
||||
|
||||
'src/third_party/benchmark':
|
||||
Var('fuchsia_git') + '/third_party/benchmark' + '@' + '296537bc48d380adf21567c5d736ab79f5363d22',
|
||||
|
||||
@@ -13,13 +13,21 @@ using namespace blink;
|
||||
|
||||
namespace tonic {
|
||||
|
||||
Dart_Handle DartConverter<TextBox>::ToDart(const TextBox& val) {
|
||||
if (val.is_null)
|
||||
return Dart_Null();
|
||||
namespace {
|
||||
|
||||
Dart_Handle GetTextBoxType() {
|
||||
DartClassLibrary& class_library = DartState::Current()->class_library();
|
||||
Dart_Handle type =
|
||||
Dart_HandleFromPersistent(class_library.GetClass("ui", "TextBox"));
|
||||
FXL_DCHECK(!LogIfError(type));
|
||||
return type;
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
Dart_Handle DartConverter<TextBox>::ToDart(const TextBox& val) {
|
||||
if (val.is_null)
|
||||
return Dart_Null();
|
||||
constexpr int argc = 5;
|
||||
Dart_Handle argv[argc] = {
|
||||
tonic::ToDart(val.sk_rect.fLeft),
|
||||
@@ -28,7 +36,11 @@ Dart_Handle DartConverter<TextBox>::ToDart(const TextBox& val) {
|
||||
tonic::ToDart(val.sk_rect.fBottom),
|
||||
tonic::ToDart(static_cast<int>(val.direction)),
|
||||
};
|
||||
return Dart_New(type, tonic::ToDart("_"), argc, argv);
|
||||
return Dart_New(GetTextBoxType(), tonic::ToDart("_"), argc, argv);
|
||||
}
|
||||
|
||||
Dart_Handle DartListFactory<TextBox>::NewList(intptr_t length) {
|
||||
return Dart_NewListOfType(GetTextBoxType(), length);
|
||||
}
|
||||
|
||||
} // namespace tonic
|
||||
|
||||
@@ -16,6 +16,11 @@ struct DartConverter<blink::TextBox> {
|
||||
static Dart_Handle ToDart(const blink::TextBox& val);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct DartListFactory<blink::TextBox> {
|
||||
static Dart_Handle NewList(intptr_t length);
|
||||
};
|
||||
|
||||
} // namespace tonic
|
||||
|
||||
#endif // FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_
|
||||
|
||||
Reference in New Issue
Block a user