From 9f8285ac6c18eeb64492628254ce154a7cb0a6d2 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 26 Jul 2018 12:49:34 -0700 Subject: [PATCH] Remove all dependencies on Garnet. (#5869) --- BUILD.gn | 1 - DEPS | 3 - common/BUILD.gn | 1 - common/settings.h | 8 +- common/task_runners.cc | 16 +- common/task_runners.h | 29 +- flow/BUILD.gn | 4 - flow/compositor_context.h | 6 +- flow/debug_print.h | 2 +- flow/export_node.cc | 24 +- flow/export_node.h | 24 +- flow/instrumentation.cc | 19 +- flow/instrumentation.h | 24 +- flow/layers/backdrop_filter_layer.cc | 2 +- flow/layers/backdrop_filter_layer.h | 2 +- flow/layers/child_scene_layer.cc | 2 +- flow/layers/child_scene_layer.h | 6 +- flow/layers/clip_path_layer.cc | 4 +- flow/layers/clip_path_layer.h | 2 +- flow/layers/clip_rect_layer.cc | 4 +- flow/layers/clip_rect_layer.h | 2 +- flow/layers/clip_rrect_layer.cc | 4 +- flow/layers/clip_rrect_layer.h | 2 +- flow/layers/color_filter_layer.cc | 2 +- flow/layers/color_filter_layer.h | 2 +- flow/layers/container_layer.cc | 4 +- flow/layers/container_layer.h | 2 +- flow/layers/default_layer_builder.cc | 6 +- flow/layers/default_layer_builder.h | 6 +- flow/layers/layer.h | 8 +- flow/layers/layer_builder.h | 6 +- flow/layers/layer_tree.h | 12 +- flow/layers/opacity_layer.cc | 2 +- flow/layers/opacity_layer.h | 2 +- flow/layers/performance_overlay_layer.h | 4 +- flow/layers/physical_shape_layer.cc | 4 +- flow/layers/picture_layer.cc | 6 +- flow/layers/picture_layer.h | 2 +- flow/layers/shader_mask_layer.cc | 2 +- flow/layers/shader_mask_layer.h | 2 +- flow/layers/texture_layer.h | 2 +- flow/layers/transform_layer.cc | 4 +- flow/layers/transform_layer.h | 2 +- flow/matrix_decomposition.h | 4 +- flow/matrix_decomposition_unittests.cc | 2 +- flow/raster_cache.cc | 4 +- flow/raster_cache.h | 8 +- flow/raster_cache_key.h | 6 +- flow/scene_update_context.cc | 12 +- flow/scene_update_context.h | 18 +- flow/skia_gpu_object.cc | 6 +- flow/skia_gpu_object.h | 28 +- flow/texture.h | 6 +- fml/BUILD.gn | 11 +- fml/arraysize.h | 16 + fml/command_line.cc | 165 +++++++ fml/command_line.h | 242 ++++++++++ fml/command_line_unittest.cc | 447 ++++++++++++++++++ fml/file.h | 3 + fml/make_copyable.h | 63 +++ fml/memory/ref_counted.h | 4 +- fml/memory/thread_checker.h | 4 +- fml/message_loop.cc | 12 +- fml/message_loop.h | 12 +- fml/message_loop_impl.cc | 24 +- fml/message_loop_impl.h | 28 +- fml/message_loop_unittests.cc | 28 +- fml/native_library.h | 17 +- fml/paths.h | 7 + fml/platform/android/message_loop_android.cc | 2 +- fml/platform/android/message_loop_android.h | 7 +- fml/platform/darwin/message_loop_darwin.h | 6 +- fml/platform/darwin/message_loop_darwin.mm | 4 +- fml/platform/darwin/paths_darwin.mm | 4 +- fml/platform/linux/message_loop_linux.cc | 4 +- fml/platform/linux/message_loop_linux.h | 6 +- fml/platform/linux/paths_linux.cc | 2 +- fml/platform/linux/timerfd.cc | 2 +- fml/platform/linux/timerfd.h | 4 +- fml/platform/posix/file_posix.cc | 7 + fml/platform/posix/native_library_posix.cc | 18 +- fml/platform/posix/paths_posix.cc | 48 ++ fml/platform/win/file_win.cc | 15 + fml/platform/win/message_loop_win.cc | 6 +- fml/platform/win/message_loop_win.h | 10 +- fml/platform/win/native_library_win.cc | 12 +- fml/platform/win/paths_win.cc | 57 ++- fml/string_view.cc | 212 +++++++++ fml/string_view.h | 167 +++++++ fml/string_view_unittest.cc | 418 ++++++++++++++++ fml/task_runner.cc | 18 +- fml/task_runner.h | 30 +- fml/thread.cc | 6 +- fml/thread.h | 4 +- lib/io/BUILD.gn | 9 +- lib/io/dart_io.h | 4 +- lib/ui/BUILD.gn | 1 - lib/ui/compositing/scene.cc | 10 +- lib/ui/compositing/scene.h | 4 +- lib/ui/compositing/scene_builder.cc | 6 +- lib/ui/compositing/scene_builder.h | 8 +- lib/ui/compositing/scene_host.cc | 14 +- lib/ui/compositing/scene_host.h | 14 +- lib/ui/dart_runtime_hooks.cc | 4 +- lib/ui/dart_runtime_hooks.h | 4 +- lib/ui/dart_ui.cc | 4 +- lib/ui/dart_ui.h | 4 +- lib/ui/dart_wrapper.h | 8 +- .../isolate_name_server/isolate_name_server.h | 4 +- lib/ui/painting/canvas.cc | 6 +- lib/ui/painting/canvas.h | 4 +- lib/ui/painting/codec.cc | 62 +-- lib/ui/painting/codec.h | 16 +- lib/ui/painting/frame_info.h | 10 +- lib/ui/painting/gradient.cc | 14 +- lib/ui/painting/gradient.h | 4 +- lib/ui/painting/image.h | 6 +- lib/ui/painting/image_encoding.cc | 32 +- lib/ui/painting/image_filter.cc | 4 +- lib/ui/painting/image_filter.h | 4 +- lib/ui/painting/image_shader.cc | 4 +- lib/ui/painting/image_shader.h | 4 +- lib/ui/painting/matrix.cc | 4 +- lib/ui/painting/paint.cc | 12 +- lib/ui/painting/path.cc | 12 +- lib/ui/painting/path.h | 16 +- lib/ui/painting/path_measure.cc | 8 +- lib/ui/painting/path_measure.h | 6 +- lib/ui/painting/picture.cc | 8 +- lib/ui/painting/picture.h | 6 +- lib/ui/painting/picture_recorder.cc | 8 +- lib/ui/painting/picture_recorder.h | 10 +- lib/ui/painting/rrect.cc | 4 +- lib/ui/painting/shader.h | 2 +- lib/ui/painting/vertices.cc | 10 +- lib/ui/painting/vertices.h | 4 +- lib/ui/plugins/callback_cache.cc | 2 +- lib/ui/plugins/callback_cache.h | 4 +- lib/ui/semantics/semantics_update.cc | 4 +- lib/ui/semantics/semantics_update.h | 4 +- lib/ui/semantics/semantics_update_builder.cc | 2 +- lib/ui/semantics/semantics_update_builder.h | 8 +- lib/ui/text/asset_manager_font_provider.cc | 6 +- lib/ui/text/asset_manager_font_provider.h | 6 +- lib/ui/text/font_collection.cc | 4 +- lib/ui/text/font_collection.h | 6 +- lib/ui/text/paragraph.cc | 4 +- lib/ui/text/paragraph.h | 6 +- lib/ui/text/paragraph_builder.cc | 10 +- lib/ui/text/paragraph_builder.h | 6 +- lib/ui/text/paragraph_impl_txt.cc | 4 +- lib/ui/text/text_box.cc | 4 +- lib/ui/ui_dart_state.cc | 6 +- lib/ui/ui_dart_state.h | 10 +- lib/ui/window/platform_message.cc | 4 +- lib/ui/window/platform_message.h | 18 +- lib/ui/window/platform_message_response.h | 8 +- .../window/platform_message_response_dart.cc | 14 +- .../window/platform_message_response_dart.h | 6 +- lib/ui/window/pointer_data_packet.h | 4 +- lib/ui/window/window.cc | 16 +- lib/ui/window/window.h | 10 +- runtime/BUILD.gn | 2 - runtime/dart_isolate.cc | 70 +-- runtime/dart_isolate.h | 52 +- runtime/dart_isolate_unittests.cc | 6 +- runtime/dart_service_isolate.cc | 28 +- runtime/dart_snapshot.cc | 30 +- runtime/dart_snapshot.h | 18 +- runtime/dart_snapshot_buffer.cc | 12 +- runtime/dart_snapshot_buffer.h | 4 +- runtime/dart_vm.cc | 66 +-- runtime/dart_vm.h | 52 +- runtime/dart_vm_unittests.cc | 4 +- runtime/embedder_resources.cc | 10 +- runtime/runtime_controller.cc | 28 +- runtime/runtime_controller.h | 28 +- runtime/runtime_delegate.h | 9 +- runtime/service_protocol.cc | 40 +- runtime/service_protocol.h | 41 +- shell/common/BUILD.gn | 2 - shell/common/animator.cc | 17 +- shell/common/animator.h | 18 +- shell/common/engine.cc | 40 +- shell/common/engine.h | 28 +- shell/common/io_manager.cc | 10 +- shell/common/io_manager.h | 11 +- shell/common/isolate_configuration.cc | 12 +- shell/common/isolate_configuration.h | 4 +- shell/common/platform_view.cc | 14 +- shell/common/platform_view.h | 14 +- shell/common/rasterizer.cc | 12 +- shell/common/rasterizer.h | 8 +- shell/common/run_configuration.h | 6 +- shell/common/shell.cc | 185 ++++---- shell/common/shell.h | 40 +- shell/common/shell_unittests.cc | 10 +- shell/common/skia_event_tracer_impl.cc | 4 +- shell/common/surface.cc | 4 +- shell/common/surface.h | 6 +- shell/common/switches.cc | 14 +- shell/common/switches.h | 8 +- shell/common/thread_host.h | 2 +- shell/common/vsync_waiter.cc | 4 +- shell/common/vsync_waiter.h | 12 +- shell/common/vsync_waiter_fallback.cc | 22 +- shell/common/vsync_waiter_fallback.h | 12 +- shell/gpu/gpu.gni | 1 - shell/gpu/gpu_surface_gl.cc | 22 +- shell/gpu/gpu_surface_gl.h | 8 +- shell/gpu/gpu_surface_software.cc | 2 +- shell/gpu/gpu_surface_software.h | 8 +- shell/gpu/gpu_surface_vulkan.cc | 12 +- shell/gpu/gpu_surface_vulkan.h | 10 +- shell/platform/android/BUILD.gn | 1 - shell/platform/android/android_context_gl.cc | 28 +- shell/platform/android/android_context_gl.h | 24 +- .../platform/android/android_environment_gl.h | 12 +- .../android/android_external_texture_gl.h | 2 +- .../platform/android/android_native_window.h | 14 +- .../platform/android/android_shell_holder.cc | 22 +- shell/platform/android/android_shell_holder.h | 6 +- shell/platform/android/android_surface.h | 4 +- shell/platform/android/android_surface_gl.cc | 28 +- shell/platform/android/android_surface_gl.h | 10 +- .../android/android_surface_software.cc | 4 +- .../android/android_surface_software.h | 8 +- .../android/android_surface_vulkan.cc | 8 +- .../platform/android/android_surface_vulkan.h | 10 +- shell/platform/android/apk_asset_provider.cc | 2 +- shell/platform/android/apk_asset_provider.h | 4 +- shell/platform/android/flutter_main.cc | 18 +- shell/platform/android/flutter_main.h | 4 +- shell/platform/android/library_loader.cc | 6 +- .../platform_message_response_android.cc | 8 +- .../platform_message_response_android.h | 10 +- .../platform/android/platform_view_android.cc | 20 +- .../platform/android/platform_view_android.h | 15 +- .../android/platform_view_android_jni.cc | 26 +- .../android/platform_view_android_jni.h | 2 +- .../platform/android/vsync_waiter_android.cc | 24 +- shell/platform/android/vsync_waiter_android.h | 4 +- shell/platform/darwin/BUILD.gn | 1 - shell/platform/darwin/common/BUILD.gn | 1 - shell/platform/darwin/common/command_line.h | 6 +- shell/platform/darwin/common/command_line.mm | 4 +- shell/platform/darwin/desktop/BUILD.gn | 1 - .../platform/darwin/desktop/flutter_window.mm | 12 +- shell/platform/darwin/desktop/main_mac.mm | 6 +- .../darwin/desktop/platform_view_mac.h | 4 +- .../darwin/desktop/platform_view_mac.mm | 2 +- .../darwin/desktop/vsync_waiter_mac.cc | 8 +- .../darwin/desktop/vsync_waiter_mac.h | 4 +- shell/platform/darwin/ios/BUILD.gn | 1 - .../framework/Source/FlutterDartProject.mm | 2 +- .../Source/FlutterHeadlessDartRunner.mm | 24 +- .../FlutterPluginAppLifeCycleDelegate.mm | 4 +- .../framework/Source/FlutterViewController.mm | 26 +- .../framework/Source/accessibility_bridge.h | 13 +- .../framework/Source/accessibility_bridge.mm | 10 +- .../framework/Source/flutter_touch_mapper.h | 4 +- .../Source/platform_message_response_darwin.h | 18 +- .../Source/platform_message_router.h | 6 +- .../Source/platform_message_router.mm | 4 +- .../ios/framework/Source/vsync_waiter_ios.h | 4 +- .../ios/framework/Source/vsync_waiter_ios.mm | 10 +- .../darwin/ios/headless_platform_view_ios.h | 8 +- .../darwin/ios/headless_platform_view_ios.mm | 2 +- .../darwin/ios/ios_external_texture_gl.h | 2 +- .../darwin/ios/ios_external_texture_gl.mm | 6 +- shell/platform/darwin/ios/ios_gl_context.h | 4 +- shell/platform/darwin/ios/ios_gl_context.mm | 38 +- shell/platform/darwin/ios/ios_surface.h | 4 +- shell/platform/darwin/ios/ios_surface_gl.h | 4 +- .../darwin/ios/ios_surface_software.h | 4 +- .../darwin/ios/ios_surface_software.mm | 2 +- shell/platform/darwin/ios/platform_view_ios.h | 8 +- .../platform/darwin/ios/platform_view_ios.mm | 8 +- shell/platform/embedder/BUILD.gn | 1 - shell/platform/embedder/embedder.cc | 23 +- shell/platform/embedder/embedder_engine.cc | 10 +- shell/platform/embedder/embedder_engine.h | 9 +- .../embedder/platform_view_embedder.cc | 2 +- .../embedder/platform_view_embedder.h | 8 +- shell/testing/BUILD.gn | 1 - shell/testing/tester_main.cc | 28 +- testing/BUILD.gn | 1 - testing/thread_test.cc | 4 +- testing/thread_test.h | 10 +- third_party/txt/BUILD.gn | 4 +- .../txt/benchmarks/paint_record_benchmarks.cc | 4 +- .../txt/benchmarks/paragraph_benchmarks.cc | 4 +- .../paragraph_builder_benchmarks.cc | 2 +- .../txt/benchmarks/styled_runs_benchmarks.cc | 4 +- .../txt/benchmarks/txt_run_all_benchmarks.cc | 8 +- third_party/txt/src/log/log.h | 14 +- third_party/txt/src/txt/asset_font_manager.cc | 18 +- third_party/txt/src/txt/asset_font_manager.h | 4 +- third_party/txt/src/txt/font_collection.cc | 2 +- third_party/txt/src/txt/font_collection.h | 6 +- third_party/txt/src/txt/font_skia.h | 4 +- third_party/txt/src/txt/paint_record.cc | 2 +- third_party/txt/src/txt/paint_record.h | 6 +- third_party/txt/src/txt/paragraph.cc | 4 +- third_party/txt/src/txt/paragraph.h | 6 +- third_party/txt/src/txt/paragraph_builder.cc | 2 +- third_party/txt/src/txt/paragraph_builder.h | 4 +- third_party/txt/src/txt/platform.h | 2 +- third_party/txt/src/txt/styled_runs.cc | 2 +- third_party/txt/src/txt/test_font_manager.cc | 2 +- third_party/txt/src/txt/test_font_manager.h | 4 +- .../src/txt/typeface_font_asset_provider.cc | 4 +- .../src/txt/typeface_font_asset_provider.h | 6 +- .../txt/tests/font_collection_unittests.cc | 4 +- third_party/txt/tests/paragraph_unittests.cc | 2 +- third_party/txt/tests/render_test.cc | 4 +- third_party/txt/tests/render_test.h | 4 +- .../txt/tests/txt_run_all_unittests.cc | 10 +- third_party/txt/tests/txt_test_utils.cc | 6 +- third_party/txt/tests/txt_test_utils.h | 6 +- travis/licenses_golden/licenses_flutter | 37 +- vulkan/BUILD.gn | 2 +- vulkan/vulkan_application.cc | 18 +- vulkan/vulkan_application.h | 4 +- vulkan/vulkan_backbuffer.cc | 8 +- vulkan/vulkan_backbuffer.h | 10 +- vulkan/vulkan_command_buffer.cc | 2 +- vulkan/vulkan_command_buffer.h | 12 +- vulkan/vulkan_debug_report.cc | 11 +- vulkan/vulkan_debug_report.h | 4 +- vulkan/vulkan_device.cc | 12 +- vulkan/vulkan_device.h | 20 +- vulkan/vulkan_handle.h | 6 +- vulkan/vulkan_image.h | 8 +- vulkan/vulkan_interface.h | 6 +- vulkan/vulkan_native_surface.h | 2 +- vulkan/vulkan_native_surface_android.h | 4 +- vulkan/vulkan_native_surface_magma.h | 4 +- vulkan/vulkan_proc_table.cc | 12 +- vulkan/vulkan_proc_table.h | 14 +- vulkan/vulkan_surface.cc | 4 +- vulkan/vulkan_surface.h | 4 +- vulkan/vulkan_swapchain.cc | 60 +-- vulkan/vulkan_swapchain.h | 8 +- vulkan/vulkan_utilities.h | 2 +- vulkan/vulkan_window.cc | 30 +- vulkan/vulkan_window.h | 12 +- 347 files changed, 3580 insertions(+), 1729 deletions(-) create mode 100644 fml/arraysize.h create mode 100644 fml/command_line.cc create mode 100644 fml/command_line.h create mode 100644 fml/command_line_unittest.cc create mode 100644 fml/make_copyable.h create mode 100644 fml/platform/posix/paths_posix.cc create mode 100644 fml/string_view.cc create mode 100644 fml/string_view.h create mode 100644 fml/string_view_unittest.cc diff --git a/BUILD.gn b/BUILD.gn index 91709a0e5..699af81e2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -48,7 +48,6 @@ group("flutter") { "$flutter_root/shell/platform/embedder:flutter_engine", "$flutter_root/synchronization:synchronization_unittests", "$flutter_root/third_party/txt:txt_unittests", - "//garnet/public/lib/fxl:fxl_unittests", ] } } diff --git a/DEPS b/DEPS index a44195551..e8e8c5e34 100644 --- a/DEPS +++ b/DEPS @@ -122,9 +122,6 @@ deps = { # build. Eventually, we'll manage these dependencies together with Fuchsia # and not have to specific specific hashes. - 'src/garnet': - Var('fuchsia_git') + '/garnet' + '@' + 'b7492b5f34e32248b164eb48ae8e67995aebda67', - 'src/third_party/tonic': Var('fuchsia_git') + '/tonic' + '@' + '57d508b12462db686573edcbc97891d90cf92f90', diff --git a/common/BUILD.gn b/common/BUILD.gn index 47cd7d3d6..c0212e352 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -18,7 +18,6 @@ source_set("common") { deps = [ "$flutter_root/fml", - "//garnet/public/lib/fxl", ] public_configs = [ diff --git a/common/settings.h b/common/settings.h index 547673529..124529b90 100644 --- a/common/settings.h +++ b/common/settings.h @@ -12,13 +12,13 @@ #include #include +#include "flutter/fml/closure.h" #include "flutter/fml/unique_fd.h" -#include "lib/fxl/functional/closure.h" namespace blink { using TaskObserverAdd = - std::function; + std::function; using TaskObserverRemove = std::function; struct Settings { @@ -70,10 +70,10 @@ struct Settings { TaskObserverRemove task_observer_remove; // The main isolate is current when this callback is made. This is a good spot // to perform native Dart bindings for libraries not built in. - fxl::Closure root_isolate_create_callback; + fml::closure root_isolate_create_callback; // The isolate is not current and may have already been destroyed when this // call is made. - fxl::Closure root_isolate_shutdown_callback; + fml::closure root_isolate_shutdown_callback; bool enable_software_rendering = false; bool skia_deterministic_rendering_on_cpu = false; bool verbose_logging = false; diff --git a/common/task_runners.cc b/common/task_runners.cc index 1a09daec1..bb62c8e9c 100644 --- a/common/task_runners.cc +++ b/common/task_runners.cc @@ -9,10 +9,10 @@ namespace blink { TaskRunners::TaskRunners(std::string label, - fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io) + fml::RefPtr platform, + fml::RefPtr gpu, + fml::RefPtr ui, + fml::RefPtr io) : label_(std::move(label)), platform_(std::move(platform)), gpu_(std::move(gpu)), @@ -25,19 +25,19 @@ const std::string& TaskRunners::GetLabel() const { return label_; } -fxl::RefPtr TaskRunners::GetPlatformTaskRunner() const { +fml::RefPtr TaskRunners::GetPlatformTaskRunner() const { return platform_; } -fxl::RefPtr TaskRunners::GetUITaskRunner() const { +fml::RefPtr TaskRunners::GetUITaskRunner() const { return ui_; } -fxl::RefPtr TaskRunners::GetIOTaskRunner() const { +fml::RefPtr TaskRunners::GetIOTaskRunner() const { return io_; } -fxl::RefPtr TaskRunners::GetGPUTaskRunner() const { +fml::RefPtr TaskRunners::GetGPUTaskRunner() const { return gpu_; } diff --git a/common/task_runners.h b/common/task_runners.h index f41ae147e..642a8a158 100644 --- a/common/task_runners.h +++ b/common/task_runners.h @@ -7,40 +7,41 @@ #include -#include "lib/fxl/macros.h" -#include "lib/fxl/tasks/task_runner.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/task_runner.h" namespace blink { class TaskRunners { public: TaskRunners(std::string label, - fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io); + fml::RefPtr platform, + fml::RefPtr gpu, + fml::RefPtr ui, + fml::RefPtr io); ~TaskRunners(); const std::string& GetLabel() const; - fxl::RefPtr GetPlatformTaskRunner() const; + fml::RefPtr GetPlatformTaskRunner() const; - fxl::RefPtr GetUITaskRunner() const; + fml::RefPtr GetUITaskRunner() const; - fxl::RefPtr GetIOTaskRunner() const; + fml::RefPtr GetIOTaskRunner() const; - fxl::RefPtr GetGPUTaskRunner() const; + fml::RefPtr GetGPUTaskRunner() const; bool IsValid() const; private: const std::string label_; - fxl::RefPtr platform_; - fxl::RefPtr gpu_; - fxl::RefPtr ui_; - fxl::RefPtr io_; + fml::RefPtr platform_; + fml::RefPtr gpu_; + fml::RefPtr ui_; + fml::RefPtr io_; }; + } // namespace blink #endif // FLUTTER_COMMON_TASK_RUNNERS_H_ diff --git a/flow/BUILD.gn b/flow/BUILD.gn index a63dfad95..77853058e 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -58,10 +58,6 @@ source_set("flow") { "texture.h", ] - public_deps = [ - "//garnet/public/lib/fxl", - ] - public_configs = [ "$flutter_root:config" ] deps = [ diff --git a/flow/compositor_context.h b/flow/compositor_context.h index 14c2449db..5a6700ff3 100644 --- a/flow/compositor_context.h +++ b/flow/compositor_context.h @@ -11,7 +11,7 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" @@ -44,7 +44,7 @@ class CompositorContext { SkCanvas* canvas_; const bool instrumentation_enabled_; - FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); + FML_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); }; CompositorContext(); @@ -81,7 +81,7 @@ class CompositorContext { void EndFrame(ScopedFrame& frame, bool enable_instrumentation); - FXL_DISALLOW_COPY_AND_ASSIGN(CompositorContext); + FML_DISALLOW_COPY_AND_ASSIGN(CompositorContext); }; } // namespace flow diff --git a/flow/debug_print.h b/flow/debug_print.h index 78a28fe38..d58dcbed2 100644 --- a/flow/debug_print.h +++ b/flow/debug_print.h @@ -7,7 +7,7 @@ #include "flutter/flow/matrix_decomposition.h" #include "flutter/flow/raster_cache_key.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkMatrix.h" #include "third_party/skia/include/core/SkMatrix44.h" #include "third_party/skia/include/core/SkPoint3.h" diff --git a/flow/export_node.cc b/flow/export_node.cc index 9b4b62fae..e837f525f 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -4,16 +4,16 @@ #include "flutter/flow/export_node.h" -#include "lib/fxl/functional/make_copyable.h" +#include "flutter/fml/make_copyable.h" namespace flow { ExportNodeHolder::ExportNodeHolder( - fxl::RefPtr gpu_task_runner, - fxl::RefPtr export_token_handle) + fml::RefPtr gpu_task_runner, + fml::RefPtr export_token_handle) : gpu_task_runner_(std::move(gpu_task_runner)), export_node_(std::make_unique(export_token_handle)) { - FXL_DCHECK(gpu_task_runner_); + FML_DCHECK(gpu_task_runner_); } void ExportNodeHolder::Bind(SceneUpdateContext& context, @@ -25,18 +25,18 @@ void ExportNodeHolder::Bind(SceneUpdateContext& context, ExportNodeHolder::~ExportNodeHolder() { gpu_task_runner_->PostTask( - fxl::MakeCopyable([export_node = std::move(export_node_)]() { + fml::MakeCopyable([export_node = std::move(export_node_)]() { export_node->Dispose(true); })); } -ExportNode::ExportNode(fxl::RefPtr export_token_handle) +ExportNode::ExportNode(fml::RefPtr export_token_handle) : export_token_(export_token_handle->ReleaseHandle()) {} ExportNode::~ExportNode() { // Ensure that we properly released the node. - FXL_DCHECK(!node_); - FXL_DCHECK(scene_update_context_ == nullptr); + FML_DCHECK(!node_); + FML_DCHECK(scene_update_context_ == nullptr); } void ExportNode::Bind(SceneUpdateContext& context, @@ -57,9 +57,9 @@ void ExportNode::Bind(SceneUpdateContext& context, if (node_) { container.AddChild(*node_); node_->SetTranslation(offset.x(), offset.y(), 0.f); - node_->SetHitTestBehavior(hit_testable - ? fuchsia::ui::gfx::HitTestBehavior::kDefault - : fuchsia::ui::gfx::HitTestBehavior::kSuppress); + node_->SetHitTestBehavior( + hit_testable ? fuchsia::ui::gfx::HitTestBehavior::kDefault + : fuchsia::ui::gfx::HitTestBehavior::kSuppress); } } @@ -70,7 +70,7 @@ void ExportNode::Dispose(bool remove_from_scene_update_context) { // 1. A node was never created, or // 2. A node was created but was already dereferenced (i.e. Dispose has // already been called). - FXL_DCHECK(scene_update_context_ || !node_); + FML_DCHECK(scene_update_context_ || !node_); if (remove_from_scene_update_context && scene_update_context_) { scene_update_context_->RemoveExportNode(this); diff --git a/flow/export_node.h b/flow/export_node.h index 335d3ba92..c7a3db98a 100644 --- a/flow/export_node.h +++ b/flow/export_node.h @@ -11,9 +11,9 @@ #include "dart-pkg/zircon/sdk_ext/handle.h" #include "flutter/flow/scene_update_context.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/memory/ref_counted.h" #include "lib/ui/scenic/cpp/resources.h" #include "third_party/flutter/fml/task_runner.h" #include "third_party/skia/include/core/SkPoint.h" @@ -23,10 +23,10 @@ namespace flow { // Wrapper class for ExportNode to use on UI Thread. When ExportNodeHolder is // destroyed, a task is posted on the Rasterizer thread to dispose the resources // held by the ExportNode. -class ExportNodeHolder : public fxl::RefCountedThreadSafe { +class ExportNodeHolder : public fml::RefCountedThreadSafe { public: - ExportNodeHolder(fxl::RefPtr gpu_task_runner, - fxl::RefPtr export_token_handle); + ExportNodeHolder(fml::RefPtr gpu_task_runner, + fml::RefPtr export_token_handle); ~ExportNodeHolder(); // Calls Bind() on the wrapped ExportNode. @@ -38,12 +38,12 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { ExportNode* export_node() { return export_node_.get(); } private: - fxl::RefPtr gpu_task_runner_; + fml::RefPtr gpu_task_runner_; std::unique_ptr export_node_; - FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); - FRIEND_REF_COUNTED_THREAD_SAFE(ExportNodeHolder); - FXL_DISALLOW_COPY_AND_ASSIGN(ExportNodeHolder); + FML_FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); + FML_FRIEND_REF_COUNTED_THREAD_SAFE(ExportNodeHolder); + FML_DISALLOW_COPY_AND_ASSIGN(ExportNodeHolder); }; // Represents a node which is being exported from the session. @@ -51,7 +51,7 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { // must be created and destroyed by the rasterizer thread. class ExportNode { public: - ExportNode(fxl::RefPtr export_token_handle); + ExportNode(fml::RefPtr export_token_handle); ~ExportNode(); @@ -75,7 +75,7 @@ class ExportNode { zx::eventpair export_token_; std::unique_ptr node_; - FXL_DISALLOW_COPY_AND_ASSIGN(ExportNode); + FML_DISALLOW_COPY_AND_ASSIGN(ExportNode); }; } // namespace flow diff --git a/flow/instrumentation.cc b/flow/instrumentation.cc index e3e9fbd5e..a032a0ab3 100644 --- a/flow/instrumentation.cc +++ b/flow/instrumentation.cc @@ -14,28 +14,28 @@ namespace flow { static const size_t kMaxSamples = 120; static const size_t kMaxFrameMarkers = 8; -Stopwatch::Stopwatch() : start_(fxl::TimePoint::Now()), current_sample_(0) { - const fxl::TimeDelta delta = fxl::TimeDelta::Zero(); +Stopwatch::Stopwatch() : start_(fml::TimePoint::Now()), current_sample_(0) { + const fml::TimeDelta delta = fml::TimeDelta::Zero(); laps_.resize(kMaxSamples, delta); } Stopwatch::~Stopwatch() = default; void Stopwatch::Start() { - start_ = fxl::TimePoint::Now(); + start_ = fml::TimePoint::Now(); current_sample_ = (current_sample_ + 1) % kMaxSamples; } void Stopwatch::Stop() { - laps_[current_sample_] = fxl::TimePoint::Now() - start_; + laps_[current_sample_] = fml::TimePoint::Now() - start_; } -void Stopwatch::SetLapTime(const fxl::TimeDelta& delta) { +void Stopwatch::SetLapTime(const fml::TimeDelta& delta) { current_sample_ = (current_sample_ + 1) % kMaxSamples; laps_[current_sample_] = delta; } -const fxl::TimeDelta& Stopwatch::LastLap() const { +const fml::TimeDelta& Stopwatch::LastLap() const { return laps_[(current_sample_ - 1) % kMaxSamples]; } @@ -51,8 +51,8 @@ static inline double UnitHeight(double frame_time_ms, return unitHeight; } -fxl::TimeDelta Stopwatch::MaxDelta() const { - fxl::TimeDelta max_delta; +fml::TimeDelta Stopwatch::MaxDelta() const { + fml::TimeDelta max_delta; for (size_t i = 0; i < kMaxSamples; i++) { if (laps_[i] > max_delta) max_delta = laps_[i]; @@ -148,8 +148,7 @@ void Stopwatch::Visualize(SkCanvas& canvas, const SkRect& rect) const { x + width * (static_cast(current_sample_) / kMaxSamples); const auto marker_rect = SkRect::MakeLTRB( - sample_x, y, - sample_x + width * sample_unit_width, bottom); + sample_x, y, sample_x + width * sample_unit_width, bottom); canvas.drawRect(marker_rect, paint); } diff --git a/flow/instrumentation.h b/flow/instrumentation.h index 1692c8aec..19f3b0cfd 100644 --- a/flow/instrumentation.h +++ b/flow/instrumentation.h @@ -7,9 +7,9 @@ #include -#include "lib/fxl/macros.h" -#include "lib/fxl/time/time_delta.h" -#include "lib/fxl/time/time_point.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/time/time_delta.h" +#include "flutter/fml/time/time_point.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { @@ -22,11 +22,11 @@ class Stopwatch { ~Stopwatch(); - const fxl::TimeDelta& LastLap() const; + const fml::TimeDelta& LastLap() const; - fxl::TimeDelta CurrentLap() const { return fxl::TimePoint::Now() - start_; } + fml::TimeDelta CurrentLap() const { return fml::TimePoint::Now() - start_; } - fxl::TimeDelta MaxDelta() const; + fml::TimeDelta MaxDelta() const; void Visualize(SkCanvas& canvas, const SkRect& rect) const; @@ -34,14 +34,14 @@ class Stopwatch { void Stop(); - void SetLapTime(const fxl::TimeDelta& delta); + void SetLapTime(const fml::TimeDelta& delta); private: - fxl::TimePoint start_; - std::vector laps_; + fml::TimePoint start_; + std::vector laps_; size_t current_sample_; - FXL_DISALLOW_COPY_AND_ASSIGN(Stopwatch); + FML_DISALLOW_COPY_AND_ASSIGN(Stopwatch); }; class Counter { @@ -57,7 +57,7 @@ class Counter { private: size_t count_; - FXL_DISALLOW_COPY_AND_ASSIGN(Counter); + FML_DISALLOW_COPY_AND_ASSIGN(Counter); }; class CounterValues { @@ -80,7 +80,7 @@ class CounterValues { std::vector values_; size_t current_sample_; - FXL_DISALLOW_COPY_AND_ASSIGN(CounterValues); + FML_DISALLOW_COPY_AND_ASSIGN(CounterValues); }; } // namespace flow diff --git a/flow/layers/backdrop_filter_layer.cc b/flow/layers/backdrop_filter_layer.cc index 5186284fc..b8d04803f 100644 --- a/flow/layers/backdrop_filter_layer.cc +++ b/flow/layers/backdrop_filter_layer.cc @@ -14,7 +14,7 @@ BackdropFilterLayer::~BackdropFilterLayer() = default; void BackdropFilterLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "BackdropFilterLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); Layer::AutoSaveLayer(context, SkCanvas::SaveLayerRec{&paint_bounds(), nullptr, filter_.get(), 0}); diff --git a/flow/layers/backdrop_filter_layer.h b/flow/layers/backdrop_filter_layer.h index 00b1a2224..a54f844a4 100644 --- a/flow/layers/backdrop_filter_layer.h +++ b/flow/layers/backdrop_filter_layer.h @@ -21,7 +21,7 @@ class BackdropFilterLayer : public ContainerLayer { private: sk_sp filter_; - FXL_DISALLOW_COPY_AND_ASSIGN(BackdropFilterLayer); + FML_DISALLOW_COPY_AND_ASSIGN(BackdropFilterLayer); }; } // namespace flow diff --git a/flow/layers/child_scene_layer.cc b/flow/layers/child_scene_layer.cc index 8b36ce09c..744aee5e8 100644 --- a/flow/layers/child_scene_layer.cc +++ b/flow/layers/child_scene_layer.cc @@ -19,7 +19,7 @@ void ChildSceneLayer::Paint(PaintContext& context) const { } void ChildSceneLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); // TODO(MZ-191): Set clip. // It's worth asking whether all children should be clipped implicitly diff --git a/flow/layers/child_scene_layer.h b/flow/layers/child_scene_layer.h index d28009095..b52ceb28b 100644 --- a/flow/layers/child_scene_layer.h +++ b/flow/layers/child_scene_layer.h @@ -21,7 +21,7 @@ class ChildSceneLayer : public Layer { void set_size(const SkSize& size) { size_ = size; } void set_export_node_holder( - fxl::RefPtr export_node_holder) { + fml::RefPtr export_node_holder) { export_node_holder_ = std::move(export_node_holder); } @@ -36,10 +36,10 @@ class ChildSceneLayer : public Layer { private: SkPoint offset_; SkSize size_; - fxl::RefPtr export_node_holder_; + fml::RefPtr export_node_holder_; bool hit_testable_ = true; - FXL_DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer); }; } // namespace flow diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index 5a234aa5e..3c71823c4 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -29,7 +29,7 @@ void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); // TODO(MZ-140): Must be able to specify paths as shapes to nodes. // Treating the shape as a rectangle for now. @@ -48,7 +48,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { void ClipPathLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipPathLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.clipPath(clip_path_, clip_behavior_ != Clip::hardEdge); diff --git a/flow/layers/clip_path_layer.h b/flow/layers/clip_path_layer.h index 818285af8..33b043029 100644 --- a/flow/layers/clip_path_layer.h +++ b/flow/layers/clip_path_layer.h @@ -28,7 +28,7 @@ class ClipPathLayer : public ContainerLayer { SkPath clip_path_; Clip clip_behavior_; - FXL_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer); }; } // namespace flow diff --git a/flow/layers/clip_rect_layer.cc b/flow/layers/clip_rect_layer.cc index 6f345678f..bc9ce7d09 100644 --- a/flow/layers/clip_rect_layer.cc +++ b/flow/layers/clip_rect_layer.cc @@ -23,7 +23,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); scenic::Rectangle shape(context.session(), // session clip_rect_.width(), // width @@ -39,7 +39,7 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { void ClipRectLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipRectLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, clip_behavior_ != Clip::hardEdge); context.canvas.clipRect(paint_bounds()); diff --git a/flow/layers/clip_rect_layer.h b/flow/layers/clip_rect_layer.h index 0744076ec..576e6a5d0 100644 --- a/flow/layers/clip_rect_layer.h +++ b/flow/layers/clip_rect_layer.h @@ -27,7 +27,7 @@ class ClipRectLayer : public ContainerLayer { SkRect clip_rect_; Clip clip_behavior_; - FXL_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer); }; } // namespace flow diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index d21ce637f..046a0d454 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -23,7 +23,7 @@ void ClipRRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); // TODO(MZ-137): Need to be able to express the radii as vectors. scenic::RoundedRectangle shape( @@ -46,7 +46,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { void ClipRRectLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipRRectLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.clipRRect(clip_rrect_, clip_behavior_ != Clip::hardEdge); diff --git a/flow/layers/clip_rrect_layer.h b/flow/layers/clip_rrect_layer.h index 7888a15ef..7e8f0934a 100644 --- a/flow/layers/clip_rrect_layer.h +++ b/flow/layers/clip_rrect_layer.h @@ -28,7 +28,7 @@ class ClipRRectLayer : public ContainerLayer { SkRRect clip_rrect_; Clip clip_behavior_; - FXL_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer); }; } // namespace flow diff --git a/flow/layers/color_filter_layer.cc b/flow/layers/color_filter_layer.cc index 6b1330eb4..a3c678aa1 100644 --- a/flow/layers/color_filter_layer.cc +++ b/flow/layers/color_filter_layer.cc @@ -12,7 +12,7 @@ ColorFilterLayer::~ColorFilterLayer() = default; void ColorFilterLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ColorFilterLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); sk_sp color_filter = SkColorFilter::MakeModeFilter(color_, blend_mode_); diff --git a/flow/layers/color_filter_layer.h b/flow/layers/color_filter_layer.h index dcd7543b5..e129bad66 100644 --- a/flow/layers/color_filter_layer.h +++ b/flow/layers/color_filter_layer.h @@ -24,7 +24,7 @@ class ColorFilterLayer : public ContainerLayer { SkColor color_; SkBlendMode blend_mode_; - FXL_DISALLOW_COPY_AND_ASSIGN(ColorFilterLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ColorFilterLayer); }; } // namespace flow diff --git a/flow/layers/container_layer.cc b/flow/layers/container_layer.cc index b437d4369..f398c96ad 100644 --- a/flow/layers/container_layer.cc +++ b/flow/layers/container_layer.cc @@ -38,7 +38,7 @@ void ContainerLayer::PrerollChildren(PrerollContext* context, } void ContainerLayer::PaintChildren(PaintContext& context) const { - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); // Intentionally not tracing here as there should be no self-time // and the trace event on this common function has a small overhead. @@ -56,7 +56,7 @@ void ContainerLayer::UpdateScene(SceneUpdateContext& context) { } void ContainerLayer::UpdateSceneChildren(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); // Paint all of the layers which need to be drawn into the container. // These may be flattened down to a containing diff --git a/flow/layers/container_layer.h b/flow/layers/container_layer.h index 9b30d28c9..0da0a7185 100644 --- a/flow/layers/container_layer.h +++ b/flow/layers/container_layer.h @@ -38,7 +38,7 @@ class ContainerLayer : public Layer { private: std::vector> layers_; - FXL_DISALLOW_COPY_AND_ASSIGN(ContainerLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ContainerLayer); }; } // namespace flow diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index 031bf24d9..33fac9704 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -72,7 +72,7 @@ void DefaultLayerBuilder::PushClipRoundedRect(const SkRRect& rrect, } void DefaultLayerBuilder::PushClipPath(const SkPath& path, Clip clip_behavior) { - FXL_DCHECK(clip_behavior != Clip::none); + FML_DCHECK(clip_behavior != Clip::none); SkRect cullRect; if (!cullRect.intersect(path.getBounds(), cull_rects_.top())) { cullRect = SkRect::MakeEmpty(); @@ -178,7 +178,7 @@ void DefaultLayerBuilder::PushTexture(const SkPoint& offset, void DefaultLayerBuilder::PushChildScene( const SkPoint& offset, const SkSize& size, - fxl::RefPtr export_token_holder, + fml::RefPtr export_token_holder, bool hit_testable) { if (!current_layer_) { return; @@ -211,7 +211,7 @@ std::unique_ptr DefaultLayerBuilder::TakeLayer() { void DefaultLayerBuilder::PushLayer(std::unique_ptr layer, const SkRect& cullRect) { - FXL_DCHECK(layer); + FML_DCHECK(layer); cull_rects_.push(cullRect); diff --git a/flow/layers/default_layer_builder.h b/flow/layers/default_layer_builder.h index d5a2643a5..0dd87a3dd 100644 --- a/flow/layers/default_layer_builder.h +++ b/flow/layers/default_layer_builder.h @@ -9,7 +9,7 @@ #include "flutter/flow/layers/container_layer.h" #include "flutter/flow/layers/layer_builder.h" -#include "garnet/public/lib/fxl/macros.h" +#include "flutter/fml/macros.h" namespace flow { @@ -76,7 +76,7 @@ class DefaultLayerBuilder final : public LayerBuilder { // |flow::LayerBuilder| void PushChildScene(const SkPoint& offset, const SkSize& size, - fxl::RefPtr export_token_holder, + fml::RefPtr export_token_holder, bool hit_testable) override; #endif // defined(OS_FUCHSIA) @@ -95,7 +95,7 @@ class DefaultLayerBuilder final : public LayerBuilder { void PushLayer(std::unique_ptr layer, const SkRect& cullRect); - FXL_DISALLOW_COPY_AND_ASSIGN(DefaultLayerBuilder); + FML_DISALLOW_COPY_AND_ASSIGN(DefaultLayerBuilder); }; } // namespace flow diff --git a/flow/layers/layer.h b/flow/layers/layer.h index d1a4f0ba1..173c2890b 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -11,10 +11,10 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/logging.h" +#include "flutter/fml/macros.h" #include "flutter/fml/trace_event.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColorFilter.h" @@ -112,7 +112,7 @@ class Layer { bool needs_system_composite_; SkRect paint_bounds_; - FXL_DISALLOW_COPY_AND_ASSIGN(Layer); + FML_DISALLOW_COPY_AND_ASSIGN(Layer); }; } // namespace flow diff --git a/flow/layers/layer_builder.h b/flow/layers/layer_builder.h index 3cb6ea1fb..c1b34bf30 100644 --- a/flow/layers/layer_builder.h +++ b/flow/layers/layer_builder.h @@ -9,7 +9,7 @@ #include "flutter/flow/layers/layer.h" #include "flutter/flow/skia_gpu_object.h" -#include "garnet/public/lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkBlendMode.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkImageFilter.h" @@ -74,7 +74,7 @@ class LayerBuilder { virtual void PushChildScene( const SkPoint& offset, const SkSize& size, - fxl::RefPtr export_token_holder, + fml::RefPtr export_token_holder, bool hit_testable) = 0; #endif // defined(OS_FUCHSIA) @@ -99,7 +99,7 @@ class LayerBuilder { bool checkerboard_raster_cache_images_ = false; bool checkerboard_offscreen_layers_ = false; - FXL_DISALLOW_COPY_AND_ASSIGN(LayerBuilder); + FML_DISALLOW_COPY_AND_ASSIGN(LayerBuilder); }; } // namespace flow diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 522fe6a34..bae883ca2 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -11,8 +11,8 @@ #include "flutter/flow/compositor_context.h" #include "flutter/flow/layers/layer.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/time/time_delta.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/time/time_delta.h" #include "third_party/skia/include/core/SkPicture.h" #include "third_party/skia/include/core/SkSize.h" @@ -46,11 +46,11 @@ class LayerTree { void set_frame_size(const SkISize& frame_size) { frame_size_ = frame_size; } - void set_construction_time(const fxl::TimeDelta& delta) { + void set_construction_time(const fml::TimeDelta& delta) { construction_time_ = delta; } - const fxl::TimeDelta& construction_time() const { return construction_time_; } + const fml::TimeDelta& construction_time() const { return construction_time_; } // The number of frame intervals missed after which the compositor must // trace the rasterized picture to a trace file. Specify 0 to disable all @@ -74,12 +74,12 @@ class LayerTree { private: SkISize frame_size_; // Physical pixels. std::unique_ptr root_layer_; - fxl::TimeDelta construction_time_; + fml::TimeDelta construction_time_; uint32_t rasterizer_tracing_threshold_; bool checkerboard_raster_cache_images_; bool checkerboard_offscreen_layers_; - FXL_DISALLOW_COPY_AND_ASSIGN(LayerTree); + FML_DISALLOW_COPY_AND_ASSIGN(LayerTree); }; } // namespace flow diff --git a/flow/layers/opacity_layer.cc b/flow/layers/opacity_layer.cc index e6916f076..84b8bd64c 100644 --- a/flow/layers/opacity_layer.cc +++ b/flow/layers/opacity_layer.cc @@ -12,7 +12,7 @@ OpacityLayer::~OpacityLayer() = default; void OpacityLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "OpacityLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkPaint paint; paint.setAlpha(alpha_); diff --git a/flow/layers/opacity_layer.h b/flow/layers/opacity_layer.h index 2ec0a1acf..b27829385 100644 --- a/flow/layers/opacity_layer.h +++ b/flow/layers/opacity_layer.h @@ -24,7 +24,7 @@ class OpacityLayer : public ContainerLayer { private: int alpha_; - FXL_DISALLOW_COPY_AND_ASSIGN(OpacityLayer); + FML_DISALLOW_COPY_AND_ASSIGN(OpacityLayer); }; } // namespace flow diff --git a/flow/layers/performance_overlay_layer.h b/flow/layers/performance_overlay_layer.h index 774481071..3296a308b 100644 --- a/flow/layers/performance_overlay_layer.h +++ b/flow/layers/performance_overlay_layer.h @@ -6,7 +6,7 @@ #define FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_ #include "flutter/flow/layers/layer.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" namespace flow { @@ -24,7 +24,7 @@ class PerformanceOverlayLayer : public Layer { private: int options_; - FXL_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer); + FML_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer); }; } // namespace flow diff --git a/flow/layers/physical_shape_layer.cc b/flow/layers/physical_shape_layer.cc index 8f9e59d6f..53a7d29f3 100644 --- a/flow/layers/physical_shape_layer.cc +++ b/flow/layers/physical_shape_layer.cc @@ -64,7 +64,7 @@ void PhysicalShapeLayer::Preroll(PrerollContext* context, #if defined(OS_FUCHSIA) void PhysicalShapeLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); SceneUpdateContext::Frame frame(context, frameRRect_, color_, elevation_); for (auto& layer : layers()) { @@ -80,7 +80,7 @@ void PhysicalShapeLayer::UpdateScene(SceneUpdateContext& context) { void PhysicalShapeLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "PhysicalShapeLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); if (elevation_ != 0) { DrawShadow(&context.canvas, path_, shadow_color_, elevation_, diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index bef944e7f..3cbf15a60 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -4,7 +4,7 @@ #include "flutter/flow/layers/picture_layer.h" -#include "lib/fxl/logging.h" +#include "flutter/fml/logging.h" namespace flow { @@ -34,8 +34,8 @@ void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { void PictureLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "PictureLayer::Paint"); - FXL_DCHECK(picture_.get()); - FXL_DCHECK(needs_painting()); + FML_DCHECK(picture_.get()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.translate(offset_.x(), offset_.y()); diff --git a/flow/layers/picture_layer.h b/flow/layers/picture_layer.h index c67929b7c..12e2807c3 100644 --- a/flow/layers/picture_layer.h +++ b/flow/layers/picture_layer.h @@ -41,7 +41,7 @@ class PictureLayer : public Layer { bool will_change_ = false; RasterCacheResult raster_cache_result_; - FXL_DISALLOW_COPY_AND_ASSIGN(PictureLayer); + FML_DISALLOW_COPY_AND_ASSIGN(PictureLayer); }; } // namespace flow diff --git a/flow/layers/shader_mask_layer.cc b/flow/layers/shader_mask_layer.cc index 4ed67334b..3ea69322f 100644 --- a/flow/layers/shader_mask_layer.cc +++ b/flow/layers/shader_mask_layer.cc @@ -12,7 +12,7 @@ ShaderMaskLayer::~ShaderMaskLayer() = default; void ShaderMaskLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ShaderMaskLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); Layer::AutoSaveLayer(context, paint_bounds(), nullptr); PaintChildren(context); diff --git a/flow/layers/shader_mask_layer.h b/flow/layers/shader_mask_layer.h index 0b9e728cd..ed059722f 100644 --- a/flow/layers/shader_mask_layer.h +++ b/flow/layers/shader_mask_layer.h @@ -29,7 +29,7 @@ class ShaderMaskLayer : public ContainerLayer { SkRect mask_rect_; SkBlendMode blend_mode_; - FXL_DISALLOW_COPY_AND_ASSIGN(ShaderMaskLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ShaderMaskLayer); }; } // namespace flow diff --git a/flow/layers/texture_layer.h b/flow/layers/texture_layer.h index 75f0fe66a..93581c347 100644 --- a/flow/layers/texture_layer.h +++ b/flow/layers/texture_layer.h @@ -31,7 +31,7 @@ class TextureLayer : public Layer { SkSize size_; int64_t texture_id_; - FXL_DISALLOW_COPY_AND_ASSIGN(TextureLayer); + FML_DISALLOW_COPY_AND_ASSIGN(TextureLayer); }; } // namespace flow diff --git a/flow/layers/transform_layer.cc b/flow/layers/transform_layer.cc index be6a6f81c..a70cc299d 100644 --- a/flow/layers/transform_layer.cc +++ b/flow/layers/transform_layer.cc @@ -24,7 +24,7 @@ void TransformLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void TransformLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); SceneUpdateContext::Transform transform(context, transform_); UpdateSceneChildren(context); @@ -34,7 +34,7 @@ void TransformLayer::UpdateScene(SceneUpdateContext& context) { void TransformLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "TransformLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.concat(transform_); diff --git a/flow/layers/transform_layer.h b/flow/layers/transform_layer.h index 47fd7d5ce..f8209302a 100644 --- a/flow/layers/transform_layer.h +++ b/flow/layers/transform_layer.h @@ -27,7 +27,7 @@ class TransformLayer : public ContainerLayer { private: SkMatrix transform_; - FXL_DISALLOW_COPY_AND_ASSIGN(TransformLayer); + FML_DISALLOW_COPY_AND_ASSIGN(TransformLayer); }; } // namespace flow diff --git a/flow/matrix_decomposition.h b/flow/matrix_decomposition.h index 1392ed8aa..d65d12a77 100644 --- a/flow/matrix_decomposition.h +++ b/flow/matrix_decomposition.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FLOW_MATRIX_DECOMPOSITION_H_ #define FLUTTER_FLOW_MATRIX_DECOMPOSITION_H_ -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkMatrix.h" #include "third_party/skia/include/core/SkMatrix44.h" #include "third_party/skia/include/core/SkPoint3.h" @@ -43,7 +43,7 @@ class MatrixDecomposition { SkVector4 perspective_; SkVector4 rotation_; - FXL_DISALLOW_COPY_AND_ASSIGN(MatrixDecomposition); + FML_DISALLOW_COPY_AND_ASSIGN(MatrixDecomposition); }; } // namespace flow diff --git a/flow/matrix_decomposition_unittests.cc b/flow/matrix_decomposition_unittests.cc index df8009088..130f290d5 100644 --- a/flow/matrix_decomposition_unittests.cc +++ b/flow/matrix_decomposition_unittests.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "lib/fxl/build_config.h" +#include "flutter/fml/build_config.h" #if defined(OS_WIN) #define _USE_MATH_DEFINES diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 33d5a99d2..a3aef6e3d 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -7,8 +7,8 @@ #include #include "flutter/flow/paint_utils.h" +#include "flutter/fml/logging.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" #include "third_party/skia/include/core/SkImage.h" @@ -21,7 +21,7 @@ void RasterCacheResult::draw(SkCanvas& canvas) const { SkAutoCanvasRestore auto_restore(&canvas, true); SkIRect bounds = RasterCache::GetDeviceBounds(logical_rect_, canvas.getTotalMatrix()); - FXL_DCHECK(bounds.size() == image_->dimensions()); + FML_DCHECK(bounds.size() == image_->dimensions()); canvas.resetMatrix(); canvas.drawImage(image_, bounds.fLeft, bounds.fTop); } diff --git a/flow/raster_cache.h b/flow/raster_cache.h index e72e74370..348ab8000 100644 --- a/flow/raster_cache.h +++ b/flow/raster_cache.h @@ -10,8 +10,8 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache_key.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/memory/weak_ptr.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSize.h" @@ -79,9 +79,9 @@ class RasterCache { const size_t threshold_; RasterCacheKey::Map cache_; bool checkerboard_images_; - fxl::WeakPtrFactory weak_factory_; + fml::WeakPtrFactory weak_factory_; - FXL_DISALLOW_COPY_AND_ASSIGN(RasterCache); + FML_DISALLOW_COPY_AND_ASSIGN(RasterCache); }; } // namespace flow diff --git a/flow/raster_cache_key.h b/flow/raster_cache_key.h index c6f4c7593..3f20072df 100644 --- a/flow/raster_cache_key.h +++ b/flow/raster_cache_key.h @@ -7,8 +7,8 @@ #include #include "flutter/flow/matrix_decomposition.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/logging.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkPicture.h" @@ -21,7 +21,7 @@ class RasterCacheKey { matrix_[SkMatrix::kMTransX] = SkScalarFraction(ctm.getTranslateX()); matrix_[SkMatrix::kMTransY] = SkScalarFraction(ctm.getTranslateY()); #ifndef SUPPORT_FRACTIONAL_TRANSLATION - FXL_DCHECK(matrix_.getTranslateX() == 0 && matrix_.getTranslateY() == 0); + FML_DCHECK(matrix_.getTranslateX() == 0 && matrix_.getTranslateY() == 0); #endif } diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index c4cb57e59..576bde7fa 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -14,7 +14,7 @@ namespace flow { SceneUpdateContext::SceneUpdateContext(scenic::Session* session, SurfaceProducer* surface_producer) : session_(session), surface_producer_(surface_producer) { - FXL_DCHECK(surface_producer_ != nullptr); + FML_DCHECK(surface_producer_ != nullptr); } SceneUpdateContext::~SceneUpdateContext() { @@ -27,7 +27,7 @@ SceneUpdateContext::~SceneUpdateContext() { void SceneUpdateContext::AddChildScene(ExportNode* export_node, SkPoint offset, bool hit_testable) { - FXL_DCHECK(top_entity_); + FML_DCHECK(top_entity_); export_node->Bind(*this, top_entity_->entity_node(), offset, hit_testable); } @@ -161,7 +161,7 @@ scenic::Image* SceneUpdateContext::GenerateImageIfNeeded( auto surface = surface_producer_->ProduceSurface(physical_size); if (!surface) { - FXL_LOG(ERROR) << "Could not acquire a surface from the surface producer " + FML_LOG(ERROR) << "Could not acquire a surface from the surface producer " "of size: " << physical_size.width() << "x" << physical_size.height(); return nullptr; @@ -185,7 +185,7 @@ SceneUpdateContext::ExecutePaintTasks(CompositorContext::ScopedFrame& frame) { TRACE_EVENT0("flutter", "SceneUpdateContext::ExecutePaintTasks"); std::vector> surfaces_to_submit; for (auto& task : paint_tasks_) { - FXL_DCHECK(task.surface); + FML_DCHECK(task.surface); SkCanvas* canvas = task.surface->GetSkiaSurface()->getCanvas(); Layer::PaintContext context = {*canvas, frame.context().frame_time(), frame.context().engine_time(), @@ -214,7 +214,7 @@ SceneUpdateContext::Entity::Entity(SceneUpdateContext& context) } SceneUpdateContext::Entity::~Entity() { - FXL_DCHECK(context_.top_entity_ == this); + FML_DCHECK(context_.top_entity_ == this); context_.top_entity_ = previous_entity_; } @@ -302,7 +302,7 @@ SceneUpdateContext::Frame::~Frame() { } void SceneUpdateContext::Frame::AddPaintedLayer(Layer* layer) { - FXL_DCHECK(layer->needs_painting()); + FML_DCHECK(layer->needs_painting()); paint_layers_.push_back(layer); paint_bounds_.join(layer->paint_bounds()); } diff --git a/flow/scene_update_context.h b/flow/scene_update_context.h index 23beb0a88..ac9659476 100644 --- a/flow/scene_update_context.h +++ b/flow/scene_update_context.h @@ -10,9 +10,9 @@ #include #include "flutter/flow/compositor_context.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/logging.h" +#include "flutter/fml/macros.h" #include "lib/ui/scenic/cpp/resources.h" #include "third_party/skia/include/core/SkRect.h" #include "third_party/skia/include/core/SkSurface.h" @@ -142,7 +142,7 @@ class SceneUpdateContext { // CPU wait. Once Vulkan semaphores are available, this method must return // void and the implementation must submit surfaces on its own as soon as the // specific canvas operations are done. - FXL_WARN_UNUSED_RESULT + FML_WARN_UNUSED_RESULT std::vector> ExecutePaintTasks( CompositorContext::ScopedFrame& frame); @@ -170,10 +170,10 @@ class SceneUpdateContext { std::vector paint_layers); void SetShapeColor(scenic::ShapeNode& shape_node, SkColor color); scenic::Image* GenerateImageIfNeeded(SkColor color, - SkScalar scale_x, - SkScalar scale_y, - const SkRect& paint_bounds, - std::vector paint_layers); + SkScalar scale_x, + SkScalar scale_y, + const SkRect& paint_bounds, + std::vector paint_layers); Entity* top_entity_ = nullptr; float top_scale_x_ = 1.f; @@ -189,7 +189,7 @@ class SceneUpdateContext { // Save ExportNodes so we can dispose them in our destructor. std::set export_nodes_; - FXL_DISALLOW_COPY_AND_ASSIGN(SceneUpdateContext); + FML_DISALLOW_COPY_AND_ASSIGN(SceneUpdateContext); }; } // namespace flow diff --git a/flow/skia_gpu_object.cc b/flow/skia_gpu_object.cc index ce2312f92..bf9d9a8ec 100644 --- a/flow/skia_gpu_object.cc +++ b/flow/skia_gpu_object.cc @@ -8,8 +8,8 @@ namespace flow { -SkiaUnrefQueue::SkiaUnrefQueue(fxl::RefPtr task_runner, - fxl::TimeDelta delay) +SkiaUnrefQueue::SkiaUnrefQueue(fml::RefPtr task_runner, + fml::TimeDelta delay) : task_runner_(std::move(task_runner)), drain_delay_(delay), drain_pending_(false) {} @@ -24,7 +24,7 @@ void SkiaUnrefQueue::Unref(SkRefCnt* object) { if (!drain_pending_) { drain_pending_ = true; task_runner_->PostDelayedTask( - [strong = fxl::Ref(this)]() { strong->Drain(); }, drain_delay_); + [strong = fml::Ref(this)]() { strong->Drain(); }, drain_delay_); } } diff --git a/flow/skia_gpu_object.h b/flow/skia_gpu_object.h index 4711f80c6..7379b7936 100644 --- a/flow/skia_gpu_object.h +++ b/flow/skia_gpu_object.h @@ -8,16 +8,16 @@ #include #include +#include "flutter/fml/memory/ref_counted.h" #include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/task_runner.h" -#include "lib/fxl/memory/ref_ptr.h" #include "third_party/skia/include/core/SkRefCnt.h" namespace flow { // A queue that holds Skia objects that must be destructed on the the given task // runner. -class SkiaUnrefQueue : public fxl::RefCountedThreadSafe { +class SkiaUnrefQueue : public fml::RefCountedThreadSafe { public: void Unref(SkRefCnt* object); @@ -29,20 +29,20 @@ class SkiaUnrefQueue : public fxl::RefCountedThreadSafe { void Drain(); private: - const fxl::RefPtr task_runner_; - const fxl::TimeDelta drain_delay_; + const fml::RefPtr task_runner_; + const fml::TimeDelta drain_delay_; std::mutex mutex_; std::deque objects_; bool drain_pending_; - SkiaUnrefQueue(fxl::RefPtr task_runner, - fxl::TimeDelta delay); + SkiaUnrefQueue(fml::RefPtr task_runner, + fml::TimeDelta delay); ~SkiaUnrefQueue(); - FRIEND_REF_COUNTED_THREAD_SAFE(SkiaUnrefQueue); - FRIEND_MAKE_REF_COUNTED(SkiaUnrefQueue); - FXL_DISALLOW_COPY_AND_ASSIGN(SkiaUnrefQueue); + FML_FRIEND_REF_COUNTED_THREAD_SAFE(SkiaUnrefQueue); + FML_FRIEND_MAKE_REF_COUNTED(SkiaUnrefQueue); + FML_DISALLOW_COPY_AND_ASSIGN(SkiaUnrefQueue); }; /// An object whose deallocation needs to be performed on an specific unref @@ -55,9 +55,9 @@ class SkiaGPUObject { SkiaGPUObject() = default; - SkiaGPUObject(sk_sp object, fxl::RefPtr queue) + SkiaGPUObject(sk_sp object, fml::RefPtr queue) : object_(std::move(object)), queue_(std::move(queue)) { - FXL_DCHECK(queue_ && object_); + FML_DCHECK(queue_ && object_); } SkiaGPUObject(SkiaGPUObject&&) = default; @@ -73,14 +73,14 @@ class SkiaGPUObject { queue_->Unref(object_.release()); } queue_ = nullptr; - FXL_DCHECK(object_ == nullptr); + FML_DCHECK(object_ == nullptr); } private: sk_sp object_; - fxl::RefPtr queue_; + fml::RefPtr queue_; - FXL_DISALLOW_COPY_AND_ASSIGN(SkiaGPUObject); + FML_DISALLOW_COPY_AND_ASSIGN(SkiaGPUObject); }; } // namespace flow diff --git a/flow/texture.h b/flow/texture.h index 0e8b3eaeb..92e0130da 100644 --- a/flow/texture.h +++ b/flow/texture.h @@ -7,8 +7,8 @@ #include +#include "flutter/fml/macros.h" #include "flutter/fml/synchronization/waitable_event.h" -#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { @@ -38,7 +38,7 @@ class Texture { private: int64_t id_; - FXL_DISALLOW_COPY_AND_ASSIGN(Texture); + FML_DISALLOW_COPY_AND_ASSIGN(Texture); }; class TextureRegistry { @@ -64,7 +64,7 @@ class TextureRegistry { private: std::map> mapping_; - FXL_DISALLOW_COPY_AND_ASSIGN(TextureRegistry); + FML_DISALLOW_COPY_AND_ASSIGN(TextureRegistry); }; } // namespace flow diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 0551319ea..6d605ddf5 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -4,8 +4,11 @@ source_set("fml") { sources = [ + "arraysize.h", "build_config.h", "closure.h", + "command_line.cc", + "command_line.h", "compiler_specific.h", "eintr_wrapper.h", "export.h", @@ -18,6 +21,7 @@ source_set("fml") { "log_settings_state.cc", "logging.cc", "logging.h", + "make_copyable.h", "mapping.cc", "mapping.h", "memory/ref_counted.h", @@ -35,6 +39,8 @@ source_set("fml") { "native_library.h", "paths.cc", "paths.h", + "string_view.cc", + "string_view.h", "synchronization/thread_annotations.h", "synchronization/thread_checker.h", "synchronization/waitable_event.cc", @@ -55,7 +61,6 @@ source_set("fml") { ] deps = [ - "//garnet/public/lib/fxl", "//third_party/dart/runtime:dart_api", # These need to be in sync with the Fuchsia buildroot. @@ -141,6 +146,7 @@ source_set("fml") { "platform/posix/file_posix.cc", "platform/posix/mapping_posix.cc", "platform/posix/native_library_posix.cc", + "platform/posix/paths_posix.cc", ] } } @@ -149,9 +155,11 @@ executable("fml_unittests") { testonly = true sources = [ + "command_line_unittest.cc", "memory/ref_counted_unittest.cc", "memory/weak_ptr_unittest.cc", "message_loop_unittests.cc", + "string_view_unittest.cc", "synchronization/thread_annotations_unittest.cc", "synchronization/thread_checker_unittest.cc", "synchronization/waitable_event_unittest.cc", @@ -165,7 +173,6 @@ executable("fml_unittests") { deps = [ "$flutter_root/fml", "$flutter_root/testing", - "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", ] } diff --git a/fml/arraysize.h b/fml/arraysize.h new file mode 100644 index 000000000..845736988 --- /dev/null +++ b/fml/arraysize.h @@ -0,0 +1,16 @@ +// Copyright 2016 The Fuchsia 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_FML_ARRAYSIZE_H_ +#define FLUTTER_FML_ARRAYSIZE_H_ + +#include + +#ifndef arraysize +template +char (&ArraySizeHelper(T (&array)[N]))[N]; +#define arraysize(array) (sizeof(ArraySizeHelper(array))) +#endif + +#endif // FLUTTER_FML_ARRAYSIZE_H_ diff --git a/fml/command_line.cc b/fml/command_line.cc new file mode 100644 index 000000000..24012867e --- /dev/null +++ b/fml/command_line.cc @@ -0,0 +1,165 @@ +// Copyright 2016 The Fuchsia 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/fml/command_line.h" + +namespace fml { + +// CommandLine ----------------------------------------------------------------- + +CommandLine::Option::Option(const std::string& name) : name(name) {} + +CommandLine::Option::Option(const std::string& name, const std::string& value) + : name(name), value(value) {} + +CommandLine::CommandLine() = default; + +CommandLine::CommandLine(const CommandLine& from) = default; + +CommandLine::CommandLine(CommandLine&& from) = default; + +CommandLine::CommandLine(const std::string& argv0, + const std::vector