From 336c23f846a2683d043d3a3b504ae27eaf447efc Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 25 Jul 2018 13:20:48 -0700 Subject: [PATCH] Remove //flutter/glue and use FML directly. (#5862) --- assets/BUILD.gn | 1 - assets/asset_manager.cc | 2 +- assets/zip_asset_store.cc | 2 +- flow/BUILD.gn | 1 - flow/layers/layer.h | 2 +- flow/layers/layer_tree.cc | 2 +- flow/raster_cache.cc | 2 +- flow/scene_update_context.cc | 4 +-- fml/trace_event.h | 18 +++++++++++ glue/BUILD.gn | 30 ------------------- glue/README.md | 5 ---- glue/stack_trace.h | 14 --------- glue/stack_trace_base.cc | 11 ------- glue/stack_trace_fuchsia.cc | 11 ------- glue/trace_event.h | 26 ---------------- lib/ui/BUILD.gn | 9 +++--- lib/ui/compositing/scene.cc | 2 +- lib/ui/painting/codec.cc | 2 +- lib/ui/painting/image_encoding.cc | 2 +- runtime/BUILD.gn | 4 +-- runtime/runtime_controller.cc | 2 +- shell/common/BUILD.gn | 1 - shell/common/animator.cc | 2 +- shell/common/engine.cc | 2 +- shell/common/shell.cc | 2 +- shell/gpu/gpu.gni | 1 - shell/gpu/gpu_surface_gl.cc | 2 +- shell/platform/darwin/ios/BUILD.gn | 1 - .../ios/framework/Source/vsync_waiter_ios.mm | 2 +- synchronization/BUILD.gn | 2 +- synchronization/pipeline.h | 2 +- travis/licenses_golden/licenses_flutter | 4 --- 32 files changed, 42 insertions(+), 131 deletions(-) delete mode 100644 glue/BUILD.gn delete mode 100644 glue/README.md delete mode 100644 glue/stack_trace.h delete mode 100644 glue/stack_trace_base.cc delete mode 100644 glue/stack_trace_fuchsia.cc delete mode 100644 glue/trace_event.h diff --git a/assets/BUILD.gn b/assets/BUILD.gn index 580ecfb6ea41b..febd1eda76f6c 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -16,7 +16,6 @@ source_set("assets") { deps = [ "$flutter_root/common", "$flutter_root/fml", - "$flutter_root/glue", "//garnet/public/lib/fxl", ] diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc index fce313d01c164..2155d24a78a26 100644 --- a/assets/asset_manager.cc +++ b/assets/asset_manager.cc @@ -5,7 +5,7 @@ #include "flutter/assets/asset_manager.h" #include "flutter/assets/directory_asset_bundle.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #ifdef ERROR #undef ERROR diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index 6f1ecd65af4d6..79f0cd16eca99 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -14,7 +14,7 @@ #include #include -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" namespace blink { diff --git a/flow/BUILD.gn b/flow/BUILD.gn index ab5b41653970a..a63dfad95ddfc 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -67,7 +67,6 @@ source_set("flow") { deps = [ "$flutter_root/common", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/synchronization", "//third_party/skia", "//third_party/skia:gpu", diff --git a/flow/layers/layer.h b/flow/layers/layer.h index 06ea2b2e6733a..d1a4f0ba13905 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -11,7 +11,7 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" #include "lib/fxl/macros.h" diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index d5bacbd865c37..8f6f7494ae2fa 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -5,7 +5,7 @@ #include "flutter/flow/layers/layer_tree.h" #include "flutter/flow/layers/layer.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "third_party/skia/include/core/SkPictureRecorder.h" namespace flow { diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 0922cdcec37a0..33d5a99d2c6d5 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -7,7 +7,7 @@ #include #include "flutter/flow/paint_utils.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColorSpaceXformCanvas.h" diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index dc72f28deef44..c4cb57e59afea 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -7,7 +7,7 @@ #include "flutter/flow/export_node.h" #include "flutter/flow/layers/layer.h" #include "flutter/flow/matrix_decomposition.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" namespace flow { @@ -94,7 +94,7 @@ void SceneUpdateContext::CreateFrame(scenic::EntityNode& entity_node, SetShapeColor(shape_node, color); scenic::Rectangle inner_shape(session_, inner_bounds.width(), - inner_bounds.height()); + inner_bounds.height()); scenic::ShapeNode inner_node(session_); inner_node.SetShape(inner_shape); inner_node.SetTranslation(inner_bounds.width() * 0.5f + inner_bounds.left(), diff --git a/fml/trace_event.h b/fml/trace_event.h index 775dea4e6b75e..a3996c1738839 100644 --- a/fml/trace_event.h +++ b/fml/trace_event.h @@ -5,6 +5,22 @@ #ifndef FLUTTER_FML_TRACE_EVENT_H_ #define FLUTTER_FML_TRACE_EVENT_H_ +#if defined(__Fuchsia__) + +// Forward to the system tracing mechanism on Fuchsia. + +#include + +#define TRACE_EVENT0(a, b) TRACE_DURATION(a, b) +#define TRACE_EVENT1(a, b, c, d) TRACE_DURATION(a, b, c, d) +#define TRACE_EVENT2(a, b, c, d, e, f) TRACE_DURATION(a, b, c, d, e, f) +#define TRACE_EVENT_ASYNC_BEGIN0(a, b, c) TRACE_ASYNC_BEGIN(a, b, c) +#define TRACE_EVENT_ASYNC_END0(a, b, c) TRACE_ASYNC_END(a, b, c) +#define TRACE_EVENT_ASYNC_BEGIN1(a, b, c, d, e) TRACE_ASYNC_BEGIN(a, b, c, d, e) +#define TRACE_EVENT_ASYNC_END1(a, b, c, d, e) TRACE_ASYNC_END(a, b, c, d, e) + +#else // defined(__Fuchsia__) + #include #include #include @@ -121,4 +137,6 @@ class ScopedInstantEnd { } // namespace tracing } // namespace fml +#endif // defined(__Fuchsia__) + #endif // FLUTTER_FML_TRACE_EVENT_H_ diff --git a/glue/BUILD.gn b/glue/BUILD.gn deleted file mode 100644 index 4112bf29205d3..0000000000000 --- a/glue/BUILD.gn +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -source_set("glue") { - sources = [ - "stack_trace.h", - "trace_event.h", - ] - - deps = [ - "//garnet/public/lib/fxl", - ] - - public_configs = [ - "$flutter_root:config", - ] - - if (is_fuchsia) { - sources += [ "stack_trace_fuchsia.cc" ] - - public_deps = [ - "//zircon/public/lib/trace", - ] - } else { - sources += [ "stack_trace_base.cc" ] - - deps += [ "$flutter_root/fml" ] - } -} diff --git a/glue/README.md b/glue/README.md deleted file mode 100644 index 965351d87403e..0000000000000 --- a/glue/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Glue - -This library provides glue between Flutter and //base, which lets us isolate our -dependency on //base. Eventually, we'll drive the contents of this library to -zero and remove our dependency on //base. diff --git a/glue/stack_trace.h b/glue/stack_trace.h deleted file mode 100644 index 63a091672b83a..0000000000000 --- a/glue/stack_trace.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef FLUTTER_GLU_STACK_TRACE_H_ -#define FLUTTER_GLU_STACK_TRACE_H_ - -namespace glue { - -void PrintStackTrace(); - -} // namespace glue - -#endif // FLUTTER_GLU_STACK_TRACE_H_ diff --git a/glue/stack_trace_base.cc b/glue/stack_trace_base.cc deleted file mode 100644 index abd82c661d28c..0000000000000 --- a/glue/stack_trace_base.cc +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "flutter/glue/stack_trace.h" - -namespace glue { - -void PrintStackTrace() {} - -} // namespace glue diff --git a/glue/stack_trace_fuchsia.cc b/glue/stack_trace_fuchsia.cc deleted file mode 100644 index abd82c661d28c..0000000000000 --- a/glue/stack_trace_fuchsia.cc +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "flutter/glue/stack_trace.h" - -namespace glue { - -void PrintStackTrace() {} - -} // namespace glue diff --git a/glue/trace_event.h b/glue/trace_event.h deleted file mode 100644 index b2df9327e38ef..0000000000000 --- a/glue/trace_event.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef FLUTTER_GLUE_TRACE_EVENT_H_ -#define FLUTTER_GLUE_TRACE_EVENT_H_ - -#if defined(__Fuchsia__) - -#include - -#define TRACE_EVENT0(a, b) TRACE_DURATION(a, b) -#define TRACE_EVENT1(a, b, c, d) TRACE_DURATION(a, b, c, d) -#define TRACE_EVENT2(a, b, c, d, e, f) TRACE_DURATION(a, b, c, d, e, f) -#define TRACE_EVENT_ASYNC_BEGIN0(a, b, c) TRACE_ASYNC_BEGIN(a, b, c) -#define TRACE_EVENT_ASYNC_END0(a, b, c) TRACE_ASYNC_END(a, b, c) -#define TRACE_EVENT_ASYNC_BEGIN1(a, b, c, d, e) TRACE_ASYNC_BEGIN(a, b, c, d, e) -#define TRACE_EVENT_ASYNC_END1(a, b, c, d, e) TRACE_ASYNC_END(a, b, c, d, e) - -#else // defined(__Fuchsia__) - -#include "flutter/fml/trace_event.h" // nogncheck - -#endif // defined(__Fuchsia__) - -#endif // FLUTTER_GLUE_TRACE_EVENT_H_ diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 81d0720a18aa0..3135bda390aea 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -55,14 +55,14 @@ source_set("ui") { "painting/vertices.h", "plugins/callback_cache.cc", "plugins/callback_cache.h", + "semantics/custom_accessibility_action.cc", + "semantics/custom_accessibility_action.h", "semantics/semantics_node.cc", "semantics/semantics_node.h", "semantics/semantics_update.cc", "semantics/semantics_update.h", "semantics/semantics_update_builder.cc", "semantics/semantics_update_builder.h", - "semantics/custom_accessibility_action.cc", - "semantics/custom_accessibility_action.h", "text/asset_manager_font_provider.cc", "text/asset_manager_font_provider.h", "text/font_collection.cc", @@ -101,7 +101,6 @@ source_set("ui") { "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/runtime:test_font", "//garnet/public/lib/fxl", "//third_party/dart/runtime/bin:embedded_dart_io", @@ -115,5 +114,7 @@ source_set("ui") { deps += [ "//topaz/public/dart-pkg/zircon" ] } - public_deps = ["$flutter_root/third_party/txt"] + public_deps = [ + "$flutter_root/third_party/txt", + ] } diff --git a/lib/ui/compositing/scene.cc b/lib/ui/compositing/scene.cc index 34970914f84a7..34ca9060d88d9 100644 --- a/lib/ui/compositing/scene.cc +++ b/lib/ui/compositing/scene.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/compositing/scene.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/lib/ui/painting/image.h" #include "lib/fxl/functional/make_copyable.h" #include "third_party/skia/include/core/SkImageInfo.h" diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index 4af9a99840648..05de814f1fc0a 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/painting/codec.h" #include "flutter/common/task_runners.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/lib/ui/painting/frame_info.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/fxl/logging.h" diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index e403be9510c21..987da761a51de 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -8,7 +8,7 @@ #include #include "flutter/common/task_runners.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/lib/ui/painting/image.h" #include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index fd649a3448f00..a1c861e58fa9f 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -90,7 +90,6 @@ source_set("runtime") { "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/lib/io", "$flutter_root/lib/ui", "$flutter_root/third_party/txt", @@ -105,8 +104,7 @@ source_set("runtime") { public_configs = [ "$flutter_root:config" ] if (flutter_runtime_mode != "release" && - flutter_runtime_mode != "dynamic_release" && - !is_fuchsia) { + flutter_runtime_mode != "dynamic_release" && !is_fuchsia) { # Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia # instead puts Observatory into the runner's package. deps += [ "//third_party/dart/runtime/observatory:embedded_observatory_archive" ] diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 22b84579800b9..c53375371b5f7 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -5,7 +5,7 @@ #include "flutter/runtime/runtime_controller.h" #include "flutter/fml/message_loop.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 6748ecde87e6d..b0a09cf467d49 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -96,7 +96,6 @@ source_set("common") { "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/synchronization", diff --git a/shell/common/animator.cc b/shell/common/animator.cc index 60177a18f89ab..fe941eba80c06 100644 --- a/shell/common/animator.cc +++ b/shell/common/animator.cc @@ -4,7 +4,7 @@ #include "flutter/shell/common/animator.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/time/stopwatch.h" #include "third_party/dart/runtime/include/dart_tools_api.h" diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 790fb70a13b0e..d65ab82b8c7ce 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -8,7 +8,7 @@ #include #include "flutter/common/settings.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/lib/snapshot/snapshot.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/shell/common/animator.h" diff --git a/shell/common/shell.cc b/shell/common/shell.cc index ec39d96ab7308..71c066c6967db 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -16,7 +16,7 @@ #include "flutter/fml/log_settings.h" #include "flutter/fml/logging.h" #include "flutter/fml/message_loop.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/runtime/dart_vm.h" #include "flutter/runtime/start_up.h" #include "flutter/shell/common/engine.h" diff --git a/shell/gpu/gpu.gni b/shell/gpu/gpu.gni index 7ec2553c368a8..502e362e13767 100644 --- a/shell/gpu/gpu.gni +++ b/shell/gpu/gpu.gni @@ -46,7 +46,6 @@ template("shell_gpu_configuration") { "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/shell/common", "$flutter_root/synchronization", "//garnet/public/lib/fxl", diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 1d61effb0a85b..7e24bf37ecd73 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -4,7 +4,7 @@ #include "gpu_surface_gl.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/arraysize.h" #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkColorFilter.h" diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 8e0fb443f5f27..89c593f34ee1e 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -99,7 +99,6 @@ shared_library("create_flutter_framework_dylib") { "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/shell/common", diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm index 4589368acd3fb..94fecda2532f8 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm @@ -11,7 +11,7 @@ #include #include "flutter/common/task_runners.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/logging.h" @interface VSyncClient : NSObject diff --git a/synchronization/BUILD.gn b/synchronization/BUILD.gn index 9ee7680cc1160..72d4a45e7cdd6 100644 --- a/synchronization/BUILD.gn +++ b/synchronization/BUILD.gn @@ -13,7 +13,7 @@ source_set("synchronization") { public_configs = [ "$flutter_root:config" ] public_deps = [ - "$flutter_root/glue", + "$flutter_root/fml", "//garnet/public/lib/fxl", ] } diff --git a/synchronization/pipeline.h b/synchronization/pipeline.h index 23bf0abecd6db..db86fac256f9d 100644 --- a/synchronization/pipeline.h +++ b/synchronization/pipeline.h @@ -5,7 +5,7 @@ #ifndef SYNCHRONIZATION_PIPELINE_H_ #define SYNCHRONIZATION_PIPELINE_H_ -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/synchronization/pipeline.h" #include "flutter/synchronization/semaphore.h" #include "lib/fxl/functional/closure.h" diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index a6564cf81cd7b..d3103a58e4356 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -332,10 +332,6 @@ FILE: ../../../flutter/flow/raster_cache.cc FILE: ../../../flutter/flow/raster_cache.h FILE: ../../../flutter/flow/scene_update_context.cc FILE: ../../../flutter/flow/scene_update_context.h -FILE: ../../../flutter/glue/stack_trace.h -FILE: ../../../flutter/glue/stack_trace_base.cc -FILE: ../../../flutter/glue/stack_trace_fuchsia.cc -FILE: ../../../flutter/glue/trace_event.h FILE: ../../../flutter/lib/ui/painting/image_filter.cc FILE: ../../../flutter/lib/ui/painting/image_filter.h FILE: ../../../flutter/lib/ui/semantics.dart