未验证 提交 220a8310 编写于 作者: D David Worsham 提交者: GitHub

Move fuchsia/scenic integration behind #define (#19003)

Additionally create "_next" permutations for all of the test binaries
on Fuchsia, in order to test both code-paths.

Using the #define follow-up CLs can also create a flutter_runner_next
binary that does not contain any legacy integration code.

BUG: 53847
上级 de68a7f3
...@@ -125,6 +125,20 @@ config("config") { ...@@ -125,6 +125,20 @@ config("config") {
} }
} }
# This "fuchsia_legacy" configuration includes old, non-embedder API sources and
# defines the LEGACY_FUCHSIA_EMBEDDER symbol. This config and its associated
# template are both transitional and will be removed after the embedder API
# transition is complete.
#
# See `source_set_maybe_fuchsia_legacy` in //flutter/common/config.gni
#
# TODO(fxb/54041): Remove when no longer neccesary.
config("fuchsia_legacy") {
if (is_fuchsia) {
defines = [ "LEGACY_FUCHSIA_EMBEDDER" ]
}
}
config("export_dynamic_symbols") { config("export_dynamic_symbols") {
if (is_linux || is_fuchsia) { if (is_linux || is_fuchsia) {
inputs = [ inputs = [
...@@ -151,9 +165,12 @@ if (is_fuchsia) { ...@@ -151,9 +165,12 @@ if (is_fuchsia) {
deps = [ deps = [
"//flutter/flow:flow_tests", "//flutter/flow:flow_tests",
"//flutter/flow:flow_tests_next",
"//flutter/fml:fml_tests", "//flutter/fml:fml_tests",
"//flutter/runtime:runtime_tests", "//flutter/runtime:runtime_tests",
"//flutter/runtime:runtime_tests_next",
"//flutter/shell/common:shell_tests", "//flutter/shell/common:shell_tests",
"//flutter/shell/common:shell_tests_next",
"//flutter/shell/platform/fuchsia/flutter:flutter_runner_scenic_tests", "//flutter/shell/platform/fuchsia/flutter:flutter_runner_scenic_tests",
"//flutter/shell/platform/fuchsia/flutter:flutter_runner_tests", "//flutter/shell/platform/fuchsia/flutter:flutter_runner_tests",
] ]
......
...@@ -76,3 +76,119 @@ if (is_ios || is_mac) { ...@@ -76,3 +76,119 @@ if (is_ios || is_mac) {
] ]
flutter_cflags_objcc = flutter_cflags_objc flutter_cflags_objcc = flutter_cflags_objc
} }
# This template creates a `source_set` in both standard and "fuchsia_legacy"
# configurations.
#
# The "fuchsia_legacy" configuration includes old, non-embedder API sources and
# defines the LEGACY_FUCHSIA_EMBEDDER symbol. This template and the config
# are both transitional and will be removed after the embedder API transition
# is complete.
# TODO(fxb/54041): Remove when no longer neccesary.
#
# `sources`, `defines`, `public_configs`, `configs`, `public_deps`, `deps` work
# as they do in a normal `source_set`.
#
# `legacy_deps` is the list of dependencies which should be mutated by
# appending '_fuchsia_legacy' when creating the 2 `source_set`'s. The template adds
# `legacy_deps` to `public_deps`, whether it mutates them or not.
template("source_set_maybe_fuchsia_legacy") {
public_deps_non_legacy = []
deps_non_legacy = []
if (defined(invoker.public_deps)) {
public_deps_non_legacy += invoker.public_deps
}
if (defined(invoker.deps)) {
deps_non_legacy += invoker.deps
}
if (defined(invoker.public_deps_legacy_and_next)) {
foreach(legacy_dep, invoker.public_deps_legacy_and_next) {
public_deps_non_legacy += [ legacy_dep ]
}
}
if (defined(invoker.deps_legacy_and_next)) {
foreach(legacy_dep, invoker.deps_legacy_and_next) {
deps_non_legacy += [ legacy_dep ]
}
}
source_set(target_name) {
forward_variables_from(invoker,
[
"testonly",
"sources",
"defines",
"public_configs",
"configs",
])
public_deps = public_deps_non_legacy
deps = deps_non_legacy
}
if (is_fuchsia) {
legagcy_suffix = "_fuchsia_legacy"
sources_legacy = []
if (defined(invoker.sources_legacy)) {
sources_legacy += invoker.sources_legacy
}
if (defined(invoker.sources)) {
sources_legacy += invoker.sources
}
public_configs_legacy = [ "//flutter:fuchsia_legacy" ]
if (defined(invoker.public_configs)) {
public_configs_legacy += invoker.public_configs
}
public_deps_legacy = []
deps_legacy = []
if (defined(invoker.public_deps)) {
public_deps_legacy += invoker.public_deps
}
if (defined(invoker.deps)) {
deps_legacy += invoker.deps
}
if (defined(invoker.public_deps_legacy)) {
public_deps_legacy += invoker.public_deps_legacy
}
if (defined(invoker.deps_legacy)) {
deps_legacy += invoker.deps_legacy
}
if (defined(invoker.public_deps_legacy_and_next)) {
foreach(legacy_dep, invoker.public_deps_legacy_and_next) {
public_deps_legacy += [ legacy_dep + legagcy_suffix ]
}
}
if (defined(invoker.deps_legacy_and_next)) {
foreach(legacy_dep, invoker.deps_legacy_and_next) {
deps_legacy += [ legacy_dep + legagcy_suffix ]
}
}
source_set(target_name + legagcy_suffix) {
forward_variables_from(invoker,
[
"testonly",
"defines",
"configs",
])
sources = sources_legacy
public_configs = public_configs_legacy
public_deps = public_deps_legacy
deps = deps_legacy
}
} else {
if (defined(invoker.sources_legacy)) {
not_needed(invoker, [ "sources_legacy" ])
}
if (defined(invoker.public_deps_legacy)) {
not_needed(invoker, [ "public_deps_legacy" ])
}
if (defined(invoker.deps_legacy)) {
not_needed(invoker, [ "deps_legacy" ])
}
}
}
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//flutter/common/config.gni")
import("//flutter/testing/testing.gni")
if (is_fuchsia) { if (is_fuchsia) {
import("//build/fuchsia/sdk.gni") import("//build/fuchsia/sdk.gni")
import("//flutter/tools/fuchsia/fuchsia_archive.gni") import("//flutter/tools/fuchsia/fuchsia_archive.gni")
} }
import("//flutter/testing/testing.gni")
source_set("flow") { source_set_maybe_fuchsia_legacy("flow") {
sources = [ sources = [
"compositor_context.cc", "compositor_context.cc",
"compositor_context.h", "compositor_context.h",
...@@ -74,37 +75,33 @@ source_set("flow") { ...@@ -74,37 +75,33 @@ source_set("flow") {
public_configs = [ "//flutter:config" ] public_configs = [ "//flutter:config" ]
public_deps = []
deps = [ deps = [
"//flutter/common", "//flutter/common",
"//flutter/fml", "//flutter/fml",
"//third_party/skia", "//third_party/skia",
] ]
if (is_fuchsia) { sources_legacy = [
sources += [ "layers/child_scene_layer.cc",
"layers/child_scene_layer.cc", "layers/child_scene_layer.h",
"layers/child_scene_layer.h", "scene_update_context.cc",
"scene_update_context.cc", "scene_update_context.h",
"scene_update_context.h", "view_holder.cc",
"view_holder.cc", "view_holder.h",
"view_holder.h", ]
]
public_deps += [ public_deps_legacy = [
"$fuchsia_sdk_root/fidl:fuchsia.ui.app", "$fuchsia_sdk_root/fidl:fuchsia.ui.app",
"$fuchsia_sdk_root/fidl:fuchsia.ui.gfx", "$fuchsia_sdk_root/fidl:fuchsia.ui.gfx",
"$fuchsia_sdk_root/pkg:scenic_cpp", "$fuchsia_sdk_root/pkg:scenic_cpp",
] ]
}
} }
test_fixtures("flow_fixtures") { test_fixtures("flow_fixtures") {
fixtures = [] fixtures = []
} }
source_set("flow_testing") { source_set_maybe_fuchsia_legacy("flow_testing") {
testonly = true testonly = true
sources = [ sources = [
...@@ -113,6 +110,8 @@ source_set("flow_testing") { ...@@ -113,6 +110,8 @@ source_set("flow_testing") {
"testing/layer_test.h", "testing/layer_test.h",
"testing/mock_layer.cc", "testing/mock_layer.cc",
"testing/mock_layer.h", "testing/mock_layer.h",
"testing/mock_raster_cache.cc",
"testing/mock_raster_cache.h",
"testing/mock_texture.cc", "testing/mock_texture.cc",
"testing/mock_texture.h", "testing/mock_texture.h",
"testing/skia_gpu_object_layer_test.cc", "testing/skia_gpu_object_layer_test.cc",
...@@ -120,13 +119,14 @@ source_set("flow_testing") { ...@@ -120,13 +119,14 @@ source_set("flow_testing") {
] ]
public_deps = [ public_deps = [
":flow",
"//flutter/testing:skia", "//flutter/testing:skia",
"//third_party/googletest:gtest", "//third_party/googletest:gtest",
] ]
deps_legacy_and_next = [ ":flow" ]
} }
executable("flow_unittests") { source_set_maybe_fuchsia_legacy("flow_unittests_common") {
testonly = true testonly = true
sources = [ sources = [
...@@ -161,14 +161,8 @@ executable("flow_unittests") { ...@@ -161,14 +161,8 @@ executable("flow_unittests") {
"texture_unittests.cc", "texture_unittests.cc",
] ]
if (is_fuchsia) {
sources += [ "layers/fuchsia_layer_unittests.cc" ]
}
deps = [ deps = [
":flow",
":flow_fixtures", ":flow_fixtures",
":flow_testing",
"//flutter/fml", "//flutter/fml",
"//flutter/testing:skia", "//flutter/testing:skia",
"//flutter/testing:testing_lib", "//flutter/testing:testing_lib",
...@@ -177,8 +171,38 @@ executable("flow_unittests") { ...@@ -177,8 +171,38 @@ executable("flow_unittests") {
"//third_party/skia", "//third_party/skia",
] ]
if (is_fuchsia) { sources_legacy = [ "layers/fuchsia_layer_unittests.cc" ]
deps += [ "//build/fuchsia/pkg:sys_cpp_testing" ]
deps_legacy = [ "//build/fuchsia/pkg:sys_cpp_testing" ]
deps_legacy_and_next = [
":flow",
":flow_testing",
]
}
if (is_fuchsia) {
executable("flow_unittests") {
testonly = true
deps = [
":flow_unittests_common_fuchsia_legacy",
]
}
executable("flow_unittests_next") {
testonly = true
deps = [
":flow_unittests_common",
]
}
} else {
executable("flow_unittests") {
testonly = true
deps = [
":flow_unittests_common",
]
} }
} }
...@@ -215,4 +239,37 @@ if (is_fuchsia) { ...@@ -215,4 +239,37 @@ if (is_fuchsia) {
}, },
] ]
} }
fuchsia_archive("flow_tests_next") {
testonly = true
deps = [
":flow_unittests_next",
]
binary = "flow_unittests_next"
libraries = common_libs
meta_dir = "//flutter/testing/fuchsia/meta"
cmx_file = "$meta_dir/fuchsia_test.cmx"
resources = [
{
path = rebase_path(
"//flutter/testing/resources/performance_overlay_gold_60fps.png")
dest = "flutter/testing/resources/performance_overlay_gold_60fps.png"
},
{
path = rebase_path(
"//flutter/testing/resources/performance_overlay_gold_90fps.png")
dest = "flutter/testing/resources/performance_overlay_gold_90fps.png"
},
{
path = rebase_path(
"//flutter/testing/resources/performance_overlay_gold_120fps.png")
dest = "flutter/testing/resources/performance_overlay_gold_120fps.png"
},
]
}
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "flutter/fml/macros.h" #include "flutter/fml/macros.h"
#include "flutter/fml/raster_thread_merger.h" #include "flutter/fml/raster_thread_merger.h"
#include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPictureRecorder.h" #include "third_party/skia/include/gpu/GrContext.h"
namespace flutter { namespace flutter {
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
#include "flutter/flow/layers/clip_path_layer.h" #include "flutter/flow/layers/clip_path_layer.h"
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
#include "lib/ui/scenic/cpp/commands.h" #include "lib/ui/scenic/cpp/commands.h"
#endif // defined(OS_FUCHSIA) #endif
namespace flutter { namespace flutter {
...@@ -40,7 +40,7 @@ void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { ...@@ -40,7 +40,7 @@ void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
context->cull_rect = previous_cull_rect; context->cull_rect = previous_cull_rect;
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { void ClipPathLayer::UpdateScene(SceneUpdateContext& context) {
TRACE_EVENT0("flutter", "ClipPathLayer::UpdateScene"); TRACE_EVENT0("flutter", "ClipPathLayer::UpdateScene");
...@@ -51,7 +51,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { ...@@ -51,7 +51,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) {
UpdateSceneChildren(context); UpdateSceneChildren(context);
} }
#endif // defined(OS_FUCHSIA) #endif
void ClipPathLayer::Paint(PaintContext& context) const { void ClipPathLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ClipPathLayer::Paint"); TRACE_EVENT0("flutter", "ClipPathLayer::Paint");
......
...@@ -21,9 +21,9 @@ class ClipPathLayer : public ContainerLayer { ...@@ -21,9 +21,9 @@ class ClipPathLayer : public ContainerLayer {
return clip_behavior_ == Clip::antiAliasWithSaveLayer; return clip_behavior_ == Clip::antiAliasWithSaveLayer;
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void UpdateScene(SceneUpdateContext& context) override; void UpdateScene(SceneUpdateContext& context) override;
#endif // defined(OS_FUCHSIA) #endif
private: private:
SkPath clip_path_; SkPath clip_path_;
......
...@@ -33,7 +33,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { ...@@ -33,7 +33,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
context->cull_rect = previous_cull_rect; context->cull_rect = previous_cull_rect;
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { void ClipRectLayer::UpdateScene(SceneUpdateContext& context) {
TRACE_EVENT0("flutter", "ClipRectLayer::UpdateScene"); TRACE_EVENT0("flutter", "ClipRectLayer::UpdateScene");
...@@ -44,7 +44,7 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { ...@@ -44,7 +44,7 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) {
UpdateSceneChildren(context); UpdateSceneChildren(context);
} }
#endif // defined(OS_FUCHSIA) #endif
void ClipRectLayer::Paint(PaintContext& context) const { void ClipRectLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ClipRectLayer::Paint"); TRACE_EVENT0("flutter", "ClipRectLayer::Paint");
......
...@@ -20,9 +20,9 @@ class ClipRectLayer : public ContainerLayer { ...@@ -20,9 +20,9 @@ class ClipRectLayer : public ContainerLayer {
return clip_behavior_ == Clip::antiAliasWithSaveLayer; return clip_behavior_ == Clip::antiAliasWithSaveLayer;
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void UpdateScene(SceneUpdateContext& context) override; void UpdateScene(SceneUpdateContext& context) override;
#endif // defined(OS_FUCHSIA) #endif
private: private:
SkRect clip_rect_; SkRect clip_rect_;
......
...@@ -34,7 +34,7 @@ void ClipRRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { ...@@ -34,7 +34,7 @@ void ClipRRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
context->cull_rect = previous_cull_rect; context->cull_rect = previous_cull_rect;
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) {
TRACE_EVENT0("flutter", "ClipRRectLayer::UpdateScene"); TRACE_EVENT0("flutter", "ClipRRectLayer::UpdateScene");
...@@ -45,7 +45,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { ...@@ -45,7 +45,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) {
UpdateSceneChildren(context); UpdateSceneChildren(context);
} }
#endif // defined(OS_FUCHSIA) #endif
void ClipRRectLayer::Paint(PaintContext& context) const { void ClipRRectLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ClipRRectLayer::Paint"); TRACE_EVENT0("flutter", "ClipRRectLayer::Paint");
......
...@@ -21,9 +21,9 @@ class ClipRRectLayer : public ContainerLayer { ...@@ -21,9 +21,9 @@ class ClipRRectLayer : public ContainerLayer {
return clip_behavior_ == Clip::antiAliasWithSaveLayer; return clip_behavior_ == Clip::antiAliasWithSaveLayer;
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void UpdateScene(SceneUpdateContext& context) override; void UpdateScene(SceneUpdateContext& context) override;
#endif // defined(OS_FUCHSIA) #endif
private: private:
SkRRect clip_rrect_; SkRRect clip_rrect_;
......
...@@ -29,7 +29,7 @@ void ContainerLayer::Paint(PaintContext& context) const { ...@@ -29,7 +29,7 @@ void ContainerLayer::Paint(PaintContext& context) const {
void ContainerLayer::PrerollChildren(PrerollContext* context, void ContainerLayer::PrerollChildren(PrerollContext* context,
const SkMatrix& child_matrix, const SkMatrix& child_matrix,
SkRect* child_paint_bounds) { SkRect* child_paint_bounds) {
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
child_layer_exists_below_ = context->child_scene_layer_exists_below; child_layer_exists_below_ = context->child_scene_layer_exists_below;
context->child_scene_layer_exists_below = false; context->child_scene_layer_exists_below = false;
#endif #endif
...@@ -57,7 +57,7 @@ void ContainerLayer::PrerollChildren(PrerollContext* context, ...@@ -57,7 +57,7 @@ void ContainerLayer::PrerollChildren(PrerollContext* context,
context->has_platform_view = child_has_platform_view; context->has_platform_view = child_has_platform_view;
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
if (child_layer_exists_below_) { if (child_layer_exists_below_) {
set_needs_system_composite(true); set_needs_system_composite(true);
} }
...@@ -87,7 +87,7 @@ void ContainerLayer::TryToPrepareRasterCache(PrerollContext* context, ...@@ -87,7 +87,7 @@ void ContainerLayer::TryToPrepareRasterCache(PrerollContext* context,
} }
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void ContainerLayer::CheckForChildLayerBelow(PrerollContext* context) { void ContainerLayer::CheckForChildLayerBelow(PrerollContext* context) {
// All ContainerLayers make the check in PrerollChildren. // All ContainerLayers make the check in PrerollChildren.
...@@ -158,7 +158,7 @@ void ContainerLayer::UpdateSceneChildren(SceneUpdateContext& context) { ...@@ -158,7 +158,7 @@ void ContainerLayer::UpdateSceneChildren(SceneUpdateContext& context) {
} }
} }
#endif // defined(OS_FUCHSIA) #endif
MergedContainerLayer::MergedContainerLayer() { MergedContainerLayer::MergedContainerLayer() {
// Ensure the layer has only one direct child. // Ensure the layer has only one direct child.
......
...@@ -18,10 +18,10 @@ class ContainerLayer : public Layer { ...@@ -18,10 +18,10 @@ class ContainerLayer : public Layer {
void Preroll(PrerollContext* context, const SkMatrix& matrix) override; void Preroll(PrerollContext* context, const SkMatrix& matrix) override;
void Paint(PaintContext& context) const override; void Paint(PaintContext& context) const override;
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void CheckForChildLayerBelow(PrerollContext* context) override; void CheckForChildLayerBelow(PrerollContext* context) override;
void UpdateScene(SceneUpdateContext& context) override; void UpdateScene(SceneUpdateContext& context) override;
#endif // defined(OS_FUCHSIA) #endif
const std::vector<std::shared_ptr<Layer>>& layers() const { return layers_; } const std::vector<std::shared_ptr<Layer>>& layers() const { return layers_; }
...@@ -31,9 +31,9 @@ class ContainerLayer : public Layer { ...@@ -31,9 +31,9 @@ class ContainerLayer : public Layer {
SkRect* child_paint_bounds); SkRect* child_paint_bounds);
void PaintChildren(PaintContext& context) const; void PaintChildren(PaintContext& context) const;
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void UpdateSceneChildren(SceneUpdateContext& context); void UpdateSceneChildren(SceneUpdateContext& context);
#endif // defined(OS_FUCHSIA) #endif
// Try to prepare the raster cache for a given layer. // Try to prepare the raster cache for a given layer.
// //
......
...@@ -55,7 +55,7 @@ Layer::AutoPrerollSaveLayerState::~AutoPrerollSaveLayerState() { ...@@ -55,7 +55,7 @@ Layer::AutoPrerollSaveLayerState::~AutoPrerollSaveLayerState() {
} }
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void Layer::CheckForChildLayerBelow(PrerollContext* context) { void Layer::CheckForChildLayerBelow(PrerollContext* context) {
child_layer_exists_below_ = context->child_scene_layer_exists_below; child_layer_exists_below_ = context->child_scene_layer_exists_below;
...@@ -103,7 +103,7 @@ void Layer::UpdateScene(SceneUpdateContext& context) { ...@@ -103,7 +103,7 @@ void Layer::UpdateScene(SceneUpdateContext& context) {
} }
} }
#endif // defined(OS_FUCHSIA) #endif
Layer::AutoSaveLayer::AutoSaveLayer(const PaintContext& paint_context, Layer::AutoSaveLayer::AutoSaveLayer(const PaintContext& paint_context,
const SkRect& bounds, const SkRect& bounds,
......
...@@ -27,13 +27,13 @@ ...@@ -27,13 +27,13 @@
#include "third_party/skia/include/core/SkRect.h" #include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/utils/SkNWayCanvas.h" #include "third_party/skia/include/utils/SkNWayCanvas.h"
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
#include "flutter/flow/scene_update_context.h" //nogncheck #include "flutter/flow/scene_update_context.h" //nogncheck
#include "lib/ui/scenic/cpp/resources.h" //nogncheck #include "lib/ui/scenic/cpp/resources.h" //nogncheck
#include "lib/ui/scenic/cpp/session.h" //nogncheck #include "lib/ui/scenic/cpp/session.h" //nogncheck
#endif // defined(OS_FUCHSIA) #endif
namespace flutter { namespace flutter {
...@@ -66,11 +66,11 @@ struct PrerollContext { ...@@ -66,11 +66,11 @@ struct PrerollContext {
float total_elevation = 0.0f; float total_elevation = 0.0f;
bool has_platform_view = false; bool has_platform_view = false;
bool is_opaque = true; bool is_opaque = true;
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
// True if, during the traversal so far, we have seen a child_scene_layer. // True if, during the traversal so far, we have seen a child_scene_layer.
// Informs whether a layer needs to be system composited. // Informs whether a layer needs to be system composited.
bool child_scene_layer_exists_below = false; bool child_scene_layer_exists_below = false;
#endif // defined(OS_FUCHSIA) #endif
}; };
// Represents a single composited layer. Created on the UI thread but then // Represents a single composited layer. Created on the UI thread but then
...@@ -162,7 +162,7 @@ class Layer { ...@@ -162,7 +162,7 @@ class Layer {
virtual void Paint(PaintContext& context) const = 0; virtual void Paint(PaintContext& context) const = 0;
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
// Updates the system composited scene. // Updates the system composited scene.
virtual void UpdateScene(SceneUpdateContext& context); virtual void UpdateScene(SceneUpdateContext& context);
virtual void CheckForChildLayerBelow(PrerollContext* context); virtual void CheckForChildLayerBelow(PrerollContext* context);
...@@ -186,7 +186,7 @@ class Layer { ...@@ -186,7 +186,7 @@ class Layer {
uint64_t unique_id() const { return unique_id_; } uint64_t unique_id() const { return unique_id_; }
protected: protected:
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
bool child_layer_exists_below_ = false; bool child_layer_exists_below_ = false;
#endif #endif
......
...@@ -61,7 +61,7 @@ bool LayerTree::Preroll(CompositorContext::ScopedFrame& frame, ...@@ -61,7 +61,7 @@ bool LayerTree::Preroll(CompositorContext::ScopedFrame& frame,
return context.surface_needs_readback; return context.surface_needs_readback;
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void LayerTree::UpdateScene(SceneUpdateContext& context, void LayerTree::UpdateScene(SceneUpdateContext& context,
scenic::ContainerNode& container) { scenic::ContainerNode& container) {
TRACE_EVENT0("flutter", "LayerTree::UpdateScene"); TRACE_EVENT0("flutter", "LayerTree::UpdateScene");
......
...@@ -34,7 +34,7 @@ class LayerTree { ...@@ -34,7 +34,7 @@ class LayerTree {
bool Preroll(CompositorContext::ScopedFrame& frame, bool Preroll(CompositorContext::ScopedFrame& frame,
bool ignore_raster_cache = false); bool ignore_raster_cache = false);
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void UpdateScene(SceneUpdateContext& context, void UpdateScene(SceneUpdateContext& context,
scenic::ContainerNode& container); scenic::ContainerNode& container);
#endif #endif
......
...@@ -88,7 +88,7 @@ void OpacityLayer::Paint(PaintContext& context) const { ...@@ -88,7 +88,7 @@ void OpacityLayer::Paint(PaintContext& context) const {
PaintChildren(context); PaintChildren(context);
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void OpacityLayer::UpdateScene(SceneUpdateContext& context) { void OpacityLayer::UpdateScene(SceneUpdateContext& context) {
float saved_alpha = context.alphaf(); float saved_alpha = context.alphaf();
...@@ -97,6 +97,6 @@ void OpacityLayer::UpdateScene(SceneUpdateContext& context) { ...@@ -97,6 +97,6 @@ void OpacityLayer::UpdateScene(SceneUpdateContext& context) {
context.set_alphaf(saved_alpha); context.set_alphaf(saved_alpha);
} }
#endif // defined(OS_FUCHSIA) #endif
} // namespace flutter } // namespace flutter
...@@ -31,9 +31,9 @@ class OpacityLayer : public MergedContainerLayer { ...@@ -31,9 +31,9 @@ class OpacityLayer : public MergedContainerLayer {
void Paint(PaintContext& context) const override; void Paint(PaintContext& context) const override;
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void UpdateScene(SceneUpdateContext& context) override; void UpdateScene(SceneUpdateContext& context) override;
#endif // defined(OS_FUCHSIA) #endif
private: private:
SkAlpha alpha_; SkAlpha alpha_;
......
...@@ -135,7 +135,7 @@ TEST_F(PhysicalShapeLayerTest, ElevationSimple) { ...@@ -135,7 +135,7 @@ TEST_F(PhysicalShapeLayerTest, ElevationSimple) {
// The Fuchsia system compositor handles all elevated PhysicalShapeLayers and // The Fuchsia system compositor handles all elevated PhysicalShapeLayers and
// their shadows , so we do not use the direct |Paint()| path there. // their shadows , so we do not use the direct |Paint()| path there.
#if !defined(OS_FUCHSIA) #if !defined(LEGACY_FUCHSIA_EMBEDDER)
SkPaint layer_paint; SkPaint layer_paint;
layer_paint.setColor(SK_ColorGREEN); layer_paint.setColor(SK_ColorGREEN);
layer_paint.setAntiAlias(true); layer_paint.setAntiAlias(true);
...@@ -192,7 +192,7 @@ TEST_F(PhysicalShapeLayerTest, ElevationComplex) { ...@@ -192,7 +192,7 @@ TEST_F(PhysicalShapeLayerTest, ElevationComplex) {
// The Fuchsia system compositor handles all elevated PhysicalShapeLayers and // The Fuchsia system compositor handles all elevated PhysicalShapeLayers and
// their shadows , so we do not use the direct |Paint()| path there. // their shadows , so we do not use the direct |Paint()| path there.
#if !defined(OS_FUCHSIA) #if !defined(LEGACY_FUCHSIA_EMBEDDER)
SkPaint layer_paint; SkPaint layer_paint;
layer_paint.setColor(SK_ColorBLACK); layer_paint.setColor(SK_ColorBLACK);
layer_paint.setAntiAlias(true); layer_paint.setAntiAlias(true);
......
...@@ -20,7 +20,7 @@ PictureLayer::PictureLayer(const SkPoint& offset, ...@@ -20,7 +20,7 @@ PictureLayer::PictureLayer(const SkPoint& offset,
void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "PictureLayer::Preroll"); TRACE_EVENT0("flutter", "PictureLayer::Preroll");
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
CheckForChildLayerBelow(context); CheckForChildLayerBelow(context);
#endif #endif
......
...@@ -13,7 +13,7 @@ PlatformViewLayer::PlatformViewLayer(const SkPoint& offset, ...@@ -13,7 +13,7 @@ PlatformViewLayer::PlatformViewLayer(const SkPoint& offset,
void PlatformViewLayer::Preroll(PrerollContext* context, void PlatformViewLayer::Preroll(PrerollContext* context,
const SkMatrix& matrix) { const SkMatrix& matrix) {
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
CheckForChildLayerBelow(context); CheckForChildLayerBelow(context);
#endif #endif
...@@ -31,25 +31,25 @@ void PlatformViewLayer::Preroll(PrerollContext* context, ...@@ -31,25 +31,25 @@ void PlatformViewLayer::Preroll(PrerollContext* context,
context->mutators_stack); context->mutators_stack);
context->view_embedder->PrerollCompositeEmbeddedView(view_id_, context->view_embedder->PrerollCompositeEmbeddedView(view_id_,
std::move(params)); std::move(params));
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
// Set needs_system_composite flag so that rasterizer can call UpdateScene. // Set needs_system_composite flag so that rasterizer can call UpdateScene.
set_needs_system_composite(true); set_needs_system_composite(true);
#endif // defined(OS_FUCHSIA) #endif
} }
void PlatformViewLayer::Paint(PaintContext& context) const { void PlatformViewLayer::Paint(PaintContext& context) const {
if (context.view_embedder == nullptr) { if (context.view_embedder == nullptr) {
#if !defined(OS_FUCHSIA) #if !defined(LEGACY_FUCHSIA_EMBEDDER)
FML_LOG(ERROR) << "Trying to embed a platform view but the PaintContext " FML_LOG(ERROR) << "Trying to embed a platform view but the PaintContext "
"does not support embedding"; "does not support embedding";
#endif // defined(OS_FUCHSIA) #endif
return; return;
} }
SkCanvas* canvas = context.view_embedder->CompositeEmbeddedView(view_id_); SkCanvas* canvas = context.view_embedder->CompositeEmbeddedView(view_id_);
context.leaf_nodes_canvas = canvas; context.leaf_nodes_canvas = canvas;
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void PlatformViewLayer::UpdateScene(SceneUpdateContext& context) { void PlatformViewLayer::UpdateScene(SceneUpdateContext& context) {
context.UpdateScene(view_id_, offset_, size_); context.UpdateScene(view_id_, offset_, size_);
} }
......
...@@ -17,7 +17,7 @@ class PlatformViewLayer : public Layer { ...@@ -17,7 +17,7 @@ class PlatformViewLayer : public Layer {
void Preroll(PrerollContext* context, const SkMatrix& matrix) override; void Preroll(PrerollContext* context, const SkMatrix& matrix) override;
void Paint(PaintContext& context) const override; void Paint(PaintContext& context) const override;
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
// Updates the system composited scene. // Updates the system composited scene.
void UpdateScene(SceneUpdateContext& context) override; void UpdateScene(SceneUpdateContext& context) override;
#endif #endif
......
...@@ -12,7 +12,7 @@ ShaderMaskLayer::ShaderMaskLayer(sk_sp<SkShader> shader, ...@@ -12,7 +12,7 @@ ShaderMaskLayer::ShaderMaskLayer(sk_sp<SkShader> shader,
: shader_(shader), mask_rect_(mask_rect), blend_mode_(blend_mode) {} : shader_(shader), mask_rect_(mask_rect), blend_mode_(blend_mode) {}
void ShaderMaskLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { void ShaderMaskLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
CheckForChildLayerBelow(context); CheckForChildLayerBelow(context);
#endif #endif
......
...@@ -22,7 +22,7 @@ TextureLayer::TextureLayer(const SkPoint& offset, ...@@ -22,7 +22,7 @@ TextureLayer::TextureLayer(const SkPoint& offset,
void TextureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { void TextureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "TextureLayer::Preroll"); TRACE_EVENT0("flutter", "TextureLayer::Preroll");
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
CheckForChildLayerBelow(context); CheckForChildLayerBelow(context);
#endif #endif
......
...@@ -50,7 +50,7 @@ void TransformLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { ...@@ -50,7 +50,7 @@ void TransformLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
context->mutators_stack.Pop(); context->mutators_stack.Pop();
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void TransformLayer::UpdateScene(SceneUpdateContext& context) { void TransformLayer::UpdateScene(SceneUpdateContext& context) {
TRACE_EVENT0("flutter", "TransformLayer::UpdateScene"); TRACE_EVENT0("flutter", "TransformLayer::UpdateScene");
...@@ -64,7 +64,7 @@ void TransformLayer::UpdateScene(SceneUpdateContext& context) { ...@@ -64,7 +64,7 @@ void TransformLayer::UpdateScene(SceneUpdateContext& context) {
} }
} }
#endif // defined(OS_FUCHSIA) #endif
void TransformLayer::Paint(PaintContext& context) const { void TransformLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "TransformLayer::Paint"); TRACE_EVENT0("flutter", "TransformLayer::Paint");
......
...@@ -19,9 +19,9 @@ class TransformLayer : public ContainerLayer { ...@@ -19,9 +19,9 @@ class TransformLayer : public ContainerLayer {
void Paint(PaintContext& context) const override; void Paint(PaintContext& context) const override;
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void UpdateScene(SceneUpdateContext& context) override; void UpdateScene(SceneUpdateContext& context) override;
#endif // defined(OS_FUCHSIA) #endif
private: private:
SkMatrix transform_; SkMatrix transform_;
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <memory> #include <memory>
#include <unordered_map> #include <unordered_map>
#include "flutter/flow/instrumentation.h"
#include "flutter/flow/raster_cache_key.h" #include "flutter/flow/raster_cache_key.h"
#include "flutter/fml/macros.h" #include "flutter/fml/macros.h"
#include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/memory/weak_ptr.h"
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include "flutter/flow/raster_cache.h" #include "flutter/flow/raster_cache.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkPicture.h" #include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkPictureRecorder.h" #include "third_party/skia/include/core/SkPictureRecorder.h"
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include <memory> #include <memory>
#include "flutter/flow/compositor_context.h"
#include "flutter/flow/embedded_views.h" #include "flutter/flow/embedded_views.h"
#include "flutter/flow/gl_context_switch.h"
#include "flutter/flow/surface_frame.h" #include "flutter/flow/surface_frame.h"
#include "flutter/fml/macros.h" #include "flutter/fml/macros.h"
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
#include <optional> #include <optional>
#include <utility> #include <utility>
#include "flutter/flow/testing/mock_raster_cache.h"
#include "flutter/fml/macros.h" #include "flutter/fml/macros.h"
#include "flutter/testing/canvas_test.h" #include "flutter/testing/canvas_test.h"
#include "flutter/testing/mock_canvas.h" #include "flutter/testing/mock_canvas.h"
#include "flutter/testing/mock_raster_cache.h"
#include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkImageInfo.h" #include "third_party/skia/include/core/SkImageInfo.h"
#include "third_party/skia/include/utils/SkNWayCanvas.h" #include "third_party/skia/include/utils/SkNWayCanvas.h"
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "flutter/testing/mock_raster_cache.h" #include "flutter/flow/testing/mock_raster_cache.h"
#include "flutter/flow/layers/layer.h" #include "flutter/flow/layers/layer.h"
namespace flutter { namespace flutter {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef TESTING_MOCK_RASTER_CACHE_H_ #ifndef FLOW_TESTING_MOCK_RASTER_CACHE_H_
#define TESTING_MOCK_RASTER_CACHE_H_ #define FLOW_TESTING_MOCK_RASTER_CACHE_H_
#include "flutter/flow/raster_cache.h" #include "flutter/flow/raster_cache.h"
#include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkImage.h"
...@@ -61,4 +61,4 @@ class MockRasterCache : public RasterCache { ...@@ -61,4 +61,4 @@ class MockRasterCache : public RasterCache {
} // namespace testing } // namespace testing
} // namespace flutter } // namespace flutter
#endif // TESTING_MOCK_RASTER_CACHE_H_ #endif // FLOW_TESTING_MOCK_RASTER_CACHE_H_
...@@ -6,7 +6,7 @@ import("//build/fuchsia/sdk.gni") ...@@ -6,7 +6,7 @@ import("//build/fuchsia/sdk.gni")
import("//flutter/common/config.gni") import("//flutter/common/config.gni")
import("//flutter/testing/testing.gni") import("//flutter/testing/testing.gni")
source_set("ui") { source_set_maybe_fuchsia_legacy("ui") {
sources = [ sources = [
"compositing/scene.cc", "compositing/scene.cc",
"compositing/scene.h", "compositing/scene.h",
...@@ -109,10 +109,13 @@ source_set("ui") { ...@@ -109,10 +109,13 @@ source_set("ui") {
public_configs = [ "//flutter:config" ] public_configs = [ "//flutter:config" ]
public_deps = [
"//flutter/third_party/txt",
]
deps = [ deps = [
"//flutter/assets", "//flutter/assets",
"//flutter/common", "//flutter/common",
"//flutter/flow",
"//flutter/fml", "//flutter/fml",
"//flutter/runtime:test_font", "//flutter/runtime:test_font",
"//flutter/third_party/tonic", "//flutter/third_party/tonic",
...@@ -121,26 +124,22 @@ source_set("ui") { ...@@ -121,26 +124,22 @@ source_set("ui") {
"//third_party/skia", "//third_party/skia",
] ]
public_deps = [
"//flutter/third_party/txt",
]
if (flutter_enable_skshaper) { if (flutter_enable_skshaper) {
defines = [ "FLUTTER_ENABLE_SKSHAPER" ] defines = [ "FLUTTER_ENABLE_SKSHAPER" ]
} }
if (is_fuchsia) { sources_legacy = [
sources += [ "compositing/scene_host.cc",
"compositing/scene_host.cc", "compositing/scene_host.h",
"compositing/scene_host.h", ]
]
deps += [ deps_legacy = [
"$fuchsia_sdk_root/pkg:async-cpp", "$fuchsia_sdk_root/pkg:async-cpp",
"//flutter/shell/platform/fuchsia/dart-pkg/fuchsia", "//flutter/shell/platform/fuchsia/dart-pkg/fuchsia",
"//flutter/shell/platform/fuchsia/dart-pkg/zircon", "//flutter/shell/platform/fuchsia/dart-pkg/zircon",
] ]
}
deps_legacy_and_next = [ "//flutter/flow:flow" ]
} }
if (current_toolchain == host_toolchain) { if (current_toolchain == host_toolchain) {
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include "third_party/tonic/dart_binding_macros.h" #include "third_party/tonic/dart_binding_macros.h"
#include "third_party/tonic/dart_library_natives.h" #include "third_party/tonic/dart_library_natives.h"
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
#include "flutter/flow/layers/child_scene_layer.h" #include "flutter/flow/layers/child_scene_layer.h" // nogncheck
#endif #endif
namespace flutter { namespace flutter {
...@@ -67,7 +67,7 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, SceneBuilder); ...@@ -67,7 +67,7 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, SceneBuilder);
V(SceneBuilder, build) V(SceneBuilder, build)
FOR_EACH_BINDING(DART_NATIVE_CALLBACK) FOR_EACH_BINDING(DART_NATIVE_CALLBACK)
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
DART_NATIVE_CALLBACK(SceneBuilder, addChildScene) DART_NATIVE_CALLBACK(SceneBuilder, addChildScene)
#endif #endif
...@@ -75,7 +75,7 @@ void SceneBuilder::RegisterNatives(tonic::DartLibraryNatives* natives) { ...@@ -75,7 +75,7 @@ void SceneBuilder::RegisterNatives(tonic::DartLibraryNatives* natives) {
natives->Register({ natives->Register({
{"SceneBuilder_constructor", SceneBuilder_constructor, 1, true}, {"SceneBuilder_constructor", SceneBuilder_constructor, 1, true},
FOR_EACH_BINDING(DART_REGISTER_NATIVE) FOR_EACH_BINDING(DART_REGISTER_NATIVE)
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
DART_REGISTER_NATIVE(SceneBuilder, addChildScene) DART_REGISTER_NATIVE(SceneBuilder, addChildScene)
#endif #endif
}); });
...@@ -247,7 +247,7 @@ void SceneBuilder::addPlatformView(double dx, ...@@ -247,7 +247,7 @@ void SceneBuilder::addPlatformView(double dx,
AddLayer(std::move(layer)); AddLayer(std::move(layer));
} }
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void SceneBuilder::addChildScene(double dx, void SceneBuilder::addChildScene(double dx,
double dy, double dy,
double width, double width,
...@@ -259,7 +259,7 @@ void SceneBuilder::addChildScene(double dx, ...@@ -259,7 +259,7 @@ void SceneBuilder::addChildScene(double dx,
hitTestable); hitTestable);
AddLayer(std::move(layer)); AddLayer(std::move(layer));
} }
#endif // defined(OS_FUCHSIA) #endif
void SceneBuilder::addPerformanceOverlay(uint64_t enabledOptions, void SceneBuilder::addPerformanceOverlay(uint64_t enabledOptions,
double left, double left,
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include "flutter/lib/ui/painting/shader.h" #include "flutter/lib/ui/painting/shader.h"
#include "third_party/tonic/typed_data/typed_list.h" #include "third_party/tonic/typed_data/typed_list.h"
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
#include "flutter/lib/ui/compositing/scene_host.h" #include "flutter/lib/ui/compositing/scene_host.h" // nogncheck
#endif #endif
namespace flutter { namespace flutter {
...@@ -101,7 +101,7 @@ class SceneBuilder : public RefCountedDartWrappable<SceneBuilder> { ...@@ -101,7 +101,7 @@ class SceneBuilder : public RefCountedDartWrappable<SceneBuilder> {
double height, double height,
int64_t viewId); int64_t viewId);
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
void addChildScene(double dx, void addChildScene(double dx,
double dy, double dy,
double width, double width,
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
#include "third_party/tonic/converter/dart_converter.h" #include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/logging/dart_error.h" #include "third_party/tonic/logging/dart_error.h"
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
#include "flutter/lib/ui/compositing/scene_host.h" #include "flutter/lib/ui/compositing/scene_host.h" // nogncheck
#endif #endif
using tonic::ToDart; using tonic::ToDart;
...@@ -82,7 +82,7 @@ void DartUI::InitForGlobal() { ...@@ -82,7 +82,7 @@ void DartUI::InitForGlobal() {
SemanticsUpdateBuilder::RegisterNatives(g_natives); SemanticsUpdateBuilder::RegisterNatives(g_natives);
Vertices::RegisterNatives(g_natives); Vertices::RegisterNatives(g_natives);
Window::RegisterNatives(g_natives); Window::RegisterNatives(g_natives);
#if defined(OS_FUCHSIA) #if defined(LEGACY_FUCHSIA_EMBEDDER)
SceneHost::RegisterNatives(g_natives); SceneHost::RegisterNatives(g_natives);
#endif #endif
} }
......
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
import("//flutter/common/config.gni") import("//flutter/common/config.gni")
import("//flutter/testing/testing.gni") import("//flutter/testing/testing.gni")
if (is_fuchsia) { if (is_fuchsia) {
import("//build/fuchsia/sdk.gni")
import("//flutter/tools/fuchsia/fuchsia_archive.gni") import("//flutter/tools/fuchsia/fuchsia_archive.gni")
} }
...@@ -42,7 +40,7 @@ group("libdart") { ...@@ -42,7 +40,7 @@ group("libdart") {
} }
} }
source_set("runtime") { source_set_maybe_fuchsia_legacy("runtime") {
sources = [ sources = [
"dart_isolate.cc", "dart_isolate.cc",
"dart_isolate.h", "dart_isolate.h",
...@@ -74,14 +72,18 @@ source_set("runtime") { ...@@ -74,14 +72,18 @@ source_set("runtime") {
"window_data.h", "window_data.h",
] ]
public_deps = [
"//third_party/rapidjson",
]
public_configs = [ "//flutter:config" ]
deps = [ deps = [
":test_font", ":test_font",
"//flutter/assets", "//flutter/assets",
"//flutter/common", "//flutter/common",
"//flutter/flow",
"//flutter/fml", "//flutter/fml",
"//flutter/lib/io", "//flutter/lib/io",
"//flutter/lib/ui",
"//flutter/third_party/tonic", "//flutter/third_party/tonic",
"//flutter/third_party/txt", "//flutter/third_party/txt",
"//third_party/dart/runtime:dart_api", "//third_party/dart/runtime:dart_api",
...@@ -89,12 +91,6 @@ source_set("runtime") { ...@@ -89,12 +91,6 @@ source_set("runtime") {
"//third_party/skia", "//third_party/skia",
] ]
public_deps = [
"//third_party/rapidjson",
]
public_configs = [ "//flutter:config" ]
if (flutter_runtime_mode != "release" && !is_fuchsia) { if (flutter_runtime_mode != "release" && !is_fuchsia) {
# Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia # Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia
# instead puts Observatory into the runner's package. # instead puts Observatory into the runner's package.
...@@ -102,53 +98,77 @@ source_set("runtime") { ...@@ -102,53 +98,77 @@ source_set("runtime") {
"//third_party/dart/runtime/observatory:embedded_observatory_archive", "//third_party/dart/runtime/observatory:embedded_observatory_archive",
] ]
} }
deps_legacy_and_next = [
"//flutter/flow:flow",
"//flutter/lib/ui:ui",
]
} }
test_fixtures("runtime_fixtures") { test_fixtures("runtime_fixtures") {
dart_main = "fixtures/runtime_test.dart" dart_main = "fixtures/runtime_test.dart"
} }
source_set("runtime_unittests_common") { source_set_maybe_fuchsia_legacy("runtime_unittests_common") {
visibility = [ ":*" ]
testonly = true testonly = true
sources = [ sources = [
"dart_isolate_unittests.cc",
"dart_lifecycle_unittests.cc",
"dart_service_isolate_unittests.cc",
"dart_vm_unittests.cc",
"runtime_test.cc", "runtime_test.cc",
"runtime_test.h", "runtime_test.h",
] ]
public_deps = [ public_deps = [
":libdart", ":libdart",
":runtime",
":runtime_fixtures", ":runtime_fixtures",
"//flutter/common", "//flutter/common",
"//flutter/fml", "//flutter/fml",
"//flutter/lib/snapshot", "//flutter/lib/snapshot",
"//flutter/shell/common",
"//flutter/testing", "//flutter/testing",
"//flutter/testing:dart",
"//flutter/third_party/tonic", "//flutter/third_party/tonic",
"//third_party/dart/runtime/bin:elf_loader", "//third_party/dart/runtime/bin:elf_loader",
"//third_party/skia", "//third_party/skia",
] ]
deps_legacy_and_next = [
":runtime",
"//flutter/testing:dart",
]
} }
executable("runtime_unittests") { if (is_fuchsia) {
testonly = true executable("runtime_unittests") {
testonly = true
configs += [ "//flutter:export_dynamic_symbols" ] configs += [ "//flutter:export_dynamic_symbols" ]
sources = [ deps = [
"dart_isolate_unittests.cc", ":runtime_unittests_common_fuchsia_legacy",
"dart_lifecycle_unittests.cc", ]
"dart_service_isolate_unittests.cc", }
"dart_vm_unittests.cc",
]
deps = [ executable("runtime_unittests_next") {
":runtime_unittests_common", testonly = true
]
configs += [ "//flutter:export_dynamic_symbols" ]
deps = [
":runtime_unittests_common",
]
}
} else {
executable("runtime_unittests") {
testonly = true
configs += [ "//flutter:export_dynamic_symbols" ]
deps = [
":runtime_unittests_common",
]
}
} }
if (is_fuchsia) { if (is_fuchsia) {
...@@ -170,4 +190,23 @@ if (is_fuchsia) { ...@@ -170,4 +190,23 @@ if (is_fuchsia) {
}, },
] ]
} }
fuchsia_test_archive("runtime_tests_next") {
deps = [
":runtime_fixtures",
":runtime_unittests_next",
]
binary = "runtime_unittests_next"
# TODO(gw280): https://github.com/flutter/flutter/issues/50294
# Right now we need to manually specify all the fixtures that are
# declared in the test_fixtures() call above.
resources = [
{
path = "$target_gen_dir/assets/kernel_blob.bin"
dest = "assets/kernel_blob.bin"
},
]
}
} }
...@@ -77,7 +77,7 @@ template("dart_embedder_resources") { ...@@ -77,7 +77,7 @@ template("dart_embedder_resources") {
} }
} }
source_set("common") { source_set_maybe_fuchsia_legacy("common") {
sources = [ sources = [
"animator.cc", "animator.cc",
"animator.h", "animator.h",
...@@ -115,29 +115,39 @@ source_set("common") { ...@@ -115,29 +115,39 @@ source_set("common") {
"vsync_waiter_fallback.h", "vsync_waiter_fallback.h",
] ]
public_configs = [ "//flutter:config" ]
public_deps = [
"//flutter/shell/version",
"//flutter/third_party/tonic",
"//flutter/third_party/txt",
"//third_party/rapidjson",
]
deps = [ deps = [
"//flutter/assets", "//flutter/assets",
"//flutter/common", "//flutter/common",
"//flutter/flow",
"//flutter/fml", "//flutter/fml",
"//flutter/lib/ui",
"//flutter/runtime",
"//flutter/shell/profiling", "//flutter/shell/profiling",
"//third_party/dart/runtime:dart_api", "//third_party/dart/runtime:dart_api",
"//third_party/skia", "//third_party/skia",
] ]
public_deps = [ deps_legacy_and_next = [
"//flutter/shell/version", "//flutter/flow:flow",
"//flutter/third_party/tonic", "//flutter/lib/ui:ui",
"//flutter/third_party/txt", "//flutter/runtime:runtime",
"//third_party/rapidjson",
] ]
public_configs = [ "//flutter:config" ]
} }
template("shell_host_executable") { template("shell_host_executable") {
common_dep = ":common"
if (defined(invoker.fuchsia_legacy)) {
if (invoker.fuchsia_legacy) {
common_dep += "_fuchsia_legacy"
}
}
executable(target_name) { executable(target_name) {
testonly = true testonly = true
...@@ -148,19 +158,34 @@ template("shell_host_executable") { ...@@ -148,19 +158,34 @@ template("shell_host_executable") {
forward_variables_from(invoker, "*") forward_variables_from(invoker, "*")
deps += [ deps += [
":common",
"//flutter/fml",
"//flutter/lib/snapshot", "//flutter/lib/snapshot",
"//flutter/runtime",
"//flutter/runtime:libdart", "//flutter/runtime:libdart",
"//flutter/third_party/tonic", common_dep,
"//third_party/skia",
] ]
public_configs = [ "//flutter:export_dynamic_symbols" ] public_configs = [ "//flutter:export_dynamic_symbols" ]
} }
} }
test_fixtures("shell_unittests_fixtures") {
dart_main = "fixtures/shell_test.dart"
fixtures = [ "fixtures/shelltest_screenshot.png" ]
}
shell_host_executable("shell_benchmarks") {
sources = [
"shell_benchmarks.cc",
]
deps = [
":shell_unittests_fixtures",
"//flutter/benchmarking",
"//flutter/testing:dart",
"//flutter/testing:testing_lib",
]
}
if (enable_unittests) { if (enable_unittests) {
declare_args() { declare_args() {
test_enable_vulkan = is_fuchsia test_enable_vulkan = is_fuchsia
...@@ -176,13 +201,7 @@ if (enable_unittests) { ...@@ -176,13 +201,7 @@ if (enable_unittests) {
enable_metal = test_enable_metal enable_metal = test_enable_metal
} }
test_fixtures("shell_unittests_fixtures") { source_set_maybe_fuchsia_legacy("shell_test_fixture_sources") {
dart_main = "fixtures/shell_test.dart"
fixtures = [ "fixtures/shelltest_screenshot.png" ]
}
source_set("shell_test_fixture_sources") {
testonly = true testonly = true
sources = [ sources = [
...@@ -197,15 +216,17 @@ if (enable_unittests) { ...@@ -197,15 +216,17 @@ if (enable_unittests) {
] ]
public_deps = [ public_deps = [
"//flutter/flow",
"//flutter/fml/dart", "//flutter/fml/dart",
"//flutter/lib/ui",
"//flutter/runtime",
"//flutter/shell",
"//flutter/shell/common",
"//flutter/testing", "//flutter/testing",
"//flutter/testing:dart",
] ]
deps = [
"//flutter/assets",
"//flutter/common",
"//third_party/rapidjson",
"//third_party/skia",
]
defines = [] defines = []
# SwiftShader only supports x86/x64_64 # SwiftShader only supports x86/x64_64
...@@ -216,10 +237,7 @@ if (enable_unittests) { ...@@ -216,10 +237,7 @@ if (enable_unittests) {
"shell_test_platform_view_gl.h", "shell_test_platform_view_gl.h",
] ]
public_deps += [ public_deps += [ "//flutter/testing:opengl" ]
"//flutter/shell/gpu:gpu_surface_gl",
"//flutter/testing:opengl",
]
defines += [ "SHELL_ENABLE_GL" ] defines += [ "SHELL_ENABLE_GL" ]
} }
...@@ -232,16 +250,29 @@ if (enable_unittests) { ...@@ -232,16 +250,29 @@ if (enable_unittests) {
] ]
public_deps += [ public_deps += [
"//flutter/shell/gpu:gpu_surface_vulkan",
"//flutter/testing:vulkan", "//flutter/testing:vulkan",
"//flutter/vulkan", "//flutter/vulkan",
] ]
defines += [ "SHELL_ENABLE_VULKAN" ] defines += [ "SHELL_ENABLE_VULKAN" ]
} }
public_deps_legacy_and_next = [
"//flutter/shell/common:common",
"//flutter/flow:flow",
"//flutter/runtime:runtime",
]
deps_legacy_and_next = [
":shell_unittests_gpu_configuration",
"//flutter/lib/ui:ui",
"//flutter/testing:dart",
]
} }
shell_host_executable("shell_unittests") { source_set_maybe_fuchsia_legacy("shell_unittests_common") {
testonly = true
sources = [ sources = [
"animator_unittests.cc", "animator_unittests.cc",
"canvas_spy_unittests.cc", "canvas_spy_unittests.cc",
...@@ -252,20 +283,35 @@ if (enable_unittests) { ...@@ -252,20 +283,35 @@ if (enable_unittests) {
] ]
deps = [ deps = [
":shell_test_fixture_sources",
":shell_unittests_fixtures",
":shell_unittests_gpu_configuration",
"//flutter/assets", "//flutter/assets",
"//flutter/common", "//flutter/shell/version",
"//flutter/shell",
] ]
if (!defined(defines)) { public_deps_legacy_and_next = [ ":shell_test_fixture_sources" ]
defines = [] }
if (is_fuchsia) {
shell_host_executable("shell_unittests") {
deps = [
":shell_unittests_common_fuchsia_legacy",
":shell_unittests_fixtures",
]
fuchsia_legacy = true
} }
if (test_enable_vulkan) { shell_host_executable("shell_unittests_next") {
defines += [ "SHELL_ENABLE_VULKAN" ] deps = [
":shell_unittests_common",
":shell_unittests_fixtures",
]
}
} else {
shell_host_executable("shell_unittests") {
deps = [
":shell_unittests_common",
":shell_unittests_fixtures",
]
} }
} }
...@@ -297,18 +343,33 @@ if (enable_unittests) { ...@@ -297,18 +343,33 @@ if (enable_unittests) {
resources += vulkan_icds resources += vulkan_icds
} }
} }
}
shell_host_executable("shell_benchmarks") { fuchsia_test_archive("shell_tests_next") {
sources = [ deps = [
"shell_benchmarks.cc", ":shell_unittests_fixtures",
] ":shell_unittests_next",
]
deps = [ binary = "shell_unittests_next"
":shell_unittests_fixtures",
"//flutter/benchmarking", # TODO(gw280): https://github.com/flutter/flutter/issues/50294
"//flutter/testing:dart", # Right now we need to manually specify all the fixtures that are
"//flutter/testing:testing_lib", # declared in the test_fixtures() call above.
] resources = [
{
path = "$target_gen_dir/assets/kernel_blob.bin"
dest = "assets/kernel_blob.bin"
},
{
path = "$target_gen_dir/assets/shelltest_screenshot.png"
dest = "assets/shelltest_screenshot.png"
},
]
if (test_enable_vulkan) {
libraries = vulkan_validation_libs
resources += vulkan_icds
}
}
} }
} }
...@@ -86,7 +86,7 @@ void Rasterizer::Setup(std::unique_ptr<Surface> surface) { ...@@ -86,7 +86,7 @@ void Rasterizer::Setup(std::unique_ptr<Surface> surface) {
raster_thread_merger_ = raster_thread_merger_ =
fml::MakeRefCounted<fml::RasterThreadMerger>(platform_id, gpu_id); fml::MakeRefCounted<fml::RasterThreadMerger>(platform_id, gpu_id);
} }
#endif // defined(OS_FUCHSIA) #endif
} }
void Rasterizer::Teardown() { void Rasterizer::Teardown() {
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "flutter/shell/version/version.h" #include "flutter/shell/version/version.h"
#include "flutter/testing/testing.h" #include "flutter/testing/testing.h"
#include "rapidjson/writer.h" #include "rapidjson/writer.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "third_party/tonic/converter/dart_converter.h" #include "third_party/tonic/converter/dart_converter.h"
namespace flutter { namespace flutter {
...@@ -517,7 +518,7 @@ TEST_F(ShellTest, ...@@ -517,7 +518,7 @@ TEST_F(ShellTest,
DestroyShell(std::move(shell)); DestroyShell(std::move(shell));
} }
#endif // defined(OS_FUCHSIA) #endif
TEST(SettingsTest, FrameTimingSetsAndGetsProperly) { TEST(SettingsTest, FrameTimingSetsAndGetsProperly) {
// Ensure that all phases are in kPhases. // Ensure that all phases are in kPhases.
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
# found in the LICENSE file. # found in the LICENSE file.
declare_args() { declare_args() {
shell_enable_vulkan = false shell_enable_gl = !is_fuchsia
shell_enable_metal = false shell_enable_metal = false
shell_enable_vulkan = false
stripped_symbols = true stripped_symbols = true
} }
...@@ -2,19 +2,23 @@ ...@@ -2,19 +2,23 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//flutter/common/config.gni")
import("//flutter/shell/config.gni") import("//flutter/shell/config.gni")
gpu_dir = "//flutter/shell/gpu" gpu_dir = "//flutter/shell/gpu"
gpu_common_deps = [ gpu_common_deps = [
"//flutter/common", "//flutter/common",
"//flutter/flow",
"//flutter/fml", "//flutter/fml",
"//flutter/shell/common",
"//third_party/skia", "//third_party/skia",
] ]
source_set("gpu_surface_software") { gpu_common_deps_legacy_and_next = [
"//flutter/flow:flow",
"//flutter/shell/common:common",
]
source_set_maybe_fuchsia_legacy("gpu_surface_software") {
sources = [ sources = [
"$gpu_dir/gpu_surface_delegate.h", "$gpu_dir/gpu_surface_delegate.h",
"$gpu_dir/gpu_surface_software.cc", "$gpu_dir/gpu_surface_software.cc",
...@@ -24,9 +28,11 @@ source_set("gpu_surface_software") { ...@@ -24,9 +28,11 @@ source_set("gpu_surface_software") {
] ]
deps = gpu_common_deps deps = gpu_common_deps
deps_legacy_and_next = gpu_common_deps_legacy_and_next
} }
source_set("gpu_surface_gl") { source_set_maybe_fuchsia_legacy("gpu_surface_gl") {
sources = [ sources = [
"$gpu_dir/gpu_surface_delegate.h", "$gpu_dir/gpu_surface_delegate.h",
"$gpu_dir/gpu_surface_gl.cc", "$gpu_dir/gpu_surface_gl.cc",
...@@ -35,10 +41,12 @@ source_set("gpu_surface_gl") { ...@@ -35,10 +41,12 @@ source_set("gpu_surface_gl") {
"$gpu_dir/gpu_surface_gl_delegate.h", "$gpu_dir/gpu_surface_gl_delegate.h",
] ]
deps = gpu_common_deps + [ "//third_party/skia" ] deps = gpu_common_deps
deps_legacy_and_next = gpu_common_deps_legacy_and_next
} }
source_set("gpu_surface_vulkan") { source_set_maybe_fuchsia_legacy("gpu_surface_vulkan") {
sources = [ sources = [
"$gpu_dir/gpu_surface_delegate.h", "$gpu_dir/gpu_surface_delegate.h",
"$gpu_dir/gpu_surface_vulkan.cc", "$gpu_dir/gpu_surface_vulkan.cc",
...@@ -47,18 +55,19 @@ source_set("gpu_surface_vulkan") { ...@@ -47,18 +55,19 @@ source_set("gpu_surface_vulkan") {
"$gpu_dir/gpu_surface_vulkan_delegate.h", "$gpu_dir/gpu_surface_vulkan_delegate.h",
] ]
deps = gpu_common_deps + [ deps = gpu_common_deps + [ "//flutter/vulkan" ]
"//third_party/skia",
"//flutter/vulkan", deps_legacy_and_next = gpu_common_deps_legacy_and_next
]
} }
source_set("gpu_surface_metal") { source_set_maybe_fuchsia_legacy("gpu_surface_metal") {
sources = [ sources = [
"$gpu_dir/gpu_surface_delegate.h", "$gpu_dir/gpu_surface_delegate.h",
"$gpu_dir/gpu_surface_metal.h", "$gpu_dir/gpu_surface_metal.h",
"$gpu_dir/gpu_surface_metal.mm", "$gpu_dir/gpu_surface_metal.mm",
] ]
deps = gpu_common_deps + [ "//third_party/skia" ] deps = gpu_common_deps
deps_legacy_and_next = gpu_common_deps_legacy_and_next
} }
...@@ -33,4 +33,30 @@ template("shell_gpu_configuration") { ...@@ -33,4 +33,30 @@ template("shell_gpu_configuration") {
public_deps += [ "//flutter/shell/gpu:gpu_surface_metal" ] public_deps += [ "//flutter/shell/gpu:gpu_surface_metal" ]
} }
} }
if (is_fuchsia) {
legagcy_suffix = "_fuchsia_legacy"
group(target_name + legagcy_suffix) {
public_deps = []
if (invoker.enable_software) {
public_deps +=
[ "//flutter/shell/gpu:gpu_surface_software" + legagcy_suffix ]
}
if (invoker.enable_gl) {
public_deps += [ "//flutter/shell/gpu:gpu_surface_gl" + legagcy_suffix ]
}
if (invoker.enable_vulkan) {
public_deps +=
[ "//flutter/shell/gpu:gpu_surface_vulkan" + legagcy_suffix ]
}
if (invoker.enable_metal) {
public_deps +=
[ "//flutter/shell/gpu:gpu_surface_metal" + legagcy_suffix ]
}
}
}
} }
...@@ -41,6 +41,7 @@ executable("android_external_view_embedder_unittests") { ...@@ -41,6 +41,7 @@ executable("android_external_view_embedder_unittests") {
deps = [ deps = [
":external_view_embedder", ":external_view_embedder",
":external_view_embedder_fixtures", ":external_view_embedder_fixtures",
"//flutter/flow",
"//flutter/shell/gpu:gpu_surface_gl", "//flutter/shell/gpu:gpu_surface_gl",
"//flutter/shell/platform/android/jni:jni_mock", "//flutter/shell/platform/android/jni:jni_mock",
"//flutter/shell/platform/android/surface:surface_mock", "//flutter/shell/platform/android/surface:surface_mock",
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_EXTERNAL_VIEW_EMBEDDER_H_ #ifndef FLUTTER_SHELL_PLATFORM_ANDROID_EXTERNAL_VIEW_EMBEDDER_H_
#define FLUTTER_SHELL_PLATFORM_ANDROID_EXTERNAL_VIEW_EMBEDDER_H_ #define FLUTTER_SHELL_PLATFORM_ANDROID_EXTERNAL_VIEW_EMBEDDER_H_
#include <unordered_map>
#include "flutter/flow/embedded_views.h" #include "flutter/flow/embedded_views.h"
#include "flutter/flow/rtree.h" #include "flutter/flow/rtree.h"
#include "flutter/shell/platform/android/context/android_context.h" #include "flutter/shell/platform/android/context/android_context.h"
......
...@@ -14,10 +14,11 @@ import("//flutter/tools/fuchsia/fuchsia_libs.gni") ...@@ -14,10 +14,11 @@ import("//flutter/tools/fuchsia/fuchsia_libs.gni")
import("//flutter/vulkan/config.gni") import("//flutter/vulkan/config.gni")
import("engine_flutter_runner.gni") import("engine_flutter_runner.gni")
shell_gpu_configuration("fuchsia_gpu_configuration") { # Fuchsia uses its own custom Surface implementation.
shell_gpu_configuration("fuchsia_legacy_gpu_configuration") {
enable_software = false enable_software = false
enable_gl = false enable_gl = false
enable_vulkan = true enable_vulkan = false
enable_metal = false enable_metal = false
} }
...@@ -319,10 +320,10 @@ executable("flutter_runner_unittests") { ...@@ -319,10 +320,10 @@ executable("flutter_runner_unittests") {
"//build/fuchsia/pkg:scenic_cpp", "//build/fuchsia/pkg:scenic_cpp",
"//build/fuchsia/pkg:sys_cpp_testing", "//build/fuchsia/pkg:sys_cpp_testing",
"//flutter/common", "//flutter/common",
"//flutter/flow", "//flutter/flow:flow_fuchsia_legacy",
"//flutter/lib/ui", "//flutter/lib/ui:ui_fuchsia_legacy",
"//flutter/runtime", "//flutter/runtime:runtime_fuchsia_legacy",
"//flutter/shell/common", "//flutter/shell/common:common_fuchsia_legacy",
"//flutter/shell/platform/fuchsia/runtime/dart/utils", "//flutter/shell/platform/fuchsia/runtime/dart/utils",
"//flutter/testing", "//flutter/testing",
"//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime:libdart_jit",
...@@ -352,9 +353,10 @@ executable("flutter_runner_tzdata_unittests") { ...@@ -352,9 +353,10 @@ executable("flutter_runner_tzdata_unittests") {
"//build/fuchsia/pkg:async-loop-default", "//build/fuchsia/pkg:async-loop-default",
"//build/fuchsia/pkg:scenic_cpp", "//build/fuchsia/pkg:scenic_cpp",
"//build/fuchsia/pkg:sys_cpp_testing", "//build/fuchsia/pkg:sys_cpp_testing",
"//flutter/lib/ui", "//flutter/flow:flow_fuchsia_legacy",
"//flutter/runtime", "//flutter/lib/ui:ui_fuchsia_legacy",
"//flutter/shell/common", "//flutter/runtime:runtime_fuchsia_legacy",
"//flutter/shell/common:common_fuchsia_legacy",
"//flutter/shell/platform/fuchsia/runtime/dart/utils", "//flutter/shell/platform/fuchsia/runtime/dart/utils",
"//flutter/testing", "//flutter/testing",
"//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime:libdart_jit",
...@@ -497,16 +499,16 @@ executable("flutter_runner_scenic_unittests") { ...@@ -497,16 +499,16 @@ executable("flutter_runner_scenic_unittests") {
"//build/fuchsia/pkg:async-loop-default", "//build/fuchsia/pkg:async-loop-default",
"//build/fuchsia/pkg:scenic_cpp", "//build/fuchsia/pkg:scenic_cpp",
"//build/fuchsia/pkg:sys_cpp_testing", "//build/fuchsia/pkg:sys_cpp_testing",
"//flutter/common:common", "//flutter/common",
"//flutter/flow:flow", "//flutter/flow:flow_fuchsia_legacy",
"//flutter/lib/ui", "//flutter/lib/ui:ui_fuchsia_legacy",
"//flutter/runtime", "//flutter/runtime:runtime_fuchsia_legacy",
"//flutter/shell/common", "//flutter/shell/common:common_fuchsia_legacy",
"//flutter/shell/platform/fuchsia/dart-pkg/fuchsia:sdk_ext", "//flutter/shell/platform/fuchsia/dart-pkg/fuchsia",
"//flutter/shell/platform/fuchsia/dart-pkg/zircon:zircon", "//flutter/shell/platform/fuchsia/dart-pkg/zircon",
"//flutter/shell/platform/fuchsia/runtime/dart/utils", "//flutter/shell/platform/fuchsia/runtime/dart/utils",
"//flutter/testing", "//flutter/testing",
"//flutter/vulkan:vulkan", "//flutter/vulkan",
"//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime:libdart_jit",
"//third_party/dart/runtime/platform:libdart_platform_jit", "//third_party/dart/runtime/platform:libdart_platform_jit",
"//third_party/icu", "//third_party/icu",
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <sstream> #include <sstream>
#include "compositor_context.h"
#include "flutter/common/task_runners.h" #include "flutter/common/task_runners.h"
#include "flutter/fml/make_copyable.h" #include "flutter/fml/make_copyable.h"
#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/synchronization/waitable_event.h"
......
...@@ -90,16 +90,15 @@ template("flutter_runner") { ...@@ -90,16 +90,15 @@ template("flutter_runner") {
# The use of these dependencies is temporary and will be moved behind the # The use of these dependencies is temporary and will be moved behind the
# embedder API. # embedder API.
flutter_deps = [ flutter_deps = [
"../flutter:fuchsia_gpu_configuration", "../flutter:fuchsia_legacy_gpu_configuration",
"//flutter/assets", "//flutter/assets",
"//flutter/common", "//flutter/common",
"//flutter/flow",
"//flutter/lib/ui",
"//flutter/runtime",
"//flutter/third_party/txt",
"//flutter/vulkan",
"//flutter/fml", "//flutter/fml",
"//flutter/shell/common", "//flutter/flow:flow_fuchsia_legacy",
"//flutter/lib/ui:ui_fuchsia_legacy",
"//flutter/runtime:runtime_fuchsia_legacy",
"//flutter/shell/common:common_fuchsia_legacy",
"//flutter/vulkan",
] ]
_fuchsia_platform = "//flutter/shell/platform/fuchsia" _fuchsia_platform = "//flutter/shell/platform/fuchsia"
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <lib/fdio/watcher.h> #include <lib/fdio/watcher.h>
#include <lib/zx/time.h>
#include <unistd.h> #include <unistd.h>
#include "flutter/fml/unique_fd.h" #include "flutter/fml/unique_fd.h"
...@@ -57,7 +58,8 @@ bool Surface::CanConnectToDisplay() { ...@@ -57,7 +58,8 @@ bool Surface::CanConnectToDisplay() {
} }
zx_status_t status = fdio_watch_directory( zx_status_t status = fdio_watch_directory(
fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(5)), nullptr); fd.get(), DriverWatcher,
zx::deadline_after(zx::duration(ZX_SEC(5))).get(), nullptr);
return status == ZX_ERR_STOP; return status == ZX_ERR_STOP;
} }
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#pragma once #pragma once
#include "compositor_context.h"
#include "flutter/flow/surface.h" #include "flutter/flow/surface.h"
#include "flutter/fml/macros.h" #include "flutter/fml/macros.h"
#include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/memory/weak_ptr.h"
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//flutter/common/config.gni")
import("//flutter/shell/config.gni") import("//flutter/shell/config.gni")
import("testing.gni") import("testing.gni")
...@@ -40,7 +41,7 @@ source_set("testing") { ...@@ -40,7 +41,7 @@ source_set("testing") {
] ]
} }
source_set("dart") { source_set_maybe_fuchsia_legacy("dart") {
testonly = true testonly = true
sources = [ sources = [
...@@ -55,12 +56,13 @@ source_set("dart") { ...@@ -55,12 +56,13 @@ source_set("dart") {
public_deps = [ public_deps = [
":testing_lib", ":testing_lib",
"//flutter/common", "//flutter/common",
"//flutter/runtime",
"//flutter/runtime:libdart", "//flutter/runtime:libdart",
"//flutter/third_party/tonic", "//flutter/third_party/tonic",
"//third_party/dart/runtime/bin:elf_loader", "//third_party/dart/runtime/bin:elf_loader",
"//third_party/skia", "//third_party/skia",
] ]
public_deps_legacy_and_next = [ "//flutter/runtime:runtime" ]
} }
source_set("skia") { source_set("skia") {
...@@ -72,13 +74,10 @@ source_set("skia") { ...@@ -72,13 +74,10 @@ source_set("skia") {
"canvas_test.h", "canvas_test.h",
"mock_canvas.cc", "mock_canvas.cc",
"mock_canvas.h", "mock_canvas.h",
"mock_raster_cache.cc",
"mock_raster_cache.h",
] ]
public_deps = [ public_deps = [
":testing_lib", ":testing_lib",
"//flutter/flow",
"//third_party/skia", "//third_party/skia",
] ]
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册