diff --git a/DEPS b/DEPS index c3b4b5b538..2cf0574c25 100644 --- a/DEPS +++ b/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', diff --git a/engine/src/flutter/lib/ui/text/text_box.cc b/engine/src/flutter/lib/ui/text/text_box.cc index 3c7a000a66..4396b170b2 100644 --- a/engine/src/flutter/lib/ui/text/text_box.cc +++ b/engine/src/flutter/lib/ui/text/text_box.cc @@ -13,13 +13,21 @@ using namespace blink; namespace tonic { -Dart_Handle DartConverter::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::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::ToDart(const TextBox& val) { tonic::ToDart(val.sk_rect.fBottom), tonic::ToDart(static_cast(val.direction)), }; - return Dart_New(type, tonic::ToDart("_"), argc, argv); + return Dart_New(GetTextBoxType(), tonic::ToDart("_"), argc, argv); +} + +Dart_Handle DartListFactory::NewList(intptr_t length) { + return Dart_NewListOfType(GetTextBoxType(), length); } } // namespace tonic diff --git a/engine/src/flutter/lib/ui/text/text_box.h b/engine/src/flutter/lib/ui/text/text_box.h index 371ae32ea8..586d4d51bc 100644 --- a/engine/src/flutter/lib/ui/text/text_box.h +++ b/engine/src/flutter/lib/ui/text/text_box.h @@ -16,6 +16,11 @@ struct DartConverter { static Dart_Handle ToDart(const blink::TextBox& val); }; +template <> +struct DartListFactory { + static Dart_Handle NewList(intptr_t length); +}; + } // namespace tonic #endif // FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_