提交 5d13dc00 编写于 作者: A Adam Barth 提交者: GitHub

Add support for child view on Fuchsia (#3217)

上级 c118c7ee
......@@ -64,9 +64,10 @@ void Rasterizer::Draw(std::unique_ptr<flow::LayerTree> layer_tree,
root_node->op->set_image(mozart::ImageNodeOp::New());
root_node->op->get_image()->content_rect = bounds.Clone();
root_node->op->get_image()->image_resource_id = kContentImageResourceId;
update->nodes.insert(kRootNodeId, std::move(root_node));
layer_tree->UpdateScene(update.get(), root_node.get());
update->nodes.insert(kRootNodeId, std::move(root_node));
} else {
update->nodes.insert(kRootNodeId, mozart::Node::New());
}
......
......@@ -173,6 +173,7 @@ void RuntimeHolder::DidCreateMainIsolate(Dart_Isolate isolate) {
if (asset_store_)
blink::AssetFontSelector::Install(asset_store_);
InitFidlInternal();
InitMozartInternal();
}
void RuntimeHolder::InitFidlInternal() {
......@@ -200,6 +201,18 @@ void RuntimeHolder::InitFidlInternal() {
DartConverter<mx::channel>::ToDart(outgoing_services_.PassChannel())));
}
void RuntimeHolder::InitMozartInternal() {
fidl::InterfaceHandle<mozart::ViewContainer> view_container;
view_->GetContainer(fidl::GetProxy(&view_container));
Dart_Handle mozart_internal =
Dart_LookupLibrary(ToDart("dart:mozart.internal"));
DART_CHECK_VALID(Dart_SetField(
mozart_internal, ToDart("_viewContainer"),
DartConverter<mx::channel>::ToDart(view_container.PassHandle())));
}
void RuntimeHolder::InitRootBundle(std::vector<char> bundle) {
root_bundle_data_ = std::move(bundle);
asset_store_ = ftl::MakeRefCounted<blink::ZipAssetStore>(
......
......@@ -63,6 +63,7 @@ class RuntimeHolder : public blink::RuntimeDelegate,
void HandleAssetPlatformMessage(ftl::RefPtr<blink::PlatformMessage> message);
void InitFidlInternal();
void InitMozartInternal();
void BeginFrame();
void OnFrameComplete();
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_TONIC_DART_IO_H_
#define FLUTTER_TONIC_DART_IO_H_
#ifndef FLUTTER_LIB_IO_DART_IO_H_
#define FLUTTER_LIB_IO_DART_IO_H_
#include "lib/ftl/macros.h"
......@@ -19,4 +19,4 @@ class DartIO {
} // namespace blink
#endif // FLUTTER_TONIC_DART_IO_H_
#endif // FLUTTER_LIB_IO_DART_IO_H_
......@@ -9,6 +9,7 @@ import("//flutter/lib/ui/dart_ui.gni")
target_is_fuchsia = target_os == "fuchsia"
if (target_is_fuchsia) {
import("//apps/mozart/lib/flutter/sdk_ext/sdk_ext.gni")
import("//lib/fidl/dart/sdk_ext/sdk_ext.gni")
}
......@@ -81,9 +82,13 @@ action("generate_snapshot_bin") {
]
if (target_is_fuchsia) {
inputs += fidl_dart_sdk_ext_files
inputs += fidl_dart_sdk_ext_files + mozart_dart_sdk_ext_files
fidl_internal_path = rebase_path(fidl_dart_sdk_ext_lib)
args += [ "--url_mapping=dart:fidl.internal,$fidl_internal_path" ]
mozart_internal_path = rebase_path(mozart_dart_sdk_ext_lib)
args += [
"--url_mapping=dart:fidl.internal,$fidl_internal_path",
"--url_mapping=dart:mozart.internal,$mozart_internal_path",
]
}
}
......
......@@ -11,5 +11,6 @@ import 'dart:fidl.internal';
import 'dart:io';
import 'dart:isolate';
import 'dart:math';
import 'dart:mozart.internal';
import 'dart:typed_data';
import 'dart:ui';
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册