From 3aa7522c11addb894b1b02ef8a6238c8ec5d585a Mon Sep 17 00:00:00 2001 From: George Kulakowski Date: Mon, 11 Sep 2017 15:58:48 -0700 Subject: [PATCH] Rename ftl to fxl in Fuchsia specific code (#4090) --- assets/directory_asset_bundle.cc | 10 +-- assets/directory_asset_bundle.h | 4 +- assets/unzipper_provider.cc | 4 +- assets/zip_asset_store.cc | 8 +-- assets/zip_asset_store.h | 8 +-- common/settings.cc | 6 +- common/threads.cc | 20 +++--- common/threads.h | 34 ++++----- content_handler/BUILD.gn | 2 +- content_handler/app.cc | 16 ++--- content_handler/app.h | 8 +-- .../application_controller_impl.cc | 12 ++-- content_handler/application_controller_impl.h | 6 +- content_handler/rasterizer.cc | 2 +- content_handler/rasterizer.h | 8 +-- content_handler/runtime_holder.cc | 58 +++++++-------- content_handler/runtime_holder.h | 18 ++--- content_handler/service_protocol_hooks.cc | 2 +- content_handler/service_protocol_hooks.h | 2 +- content_handler/session_connection.cc | 8 +-- content_handler/session_connection.h | 14 ++-- content_handler/vulkan_rasterizer.cc | 18 ++--- content_handler/vulkan_rasterizer.h | 8 +-- content_handler/vulkan_surface.cc | 24 +++---- content_handler/vulkan_surface.h | 4 +- content_handler/vulkan_surface_pool.cc | 6 +- content_handler/vulkan_surface_pool.h | 4 +- content_handler/vulkan_surface_producer.cc | 24 +++---- content_handler/vulkan_surface_producer.h | 6 +- flow/BUILD.gn | 2 +- flow/compositor_context.h | 6 +- flow/debug_print.h | 2 +- flow/export_node.cc | 14 ++-- flow/export_node.h | 20 +++--- flow/instrumentation.cc | 16 ++--- flow/instrumentation.h | 24 +++---- flow/layers/backdrop_filter_layer.cc | 2 +- flow/layers/backdrop_filter_layer.h | 2 +- flow/layers/child_scene_layer.cc | 4 +- 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/layer.h | 8 +-- 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_model_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/transform_layer.cc | 4 +- flow/layers/transform_layer.h | 2 +- flow/matrix_decomposition.h | 4 +- flow/process_info.h | 2 +- flow/raster_cache.cc | 2 +- flow/raster_cache.h | 8 +-- flow/raster_cache_key.h | 2 +- flow/scene_update_context.cc | 12 ++-- flow/scene_update_context.h | 10 +-- fml/icu_util.cc | 12 ++-- fml/icu_util.h | 2 +- fml/mapping.cc | 8 +-- fml/mapping.h | 10 +-- fml/message_loop.cc | 16 ++--- fml/message_loop.h | 14 ++-- fml/message_loop_impl.cc | 36 +++++----- fml/message_loop_impl.h | 38 +++++----- fml/message_loop_unittests.cc | 40 +++++------ fml/platform/android/jni_util.cc | 14 ++-- fml/platform/android/jni_util.h | 2 +- fml/platform/android/jni_weak_ref.cc | 6 +- fml/platform/android/message_loop_android.cc | 16 ++--- fml/platform/android/message_loop_android.h | 14 ++-- fml/platform/android/scoped_java_ref.cc | 14 ++-- fml/platform/android/scoped_java_ref.h | 8 +-- fml/platform/darwin/cf_utils.h | 4 +- fml/platform/darwin/message_loop_darwin.h | 6 +- fml/platform/darwin/platform_version.h | 2 +- fml/platform/darwin/resource_mapping_darwin.h | 4 +- fml/platform/darwin/scoped_block.h | 4 +- fml/platform/darwin/scoped_nsobject.h | 8 +-- fml/platform/linux/message_loop_linux.cc | 16 ++--- fml/platform/linux/message_loop_linux.h | 12 ++-- fml/platform/linux/paths_linux.cc | 2 +- fml/platform/linux/timerfd.cc | 4 +- fml/platform/linux/timerfd.h | 4 +- fml/platform/win/message_loop_win.cc | 12 ++-- fml/platform/win/message_loop_win.h | 10 +-- fml/platform/win/paths_win.cc | 2 +- fml/task_observer.h | 2 +- fml/task_runner.cc | 16 ++--- fml/task_runner.h | 20 +++--- fml/thread.cc | 10 +-- fml/thread.h | 10 +-- fml/thread_local.h | 20 +++--- fml/trace_event.h | 4 +- lib/io/dart_io.h | 4 +- lib/ui/compositing/scene.cc | 4 +- lib/ui/compositing/scene.h | 4 +- lib/ui/compositing/scene_builder.cc | 10 +-- 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 | 6 +- lib/ui/dart_runtime_hooks.h | 4 +- lib/ui/dart_ui.cc | 4 +- lib/ui/dart_ui.h | 4 +- lib/ui/painting/canvas.cc | 6 +- lib/ui/painting/canvas.h | 4 +- lib/ui/painting/gradient.cc | 10 +-- lib/ui/painting/gradient.h | 2 +- lib/ui/painting/image.h | 6 +- lib/ui/painting/image_decoding.cc | 10 +-- 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 | 2 +- lib/ui/painting/mask_filter.cc | 4 +- lib/ui/painting/mask_filter.h | 4 +- lib/ui/painting/matrix.cc | 4 +- lib/ui/painting/paint.cc | 12 ++-- lib/ui/painting/path.cc | 8 +-- lib/ui/painting/path.h | 10 +-- 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/resource_context.cc | 4 +- lib/ui/painting/rrect.cc | 4 +- lib/ui/painting/shader.h | 2 +- lib/ui/painting/utils.cc | 6 +- lib/ui/painting/utils.h | 8 +-- lib/ui/painting/vertices.cc | 4 +- lib/ui/painting/vertices.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/font_collection.cc | 6 +- lib/ui/text/font_collection.h | 8 +-- lib/ui/text/paragraph.cc | 4 +- lib/ui/text/paragraph.h | 10 +-- lib/ui/text/paragraph_builder.cc | 12 ++-- lib/ui/text/paragraph_builder.h | 6 +- lib/ui/text/paragraph_impl_blink.cc | 8 +-- lib/ui/text/paragraph_impl_txt.cc | 4 +- lib/ui/text/text_box.cc | 4 +- lib/ui/ui_dart_state.cc | 2 +- lib/ui/ui_dart_state.h | 2 +- lib/ui/window/platform_message.cc | 4 +- lib/ui/window/platform_message.h | 14 ++-- lib/ui/window/platform_message_response.h | 6 +- .../window/platform_message_response_dart.cc | 16 ++--- lib/ui/window/pointer_data_packet.h | 4 +- lib/ui/window/window.cc | 16 ++--- lib/ui/window/window.h | 10 +-- runtime/asset_font_selector.cc | 6 +- runtime/asset_font_selector.h | 6 +- runtime/dart_controller.cc | 16 ++--- runtime/dart_controller.h | 4 +- runtime/dart_init.cc | 56 +++++++-------- runtime/dart_init.h | 6 +- runtime/dart_service_isolate.cc | 28 ++++---- runtime/embedder_resources.cc | 10 +-- runtime/platform_impl.h | 4 +- runtime/runtime_controller.cc | 8 +-- runtime/runtime_controller.h | 10 +-- runtime/runtime_delegate.h | 2 +- runtime/runtime_init.cc | 4 +- runtime/test_font_selector.h | 4 +- shell/common/animator.cc | 24 +++---- shell/common/animator.h | 22 +++--- shell/common/diagnostic/diagnostic_server.cc | 20 +++--- shell/common/engine.cc | 46 ++++++------ shell/common/engine.h | 28 ++++---- shell/common/null_rasterizer.cc | 14 ++-- shell/common/null_rasterizer.h | 20 +++--- shell/common/platform_view.cc | 22 +++--- shell/common/platform_view.h | 16 ++--- .../common/platform_view_service_protocol.cc | 8 +-- shell/common/platform_view_service_protocol.h | 2 +- shell/common/rasterizer.h | 18 ++--- shell/common/shell.cc | 54 +++++++------- shell/common/shell.h | 38 +++++----- shell/common/skia_event_tracer_impl.cc | 4 +- shell/common/surface.cc | 4 +- shell/common/surface.h | 6 +- shell/common/switches.cc | 8 +-- shell/common/switches.h | 4 +- shell/common/tracing_controller.cc | 2 +- shell/common/tracing_controller.h | 4 +- shell/common/vsync_waiter.h | 6 +- shell/common/vsync_waiter_fallback.cc | 24 +++---- shell/common/vsync_waiter_fallback.h | 12 ++-- shell/gpu/gpu_rasterizer.cc | 12 ++-- shell/gpu/gpu_rasterizer.h | 22 +++--- shell/gpu/gpu_surface_gl.cc | 18 ++--- 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 | 4 +- shell/gpu/gpu_surface_vulkan.h | 10 +-- shell/platform/android/android_context_gl.cc | 28 ++++---- shell/platform/android/android_context_gl.h | 20 +++--- .../platform/android/android_environment_gl.h | 8 +-- .../platform/android/android_native_window.h | 10 +-- shell/platform/android/android_surface.h | 4 +- shell/platform/android/android_surface_gl.cc | 32 ++++----- 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 | 6 +- .../platform/android/android_surface_vulkan.h | 10 +-- shell/platform/android/flutter_main.cc | 8 +-- shell/platform/android/library_loader.cc | 6 +- .../platform/android/platform_view_android.cc | 72 +++++++++---------- .../platform/android/platform_view_android.h | 8 +-- .../android/platform_view_android_jni.cc | 12 ++-- .../android/platform_view_android_jni.h | 2 +- .../platform/android/vsync_waiter_android.cc | 26 +++---- shell/platform/android/vsync_waiter_android.h | 10 +-- .../platform/darwin/common/process_info_mac.h | 4 +- .../darwin/desktop/platform_view_mac.h | 4 +- .../darwin/desktop/vsync_waiter_mac.cc | 10 +-- .../darwin/desktop/vsync_waiter_mac.h | 4 +- .../framework/Source/accessibility_bridge.h | 4 +- .../ios/framework/Source/flutter_main_ios.h | 2 +- .../framework/Source/flutter_touch_mapper.h | 4 +- .../Source/platform_message_router.h | 6 +- .../ios/framework/Source/vsync_waiter_ios.h | 4 +- shell/platform/darwin/ios/ios_gl_context.h | 4 +- shell/platform/darwin/ios/ios_surface.h | 4 +- shell/platform/darwin/ios/ios_surface_gl.h | 4 +- .../darwin/ios/ios_surface_software.h | 4 +- shell/platform/darwin/ios/platform_view_ios.h | 18 ++--- shell/platform/embedder/embedder.cc | 10 +-- .../embedder/platform_view_embedder.cc | 2 +- .../embedder/platform_view_embedder.h | 4 +- shell/platform/linux/main_linux.cc | 12 ++-- shell/testing/platform_view_test.h | 6 +- shell/testing/test_runner.h | 6 +- shell/testing/testing.cc | 2 +- shell/testing/testing.h | 4 +- sky/engine/core/rendering/InlineFlowBox.h | 2 +- sky/engine/core/rendering/RenderBox.h | 2 +- sky/engine/public/platform/WebBlendMode.h | 2 +- sky/engine/wtf/dtoa/bignum-dtoa.cc | 40 +++++------ sky/engine/wtf/dtoa/bignum.cc | 10 +-- sky/engine/wtf/dtoa/bignum.h | 6 +- sky/engine/wtf/dtoa/double-conversion.h | 4 +- sky/engine/wtf/dtoa/strtod.cc | 4 +- sky/engine/wtf/dtoa/utils.h | 4 +- synchronization/debug_thread_checker.h | 6 +- synchronization/pipeline.h | 26 +++---- synchronization/semaphore.cc | 12 ++-- synchronization/semaphore.h | 10 +-- testing/run_tests.sh | 2 +- .../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/benchmarks/utils.cc | 8 +-- third_party/txt/benchmarks/utils.h | 6 +- third_party/txt/src/log/log.h | 14 ++-- .../txt/src/txt/asset_data_provider.cc | 2 +- third_party/txt/src/txt/asset_data_provider.h | 4 +- third_party/txt/src/txt/asset_font_manager.cc | 24 +++---- third_party/txt/src/txt/asset_font_manager.h | 4 +- .../txt/src/txt/asset_font_style_set.cc | 6 +- .../txt/src/txt/asset_font_style_set.h | 4 +- .../src/txt/directory_asset_data_provider.cc | 2 +- .../src/txt/directory_asset_data_provider.h | 4 +- third_party/txt/src/txt/font_collection.cc | 2 +- third_party/txt/src/txt/font_collection.h | 4 +- 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 | 6 +- third_party/txt/src/txt/paragraph.h | 8 +-- 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 +- .../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/utils.cc | 8 +-- third_party/txt/tests/utils.h | 6 +- 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 | 10 +-- 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 | 10 +-- vulkan/vulkan_surface.cc | 4 +- vulkan/vulkan_surface.h | 4 +- vulkan/vulkan_swapchain.cc | 62 ++++++++-------- vulkan/vulkan_swapchain.h | 8 +-- vulkan/vulkan_utilities.h | 2 +- vulkan/vulkan_window.cc | 30 ++++---- vulkan/vulkan_window.h | 12 ++-- 326 files changed, 1507 insertions(+), 1507 deletions(-) diff --git a/assets/directory_asset_bundle.cc b/assets/directory_asset_bundle.cc index c54d842223d68..213a977bf41f6 100644 --- a/assets/directory_asset_bundle.cc +++ b/assets/directory_asset_bundle.cc @@ -9,10 +9,10 @@ #include -#include "lib/ftl/files/eintr_wrapper.h" -#include "lib/ftl/files/file.h" -#include "lib/ftl/files/path.h" -#include "lib/ftl/files/unique_fd.h" +#include "lib/fxl/files/eintr_wrapper.h" +#include "lib/fxl/files/file.h" +#include "lib/fxl/files/path.h" +#include "lib/fxl/files/unique_fd.h" namespace blink { @@ -33,7 +33,7 @@ std::string DirectoryAssetBundle::GetPathForAsset( const std::string& asset_name) { std::string asset_path = files::SimplifyPath(directory_ + "/" + asset_name); if (asset_path.find(directory_) != 0u) { - FTL_LOG(ERROR) << "Asset name '" << asset_name + FXL_LOG(ERROR) << "Asset name '" << asset_name << "' attempted to traverse outside asset bundle."; return std::string(); } diff --git a/assets/directory_asset_bundle.h b/assets/directory_asset_bundle.h index c8774987af6de..0bbe5dc3918f5 100644 --- a/assets/directory_asset_bundle.h +++ b/assets/directory_asset_bundle.h @@ -8,7 +8,7 @@ #include #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace blink { @@ -24,7 +24,7 @@ class DirectoryAssetBundle { const std::string directory_; - FTL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle); + FXL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle); }; } // namespace blink diff --git a/assets/unzipper_provider.cc b/assets/unzipper_provider.cc index dc93d721cfa54..8ed023f9a20e9 100644 --- a/assets/unzipper_provider.cc +++ b/assets/unzipper_provider.cc @@ -4,7 +4,7 @@ #include "flutter/assets/unzipper_provider.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "third_party/zlib/contrib/minizip/unzip.h" namespace blink { @@ -13,7 +13,7 @@ UnzipperProvider GetUnzipperProviderForPath(std::string zip_path) { return [zip_path]() { zip::UniqueUnzipper unzipper(unzOpen2(zip_path.c_str(), nullptr)); if (!unzipper.is_valid()) - FTL_LOG(ERROR) << "Unable to open zip file: " << zip_path; + FXL_LOG(ERROR) << "Unable to open zip file: " << zip_path; return unzipper; }; } diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index 90541f8a49365..e3ebefb730abe 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -10,8 +10,8 @@ #include #include -#include "lib/ftl/files/eintr_wrapper.h" -#include "lib/ftl/files/unique_fd.h" +#include "lib/fxl/files/eintr_wrapper.h" +#include "lib/fxl/files/unique_fd.h" #include "flutter/glue/trace_event.h" #include "lib/zip/unique_unzipper.h" @@ -43,13 +43,13 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, result = unzGoToFilePos(unzipper.get(), &(found->second.file_pos)); if (result != UNZ_OK) { - FTL_LOG(WARNING) << "unzGetCurrentFileInfo failed, error=" << result; + FXL_LOG(WARNING) << "unzGetCurrentFileInfo failed, error=" << result; return false; } result = unzOpenCurrentFile(unzipper.get()); if (result != UNZ_OK) { - FTL_LOG(WARNING) << "unzOpenCurrentFile failed, error=" << result; + FXL_LOG(WARNING) << "unzOpenCurrentFile failed, error=" << result; return false; } diff --git a/assets/zip_asset_store.h b/assets/zip_asset_store.h index 971fafe90756e..1ffda483ba9b7 100644 --- a/assets/zip_asset_store.h +++ b/assets/zip_asset_store.h @@ -9,13 +9,13 @@ #include #include "flutter/assets/unzipper_provider.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/ref_counted.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" #include "third_party/zlib/contrib/minizip/unzip.h" namespace blink { -class ZipAssetStore : public ftl::RefCountedThreadSafe { +class ZipAssetStore : public fxl::RefCountedThreadSafe { public: explicit ZipAssetStore(UnzipperProvider unzipper_provider); ~ZipAssetStore(); @@ -35,7 +35,7 @@ class ZipAssetStore : public ftl::RefCountedThreadSafe { void BuildStatCache(); - FTL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); + FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); }; } // namespace blink diff --git a/common/settings.cc b/common/settings.cc index 4295bcbc3e749..0198f714cbaad 100644 --- a/common/settings.cc +++ b/common/settings.cc @@ -6,7 +6,7 @@ #include -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace blink { namespace { @@ -16,12 +16,12 @@ Settings* g_settings = nullptr; } // namespace const Settings& Settings::Get() { - FTL_CHECK(g_settings); + FXL_CHECK(g_settings); return *g_settings; } void Settings::Set(const Settings& settings) { - FTL_CHECK(!g_settings); + FXL_CHECK(!g_settings); g_settings = new Settings(); *g_settings = settings; } diff --git a/common/threads.cc b/common/threads.cc index df22653746c28..3634d8d7c8723 100644 --- a/common/threads.cc +++ b/common/threads.cc @@ -15,10 +15,10 @@ Threads* g_threads = nullptr; Threads::Threads() {} -Threads::Threads(ftl::RefPtr platform, - ftl::RefPtr gpu, - ftl::RefPtr ui, - ftl::RefPtr io) +Threads::Threads(fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io) : platform_(std::move(platform)), gpu_(std::move(gpu)), ui_(std::move(ui)), @@ -26,29 +26,29 @@ Threads::Threads(ftl::RefPtr platform, Threads::~Threads() {} -const ftl::RefPtr& Threads::Platform() { +const fxl::RefPtr& Threads::Platform() { return Get().platform_; } -const ftl::RefPtr& Threads::Gpu() { +const fxl::RefPtr& Threads::Gpu() { return Get().gpu_; } -const ftl::RefPtr& Threads::UI() { +const fxl::RefPtr& Threads::UI() { return Get().ui_; } -const ftl::RefPtr& Threads::IO() { +const fxl::RefPtr& Threads::IO() { return Get().io_; } const Threads& Threads::Get() { - FTL_CHECK(g_threads); + FXL_CHECK(g_threads); return *g_threads; } void Threads::Set(const Threads& threads) { - FTL_CHECK(!g_threads); + FXL_CHECK(!g_threads); g_threads = new Threads(); *g_threads = threads; } diff --git a/common/threads.h b/common/threads.h index f9058b17cab26..456a5eba8ad97 100644 --- a/common/threads.h +++ b/common/threads.h @@ -5,42 +5,42 @@ #ifndef FLUTTER_COMMON_THREADS_H_ #define FLUTTER_COMMON_THREADS_H_ -#include "lib/ftl/tasks/task_runner.h" +#include "lib/fxl/tasks/task_runner.h" #define ASSERT_IS_PLATFORM_THREAD \ - FTL_DCHECK(::blink::Threads::Platform()->RunsTasksOnCurrentThread()); + FXL_DCHECK(::blink::Threads::Platform()->RunsTasksOnCurrentThread()); #define ASSERT_IS_GPU_THREAD \ - FTL_DCHECK(::blink::Threads::Gpu()->RunsTasksOnCurrentThread()); + FXL_DCHECK(::blink::Threads::Gpu()->RunsTasksOnCurrentThread()); #define ASSERT_IS_UI_THREAD \ - FTL_DCHECK(::blink::Threads::UI()->RunsTasksOnCurrentThread()); + FXL_DCHECK(::blink::Threads::UI()->RunsTasksOnCurrentThread()); #define ASSERT_IS_IO_THREAD \ - FTL_DCHECK(::blink::Threads::IO()->RunsTasksOnCurrentThread()); + FXL_DCHECK(::blink::Threads::IO()->RunsTasksOnCurrentThread()); namespace blink { class Threads { public: Threads(); - Threads(ftl::RefPtr platform, - ftl::RefPtr gpu, - ftl::RefPtr ui, - ftl::RefPtr io); + Threads(fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io); ~Threads(); - static const ftl::RefPtr& Platform(); - static const ftl::RefPtr& Gpu(); - static const ftl::RefPtr& UI(); - static const ftl::RefPtr& IO(); + static const fxl::RefPtr& Platform(); + static const fxl::RefPtr& Gpu(); + static const fxl::RefPtr& UI(); + static const fxl::RefPtr& IO(); static void Set(const Threads& settings); private: static const Threads& Get(); - ftl::RefPtr platform_; - ftl::RefPtr gpu_; - ftl::RefPtr ui_; - ftl::RefPtr io_; + fxl::RefPtr platform_; + fxl::RefPtr gpu_; + fxl::RefPtr ui_; + fxl::RefPtr io_; }; } // namespace blink diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index ee5c6fae08175..a8f31c7a50693 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -59,7 +59,7 @@ template("flutter_content_handler") { "//flutter/sky/engine/platform", "//flutter/vulkan", "//garnet/public/dart-pkg/fuchsia", - "//garnet/public/lib/ftl", + "//garnet/public/lib/fxl", "//garnet/public/lib/icu_data/cpp", "//garnet/public/lib/mtl", "//garnet/public/lib/zip", diff --git a/content_handler/app.cc b/content_handler/app.cc index ed8d070ed7696..e171ff0aa3c91 100644 --- a/content_handler/app.cc +++ b/content_handler/app.cc @@ -10,8 +10,8 @@ #include "flutter/common/settings.h" #include "flutter/common/threads.h" #include "flutter/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/tasks/task_runner.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/tasks/task_runner.h" #include "lib/icu_data/cpp/icu_data.h" #include "lib/mtl/tasks/message_loop.h" @@ -43,8 +43,8 @@ App::App() { auto gpu_thread_success = gpu_thread_->Run(); auto io_thread_success = io_thread_->Run(); - FTL_CHECK(gpu_thread_success) << "Must be able to create the GPU thread"; - FTL_CHECK(io_thread_success) << "Must be able to create the IO thread"; + FXL_CHECK(gpu_thread_success) << "Must be able to create the GPU thread"; + FXL_CHECK(io_thread_success) << "Must be able to create the IO thread"; auto ui_task_runner = mtl::MessageLoop::GetCurrent()->task_runner(); auto gpu_task_runner = gpu_thread_->TaskRunner(); @@ -58,7 +58,7 @@ App::App() { )); if (!icu_data::Initialize(context_.get())) { - FTL_LOG(ERROR) << "Could not initialize ICU data."; + FXL_LOG(ERROR) << "Could not initialize ICU data."; } blink::Settings settings; @@ -83,13 +83,13 @@ App::~App() { } App& App::Shared() { - FTL_DCHECK(g_app); + FXL_DCHECK(g_app); return *g_app; } void App::WaitForPlatformViewIds( std::vector* platform_view_ids) { - ftl::AutoResetWaitableEvent latch; + fxl::AutoResetWaitableEvent latch; blink::Threads::UI()->PostTask([this, platform_view_ids, &latch]() { WaitForPlatformViewsIdsUIThread(platform_view_ids, &latch); @@ -100,7 +100,7 @@ void App::WaitForPlatformViewIds( void App::WaitForPlatformViewsIdsUIThread( std::vector* platform_view_ids, - ftl::AutoResetWaitableEvent* latch) { + fxl::AutoResetWaitableEvent* latch) { for (auto it = controllers_.begin(); it != controllers_.end(); it++) { ApplicationControllerImpl* controller = it->first; diff --git a/content_handler/app.h b/content_handler/app.h index 532b7ec1b3512..ac6949046b42a 100644 --- a/content_handler/app.h +++ b/content_handler/app.h @@ -11,8 +11,8 @@ #include "lib/app/cpp/application_context.h" #include "lib/app/fidl/application_runner.fidl.h" #include "flutter/content_handler/application_controller_impl.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/synchronization/waitable_event.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/synchronization/waitable_event.h" #include "lib/mtl/threading/thread.h" namespace flutter_runner { @@ -44,7 +44,7 @@ class App : public app::ApplicationRunner { private: void WaitForPlatformViewsIdsUIThread( std::vector* platform_view_ids, - ftl::AutoResetWaitableEvent* latch); + fxl::AutoResetWaitableEvent* latch); void UpdateProcessLabel(); std::unique_ptr context_; @@ -56,7 +56,7 @@ class App : public app::ApplicationRunner { controllers_; std::string base_label_; - FTL_DISALLOW_COPY_AND_ASSIGN(App); + FXL_DISALLOW_COPY_AND_ASSIGN(App); }; } // namespace flutter_runner diff --git a/content_handler/application_controller_impl.cc b/content_handler/application_controller_impl.cc index a164e7c38683d..15f5dfd9cae26 100644 --- a/content_handler/application_controller_impl.cc +++ b/content_handler/application_controller_impl.cc @@ -12,7 +12,7 @@ #include "lib/app/cpp/connect.h" #include "flutter/content_handler/app.h" #include "flutter/content_handler/runtime_holder.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "lib/mtl/vmo/vector.h" namespace flutter_runner { @@ -33,7 +33,7 @@ ApplicationControllerImpl::ApplicationControllerImpl( std::vector bundle; if (!mtl::VectorFromVmo(std::move(application->data), &bundle)) { - FTL_LOG(ERROR) << "Failed to receive bundle."; + FXL_LOG(ERROR) << "Failed to receive bundle."; return; } @@ -61,7 +61,7 @@ ApplicationControllerImpl::ApplicationControllerImpl( mxio_ns_t* mxio_ns = SetupNamespace(startup_info->flat_namespace); if (mxio_ns == nullptr) { - FTL_LOG(ERROR) << "Failed to initialize namespace"; + FXL_LOG(ERROR) << "Failed to initialize namespace"; } url_ = startup_info->launch_info->url; @@ -81,7 +81,7 @@ mxio_ns_t* ApplicationControllerImpl::SetupNamespace( mxio_ns_t* mxio_namespc; mx_status_t status = mxio_ns_create(&mxio_namespc); if (status != MX_OK) { - FTL_LOG(ERROR) << "Failed to create namespace"; + FXL_LOG(ERROR) << "Failed to create namespace"; return nullptr; } for (size_t i = 0; i < flat->paths.size(); ++i) { @@ -94,7 +94,7 @@ mxio_ns_t* ApplicationControllerImpl::SetupNamespace( const char* path = flat->paths[i].data(); status = mxio_ns_bind(mxio_namespc, path, dir_handle); if (status != MX_OK) { - FTL_LOG(ERROR) << "Failed to bind " << flat->paths[i] << " to namespace"; + FXL_LOG(ERROR) << "Failed to bind " << flat->paths[i] << " to namespace"; mx_handle_close(dir_handle); mxio_ns_destroy(mxio_namespc); return nullptr; @@ -111,7 +111,7 @@ void ApplicationControllerImpl::Kill() { } void ApplicationControllerImpl::Detach() { - binding_.set_connection_error_handler(ftl::Closure()); + binding_.set_connection_error_handler(fxl::Closure()); } void ApplicationControllerImpl::Wait(const WaitCallback& callback) { diff --git a/content_handler/application_controller_impl.h b/content_handler/application_controller_impl.h index eaa8ff20506a7..4c5ba1a0639ad 100644 --- a/content_handler/application_controller_impl.h +++ b/content_handler/application_controller_impl.h @@ -17,8 +17,8 @@ #include "dart/runtime/include/dart_api.h" #include "lib/fidl/cpp/bindings/binding.h" #include "lib/fidl/cpp/bindings/binding_set.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/synchronization/waitable_event.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/synchronization/waitable_event.h" namespace flutter_runner { class App; @@ -68,7 +68,7 @@ class ApplicationControllerImpl : public app::ApplicationController, std::vector wait_callbacks_; - FTL_DISALLOW_COPY_AND_ASSIGN(ApplicationControllerImpl); + FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationControllerImpl); }; } // namespace flutter_runner diff --git a/content_handler/rasterizer.cc b/content_handler/rasterizer.cc index ac22fa0869807..b720809b17a45 100644 --- a/content_handler/rasterizer.cc +++ b/content_handler/rasterizer.cc @@ -11,7 +11,7 @@ Rasterizer::~Rasterizer() = default; std::unique_ptr Rasterizer::Create() { auto vulkan_rasterizer = std::make_unique(); - FTL_CHECK(vulkan_rasterizer) + FXL_CHECK(vulkan_rasterizer) << "The vulkan rasterizer must be correctly initialized."; return vulkan_rasterizer; } diff --git a/content_handler/rasterizer.h b/content_handler/rasterizer.h index f31b65f31b26f..40589244beef2 100644 --- a/content_handler/rasterizer.h +++ b/content_handler/rasterizer.h @@ -9,8 +9,8 @@ #include "lib/ui/scenic/fidl/session.fidl.h" #include "flutter/flow/layers/layer_tree.h" -#include "lib/ftl/functional/closure.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" #include "magenta/system/ulib/mx/include/mx/eventpair.h" namespace flutter_runner { @@ -24,10 +24,10 @@ class Rasterizer { virtual void SetScene( fidl::InterfaceHandle scene_manager, mx::eventpair import_token, - ftl::Closure metrics_changed_callback) = 0; + fxl::Closure metrics_changed_callback) = 0; virtual void Draw(std::unique_ptr layer_tree, - ftl::Closure callback) = 0; + fxl::Closure callback) = 0; }; } // namespace flutter_runner diff --git a/content_handler/runtime_holder.cc b/content_handler/runtime_holder.cc index 3fae5cd15bdd6..d6ef6439dbb14 100644 --- a/content_handler/runtime_holder.cc +++ b/content_handler/runtime_holder.cc @@ -22,9 +22,9 @@ #include "flutter/runtime/dart_init.h" #include "flutter/runtime/runtime_init.h" #include "dart-pkg/zircon/sdk_ext/handle.h" -#include "lib/ftl/functional/make_copyable.h" -#include "lib/ftl/logging.h" -#include "lib/ftl/time/time_delta.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/time/time_delta.h" #include "lib/mtl/vmo/vector.h" #include "lib/zip/create_unzipper.h" #include "third_party/rapidjson/rapidjson/document.h" @@ -88,7 +88,7 @@ RuntimeHolder::RuntimeHolder() RuntimeHolder::~RuntimeHolder() { blink::Threads::Gpu()->PostTask( - ftl::MakeCopyable([rasterizer = std::move(rasterizer_)](){ + fxl::MakeCopyable([rasterizer = std::move(rasterizer_)](){ // Deletes rasterizer. })); } @@ -98,9 +98,9 @@ void RuntimeHolder::Init( std::unique_ptr context, fidl::InterfaceRequest outgoing_services, std::vector bundle) { - FTL_DCHECK(!rasterizer_); + FXL_DCHECK(!rasterizer_); rasterizer_ = Rasterizer::Create(); - FTL_DCHECK(rasterizer_); + FXL_DCHECK(rasterizer_); namespc_ = namespc; context_ = std::move(context); @@ -122,20 +122,20 @@ void RuntimeHolder::Init( } else { std::vector dylib_blob; if (!asset_store_->GetAsBuffer(kDylibKey, &dylib_blob)) { - FTL_LOG(ERROR) << "Failed to extract app dylib"; + FXL_LOG(ERROR) << "Failed to extract app dylib"; return; } mx::vmo dylib_vmo; if (!mtl::VmoFromVector(dylib_blob, &dylib_vmo)) { - FTL_LOG(ERROR) << "Failed to load app dylib"; + FXL_LOG(ERROR) << "Failed to load app dylib"; return; } dlerror(); dylib_handle_ = dlopen_vmo(dylib_vmo.get(), RTLD_LAZY); if (dylib_handle_ == nullptr) { - FTL_LOG(ERROR) << "dlopen failed: " << dlerror(); + FXL_LOG(ERROR) << "dlopen failed: " << dlerror(); return; } vm_snapshot_data = reinterpret_cast( @@ -169,7 +169,7 @@ void RuntimeHolder::CreateView( if (view_listener_binding_.is_bound()) { // TODO(jeffbrown): Refactor this to support multiple view instances // sharing the same underlying root bundle (but with different runtimes). - FTL_LOG(ERROR) << "The view has already been created."; + FXL_LOG(ERROR) << "The view has already been created."; return; } @@ -178,7 +178,7 @@ void RuntimeHolder::CreateView( if (!Dart_IsPrecompiledRuntime()) { if (!asset_store_->GetAsBuffer(kKernelKey, &kernel) && !asset_store_->GetAsBuffer(kSnapshotKey, &snapshot)) { - FTL_LOG(ERROR) << "Unable to load kernel or snapshot from root bundle."; + FXL_LOG(ERROR) << "Unable to load kernel or snapshot from root bundle."; return; } } @@ -187,7 +187,7 @@ void RuntimeHolder::CreateView( mx::eventpair import_token, export_token; mx_status_t status = mx::eventpair::create(0u, &import_token, &export_token); if (status != MX_OK) { - FTL_LOG(ERROR) << "Could not create an event pair."; + FXL_LOG(ERROR) << "Could not create an event pair."; return; } mozart::ViewListenerPtr view_listener; @@ -211,7 +211,7 @@ void RuntimeHolder::CreateView( fidl::InterfaceHandle scene_manager; view_manager_->GetSceneManager(scene_manager.NewRequest()); - blink::Threads::Gpu()->PostTask(ftl::MakeCopyable([ + blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ rasterizer = rasterizer_.get(), // scene_manager = std::move(scene_manager), // import_token = std::move(import_token), // @@ -307,7 +307,7 @@ void RuntimeHolder::Render(std::unique_ptr layer_tree) { frame_rendering_ = true; - layer_tree->set_construction_time(ftl::TimePoint::Now() - + layer_tree->set_construction_time(fxl::TimePoint::Now() - last_begin_frame_time_); layer_tree->set_frame_size(SkISize::Make(viewport_metrics_.physical_width, viewport_metrics_.physical_height)); @@ -315,7 +315,7 @@ void RuntimeHolder::Render(std::unique_ptr layer_tree) { // We are on the Platform/UI thread. Post to the GPU thread to render. ASSERT_IS_PLATFORM_THREAD; - blink::Threads::Gpu()->PostTask(ftl::MakeCopyable([ + blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ rasterizer = rasterizer_.get(), // layer_tree = std::move(layer_tree), // weak_runtime_holder = GetWeakPtr() // @@ -341,7 +341,7 @@ void RuntimeHolder::Render(std::unique_ptr layer_tree) { void RuntimeHolder::UpdateSemantics(std::vector update) {} void RuntimeHolder::HandlePlatformMessage( - ftl::RefPtr message) { + fxl::RefPtr message) { if (message->channel() == kAssetChannel) { if (HandleAssetPlatformMessage(message.get())) return; @@ -411,7 +411,7 @@ void RuntimeHolder::InitMozartInternal() { void RuntimeHolder::InitRootBundle(std::vector bundle) { root_bundle_data_ = std::move(bundle); - asset_store_ = ftl::MakeRefCounted( + asset_store_ = fxl::MakeRefCounted( GetUnzipperProviderForRootBundle()); } @@ -421,7 +421,7 @@ mozart::View* RuntimeHolder::GetMozartView() { bool RuntimeHolder::HandleAssetPlatformMessage( blink::PlatformMessage* message) { - ftl::RefPtr response = message->response(); + fxl::RefPtr response = message->response(); if (!response) return false; const auto& data = message->data(); @@ -524,7 +524,7 @@ bool RuntimeHolder::HandleTextInputPlatformMessage( text_input_binding_.Close(); input_method_editor_ = nullptr; } else { - FTL_DLOG(ERROR) << "Unknown " << kTextInputChannel << " method " + FXL_DLOG(ERROR) << "Unknown " << kTextInputChannel << " method " << method->value.GetString(); } @@ -567,7 +567,7 @@ void RuntimeHolder::OnEvent(mozart::InputEventPtr event, case blink::PointerData::Change::kAdd: case blink::PointerData::Change::kRemove: case blink::PointerData::Change::kHover: - FTL_DCHECK(down_pointers_.count(pointer_data.device) == 0); + FXL_DCHECK(down_pointers_.count(pointer_data.device) == 0); break; } @@ -603,7 +603,7 @@ void RuntimeHolder::OnEvent(mozart::InputEventPtr event, const uint8_t* data = reinterpret_cast(buffer.GetString()); runtime_->DispatchPlatformMessage( - ftl::MakeRefCounted( + fxl::MakeRefCounted( kKeyEventChannel, std::vector(data, data + buffer.GetSize()), nullptr)); handled = true; @@ -615,7 +615,7 @@ void RuntimeHolder::OnEvent(mozart::InputEventPtr event, void RuntimeHolder::OnPropertiesChanged( mozart::ViewPropertiesPtr properties, const OnPropertiesChangedCallback& callback) { - FTL_DCHECK(properties); + FXL_DCHECK(properties); // Attempt to read the device pixel ratio. float pixel_ratio = 1.f; @@ -683,7 +683,7 @@ void RuntimeHolder::DidUpdateState(mozart::TextInputStatePtr state, document.Accept(writer); const uint8_t* data = reinterpret_cast(buffer.GetString()); - runtime_->DispatchPlatformMessage(ftl::MakeRefCounted( + runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( kTextInputChannel, std::vector(data, data + buffer.GetSize()), nullptr)); } @@ -708,12 +708,12 @@ void RuntimeHolder::OnAction(mozart::InputMethodAction action) { document.Accept(writer); const uint8_t* data = reinterpret_cast(buffer.GetString()); - runtime_->DispatchPlatformMessage(ftl::MakeRefCounted( + runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( kTextInputChannel, std::vector(data, data + buffer.GetSize()), nullptr)); } -ftl::WeakPtr RuntimeHolder::GetWeakPtr() { +fxl::WeakPtr RuntimeHolder::GetWeakPtr() { return weak_factory_.GetWeakPtr(); } @@ -729,17 +729,17 @@ void RuntimeHolder::PostBeginFrame() { void RuntimeHolder::BeginFrame() { ASSERT_IS_UI_THREAD - FTL_DCHECK(frame_scheduled_); - FTL_DCHECK(!frame_outstanding_); + FXL_DCHECK(frame_scheduled_); + FXL_DCHECK(!frame_outstanding_); frame_scheduled_ = false; frame_outstanding_ = true; - last_begin_frame_time_ = ftl::TimePoint::Now(); + last_begin_frame_time_ = fxl::TimePoint::Now(); runtime_->BeginFrame(last_begin_frame_time_); } void RuntimeHolder::OnFrameComplete() { ASSERT_IS_UI_THREAD - FTL_DCHECK(frame_outstanding_); + FXL_DCHECK(frame_outstanding_); frame_outstanding_ = false; if (frame_scheduled_) PostBeginFrame(); diff --git a/content_handler/runtime_holder.h b/content_handler/runtime_holder.h index 7df2bd8beff08..f1f59e2f48da1 100644 --- a/content_handler/runtime_holder.h +++ b/content_handler/runtime_holder.h @@ -25,9 +25,9 @@ #include "flutter/runtime/runtime_controller.h" #include "flutter/runtime/runtime_delegate.h" #include "lib/fidl/cpp/bindings/binding.h" -#include "lib/ftl/functional/closure.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" namespace flutter_runner { class Rasterizer; @@ -61,7 +61,7 @@ class RuntimeHolder : public blink::RuntimeDelegate, void Render(std::unique_ptr layer_tree) override; void UpdateSemantics(std::vector update) override; void HandlePlatformMessage( - ftl::RefPtr message) override; + fxl::RefPtr message) override; void DidCreateMainIsolate(Dart_Isolate isolate) override; // |mozart::NativesDelegate| implementation: @@ -81,7 +81,7 @@ class RuntimeHolder : public blink::RuntimeDelegate, mozart::InputEventPtr event) override; void OnAction(mozart::InputMethodAction action) override; - ftl::WeakPtr GetWeakPtr(); + fxl::WeakPtr GetWeakPtr(); void InitRootBundle(std::vector bundle); blink::UnzipperProvider GetUnzipperProviderForRootBundle(); @@ -102,7 +102,7 @@ class RuntimeHolder : public blink::RuntimeDelegate, std::unique_ptr context_; fidl::InterfaceRequest outgoing_services_; std::vector root_bundle_data_; - ftl::RefPtr asset_store_; + fxl::RefPtr asset_store_; void* dylib_handle_ = nullptr; std::unique_ptr rasterizer_; std::unique_ptr runtime_; @@ -116,15 +116,15 @@ class RuntimeHolder : public blink::RuntimeDelegate, mozart::InputMethodEditorPtr input_method_editor_; fidl::Binding text_input_binding_; int current_text_input_client_ = 0; - ftl::TimePoint last_begin_frame_time_; + fxl::TimePoint last_begin_frame_time_; bool frame_outstanding_ = false; bool frame_scheduled_ = false; bool frame_rendering_ = false; int32_t return_code_ = 0; - ftl::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; - FTL_DISALLOW_COPY_AND_ASSIGN(RuntimeHolder); + FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeHolder); }; } // namespace flutter_runner diff --git a/content_handler/service_protocol_hooks.cc b/content_handler/service_protocol_hooks.cc index 3d1bde3a245bf..7eea44c46624c 100644 --- a/content_handler/service_protocol_hooks.cc +++ b/content_handler/service_protocol_hooks.cc @@ -11,7 +11,7 @@ #include "flutter/common/threads.h" #include "flutter/content_handler/app.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/memory/weak_ptr.h" namespace flutter_runner { namespace { diff --git a/content_handler/service_protocol_hooks.h b/content_handler/service_protocol_hooks.h index c669b06909054..865b84afec64e 100644 --- a/content_handler/service_protocol_hooks.h +++ b/content_handler/service_protocol_hooks.h @@ -6,7 +6,7 @@ #define FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ #include "dart/runtime/include/dart_tools_api.h" -#include "lib/ftl/synchronization/waitable_event.h" +#include "lib/fxl/synchronization/waitable_event.h" namespace flutter_runner { diff --git a/content_handler/session_connection.cc b/content_handler/session_connection.cc index 6f6805e145ab7..4eab8f10144a8 100644 --- a/content_handler/session_connection.cc +++ b/content_handler/session_connection.cc @@ -35,7 +35,7 @@ SessionConnection::~SessionConnection() { void SessionConnection::OnSessionError() { ASSERT_IS_GPU_THREAD; // TODO: Not this. - FTL_CHECK(false) << "Session connection was terminated."; + FXL_CHECK(false) << "Session connection was terminated."; } void SessionConnection::OnSessionEvents(fidl::Array events) { @@ -56,10 +56,10 @@ void SessionConnection::OnSessionEvents(fidl::Array events) { } void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame, - ftl::Closure on_present_callback) { + fxl::Closure on_present_callback) { ASSERT_IS_GPU_THREAD; - FTL_DCHECK(pending_on_present_callback_ == nullptr); - FTL_DCHECK(on_present_callback != nullptr); + FXL_DCHECK(pending_on_present_callback_ == nullptr); + FXL_DCHECK(on_present_callback != nullptr); pending_on_present_callback_ = on_present_callback; // Flush all session ops. Paint tasks have not yet executed but those are diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h index 05b1e906ea4d6..85d97191fbed8 100644 --- a/content_handler/session_connection.h +++ b/content_handler/session_connection.h @@ -12,8 +12,8 @@ #include "flutter/flow/compositor_context.h" #include "flutter/flow/scene_update_context.h" #include "lib/fidl/cpp/bindings/interface_handle.h" -#include "lib/ftl/functional/closure.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" #include "magenta/system/ulib/mx/include/mx/eventpair.h" namespace flutter_runner { @@ -27,7 +27,7 @@ class SessionConnection { bool has_metrics() const { return scene_update_context_.has_metrics(); } - void set_metrics_changed_callback(ftl::Closure callback) { + void set_metrics_changed_callback(fxl::Closure callback) { metrics_changed_callback_ = std::move(callback); } @@ -41,16 +41,16 @@ class SessionConnection { } void Present(flow::CompositorContext::ScopedFrame& frame, - ftl::Closure on_present_callback); + fxl::Closure on_present_callback); private: scenic_lib::Session session_; scenic_lib::ImportNode root_node_; scenic_lib::Session::PresentCallback present_callback_; - ftl::Closure pending_on_present_callback_; + fxl::Closure pending_on_present_callback_; std::unique_ptr surface_producer_; flow::SceneUpdateContext scene_update_context_; - ftl::Closure metrics_changed_callback_; + fxl::Closure metrics_changed_callback_; void OnSessionError(); void OnSessionEvents(fidl::Array events); @@ -59,7 +59,7 @@ class SessionConnection { void OnPresent(scenic::PresentationInfoPtr info); - FTL_DISALLOW_COPY_AND_ASSIGN(SessionConnection); + FXL_DISALLOW_COPY_AND_ASSIGN(SessionConnection); }; } // namespace flutter_runner diff --git a/content_handler/vulkan_rasterizer.cc b/content_handler/vulkan_rasterizer.cc index d6436db074220..b451c5aa133f8 100644 --- a/content_handler/vulkan_rasterizer.cc +++ b/content_handler/vulkan_rasterizer.cc @@ -15,7 +15,7 @@ #include "flutter/common/threads.h" #include "flutter/glue/trace_event.h" -#include "lib/ftl/files/unique_fd.h" +#include "lib/fxl/files/unique_fd.h" namespace flutter_runner { @@ -32,9 +32,9 @@ static mx_status_t DriverWatcher(int dirfd, } bool WaitForFirstDisplayDriver() { - ftl::UniqueFD fd(open(kDisplayDriverClass, O_DIRECTORY | O_RDONLY)); + fxl::UniqueFD fd(open(kDisplayDriverClass, O_DIRECTORY | O_RDONLY)); if (fd.get() < 0) { - FTL_DLOG(ERROR) << "Failed to open " << kDisplayDriverClass; + FXL_DLOG(ERROR) << "Failed to open " << kDisplayDriverClass; return false; } @@ -56,9 +56,9 @@ bool VulkanRasterizer::IsValid() const { void VulkanRasterizer::SetScene( fidl::InterfaceHandle scene_manager, mx::eventpair import_token, - ftl::Closure metrics_changed_callback) { + fxl::Closure metrics_changed_callback) { ASSERT_IS_GPU_THREAD; - FTL_DCHECK(valid_ && !session_connection_); + FXL_DCHECK(valid_ && !session_connection_); session_connection_ = std::make_unique( scenic::SceneManagerPtr::Create(std::move(scene_manager)), std::move(import_token)); @@ -67,18 +67,18 @@ void VulkanRasterizer::SetScene( } void VulkanRasterizer::Draw(std::unique_ptr layer_tree, - ftl::Closure callback) { + fxl::Closure callback) { ASSERT_IS_GPU_THREAD; - FTL_DCHECK(callback != nullptr); + FXL_DCHECK(callback != nullptr); if (layer_tree == nullptr) { - FTL_LOG(ERROR) << "Layer tree was not valid."; + FXL_LOG(ERROR) << "Layer tree was not valid."; callback(); return; } if (!session_connection_) { - FTL_LOG(ERROR) << "Session was not valid."; + FXL_LOG(ERROR) << "Session was not valid."; callback(); return; } diff --git a/content_handler/vulkan_rasterizer.h b/content_handler/vulkan_rasterizer.h index d697d029c878b..d36ce35ea51ea 100644 --- a/content_handler/vulkan_rasterizer.h +++ b/content_handler/vulkan_rasterizer.h @@ -10,7 +10,7 @@ #include "flutter/content_handler/rasterizer.h" #include "flutter/content_handler/session_connection.h" #include "flutter/flow/compositor_context.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace flutter_runner { @@ -24,17 +24,17 @@ class VulkanRasterizer : public Rasterizer { void SetScene(fidl::InterfaceHandle scene_manager, mx::eventpair import_token, - ftl::Closure metrics_changed_callback) override; + fxl::Closure metrics_changed_callback) override; void Draw(std::unique_ptr layer_tree, - ftl::Closure callback) override; + fxl::Closure callback) override; private: flow::CompositorContext compositor_context_; std::unique_ptr session_connection_; bool valid_; - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanRasterizer); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanRasterizer); }; } // namespace flutter_runner diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index 0eda66d0ffaaa..cc3764b307360 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -22,21 +22,21 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProcTable& p_vk, session_(session) { ASSERT_IS_GPU_THREAD; - FTL_DCHECK(session_); + FXL_DCHECK(session_); mx::vmo exported_vmo; if (!AllocateDeviceMemory(std::move(context), size, exported_vmo)) { - FTL_DLOG(INFO) << "Could not allocate device memory."; + FXL_DLOG(INFO) << "Could not allocate device memory."; return; } if (!CreateFences()) { - FTL_DLOG(INFO) << "Could not create signal fences."; + FXL_DLOG(INFO) << "Could not create signal fences."; return; } if (!PushSessionImageSetupOps(session, std::move(exported_vmo))) { - FTL_DLOG(INFO) << "Could not push session image setup ops."; + FXL_DLOG(INFO) << "Could not push session image setup ops."; return; } @@ -84,7 +84,7 @@ VulkanSurface::SemaphoreFromEvent(const mx::event &event) const { mx::event semaphore_event; mx_status_t status = event.duplicate(MX_RIGHT_SAME_RIGHTS, &semaphore_event); if (status != MX_OK) { - FTL_DLOG(ERROR) << "failed to duplicate semaphore event"; + FXL_DLOG(ERROR) << "failed to duplicate semaphore event"; return vulkan::VulkanHandle(); } @@ -126,7 +126,7 @@ bool VulkanSurface::CreateFences() { acquire_semaphore_ = SemaphoreFromEvent(acquire_event_); if (!acquire_semaphore_) { - FTL_DLOG(ERROR) << "failed to create acquire semaphore"; + FXL_DLOG(ERROR) << "failed to create acquire semaphore"; return false; } @@ -340,14 +340,14 @@ bool VulkanSurface::FlushSessionAcquireAndReleaseEvents() { void VulkanSurface::SignalWritesFinished( std::function on_writes_committed) { ASSERT_IS_GPU_THREAD; - FTL_DCHECK(on_writes_committed); + FXL_DCHECK(on_writes_committed); if (!valid_) { on_writes_committed(); return; } - FTL_CHECK(pending_on_writes_committed_ == nullptr) + FXL_CHECK(pending_on_writes_committed_ == nullptr) << "Attempted to signal a write on the surface when the previous write " "has not yet been acknowledged by the compositor."; @@ -360,7 +360,7 @@ void VulkanSurface::Reset() { if (acquire_event_.signal(MX_EVENT_SIGNALED, 0u) != MX_OK || release_event_.signal(MX_EVENT_SIGNALED, 0u) != MX_OK) { valid_ = false; - FTL_DLOG(ERROR) + FXL_DLOG(ERROR) << "Could not reset fences. The surface is no longer valid."; } @@ -369,7 +369,7 @@ void VulkanSurface::Reset() { acquire_semaphore_.Reset(); acquire_semaphore_ = SemaphoreFromEvent(acquire_event_); if (!acquire_semaphore_) { - FTL_DLOG(ERROR) << "failed to create acquire semaphore"; + FXL_DLOG(ERROR) << "failed to create acquire semaphore"; } // It is safe for the caller to collect the surface in the callback. @@ -384,8 +384,8 @@ void VulkanSurface::OnHandleReady(mx_handle_t handle, mx_signals_t pending, uint64_t count) { ASSERT_IS_GPU_THREAD; - FTL_DCHECK(pending & MX_EVENT_SIGNALED); - FTL_DCHECK(handle == release_event_.get()); + FXL_DCHECK(pending & MX_EVENT_SIGNALED); + FXL_DCHECK(handle == release_event_.get()); Reset(); } diff --git a/content_handler/vulkan_surface.h b/content_handler/vulkan_surface.h index dd7084e588790..547af63926775 100644 --- a/content_handler/vulkan_surface.h +++ b/content_handler/vulkan_surface.h @@ -9,7 +9,7 @@ #include "flutter/flow/scene_update_context.h" #include "flutter/vulkan/vulkan_handle.h" #include "flutter/vulkan/vulkan_proc_table.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "lib/mtl/tasks/message_loop.h" #include "lib/mtl/tasks/message_loop_handler.h" #include "mx/event.h" @@ -95,7 +95,7 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface, vulkan::VulkanHandle SemaphoreFromEvent(const mx::event &event) const; - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanSurface); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurface); }; } // namespace flutter_runner diff --git a/content_handler/vulkan_surface_pool.cc b/content_handler/vulkan_surface_pool.cc index dcbd90d5e7ece..81bdd4104b095 100644 --- a/content_handler/vulkan_surface_pool.cc +++ b/content_handler/vulkan_surface_pool.cc @@ -25,12 +25,12 @@ VulkanSurfacePool::AcquireSurface(const SkISize& size) { auto surface = GetCachedOrCreateSurface(size); if (surface == nullptr) { - FTL_DLOG(ERROR) << "Could not acquire surface"; + FXL_DLOG(ERROR) << "Could not acquire surface"; return nullptr; } if (!surface->FlushSessionAcquireAndReleaseEvents()) { - FTL_DLOG(ERROR) << "Could not flush acquir/release events for buffer."; + FXL_DLOG(ERROR) << "Could not flush acquir/release events for buffer."; return nullptr; } @@ -44,7 +44,7 @@ VulkanSurfacePool::GetCachedOrCreateSurface(const SkISize& size) { return CreateSurface(size); } SurfacesSet& available_surfaces = found_in_available->second; - FTL_DCHECK(available_surfaces.size() > 0); + FXL_DCHECK(available_surfaces.size() > 0); auto acquired_surface = std::move(available_surfaces.back()); available_surfaces.pop_back(); if (available_surfaces.size() == 0) { diff --git a/content_handler/vulkan_surface_pool.h b/content_handler/vulkan_surface_pool.h index 4636ad42ce358..561876c4e7975 100644 --- a/content_handler/vulkan_surface_pool.h +++ b/content_handler/vulkan_surface_pool.h @@ -7,7 +7,7 @@ #include #include #include "flutter/content_handler/vulkan_surface.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace flutter_runner { @@ -71,7 +71,7 @@ class VulkanSurfacePool { void TraceStats(); - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfacePool); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfacePool); }; } // namespace flutter_runner diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc index 511fe65af3a47..b9da6ce33a120 100644 --- a/content_handler/vulkan_surface_producer.cc +++ b/content_handler/vulkan_surface_producer.cc @@ -18,10 +18,10 @@ VulkanSurfaceProducer::VulkanSurfaceProducer( valid_ = Initialize(mozart_session); if (valid_) { - FTL_LOG(INFO) + FXL_LOG(INFO) << "Flutter engine: Vulkan surface producer initialization: Successful"; } else { - FTL_LOG(ERROR) + FXL_LOG(ERROR) << "Flutter engine: Vulkan surface producer initialization: Failed"; } } @@ -30,12 +30,12 @@ VulkanSurfaceProducer::~VulkanSurfaceProducer() { // Make sure queue is idle before we start destroying surfaces VkResult wait_result = VK_CALL_LOG_ERROR(vk_->QueueWaitIdle(backend_context_->fQueue)); - FTL_DCHECK(wait_result == VK_SUCCESS); + FXL_DCHECK(wait_result == VK_SUCCESS); }; bool VulkanSurfaceProducer::Initialize( scenic_lib::Session* mozart_session) { - vk_ = ftl::MakeRefCounted(); + vk_ = fxl::MakeRefCounted(); std::vector extensions = { VK_KHR_SURFACE_EXTENSION_NAME, @@ -47,7 +47,7 @@ bool VulkanSurfaceProducer::Initialize( if (!application_->IsValid() || !vk_->AreInstanceProcsSetup()) { // Make certain the application instance was created and it setup the // instance proc table entries. - FTL_LOG(ERROR) << "Instance proc addresses have not been setup."; + FXL_LOG(ERROR) << "Instance proc addresses have not been setup."; return false; } @@ -59,30 +59,30 @@ bool VulkanSurfaceProducer::Initialize( !vk_->AreDeviceProcsSetup()) { // Make certain the device was created and it setup the device proc table // entries. - FTL_LOG(ERROR) << "Device proc addresses have not been setup."; + FXL_LOG(ERROR) << "Device proc addresses have not been setup."; return false; } if (!vk_->HasAcquiredMandatoryProcAddresses()) { - FTL_LOG(ERROR) << "Failed to acquire mandatory proc addresses."; + FXL_LOG(ERROR) << "Failed to acquire mandatory proc addresses."; return false; } if (!vk_->IsValid()) { - FTL_LOG(ERROR) << "VulkanProcTable invalid"; + FXL_LOG(ERROR) << "VulkanProcTable invalid"; return false; } auto interface = vk_->CreateSkiaInterface(); if (interface == nullptr || !interface->validate(0)) { - FTL_LOG(ERROR) << "Skia interface invalid."; + FXL_LOG(ERROR) << "Skia interface invalid."; return false; } uint32_t skia_features = 0; if (!logical_device_->GetPhysicalDeviceFeaturesSkia(&skia_features)) { - FTL_LOG(ERROR) << "Failed to get physical device features."; + FXL_LOG(ERROR) << "Failed to get physical device features."; return false; } @@ -141,13 +141,13 @@ void VulkanSurfaceProducer::OnSurfacesPresented( std::unique_ptr VulkanSurfaceProducer::ProduceSurface(const SkISize& size) { - FTL_DCHECK(valid_); + FXL_DCHECK(valid_); return surface_pool_->AcquireSurface(size); } void VulkanSurfaceProducer::SubmitSurface( std::unique_ptr surface) { - FTL_DCHECK(valid_ && surface != nullptr); + FXL_DCHECK(valid_ && surface != nullptr); surface_pool_->SubmitSurface(std::move(surface)); } diff --git a/content_handler/vulkan_surface_producer.h b/content_handler/vulkan_surface_producer.h index e05fdca1c2343..443afeb77da65 100644 --- a/content_handler/vulkan_surface_producer.h +++ b/content_handler/vulkan_surface_producer.h @@ -13,7 +13,7 @@ #include "flutter/vulkan/vulkan_application.h" #include "flutter/vulkan/vulkan_device.h" #include "flutter/vulkan/vulkan_proc_table.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "lib/mtl/tasks/message_loop.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" @@ -48,7 +48,7 @@ class VulkanSurfaceProducer : public flow::SceneUpdateContext::SurfaceProducer { // VkInstance, so it must be destroyed after the logical device and the // application, which own other vulkan objects associated with the device // and instance. - ftl::RefPtr vk_; + fxl::RefPtr vk_; sk_sp backend_context_; std::unique_ptr logical_device_; std::unique_ptr application_; @@ -58,7 +58,7 @@ class VulkanSurfaceProducer : public flow::SceneUpdateContext::SurfaceProducer { bool Initialize(scenic_lib::Session* mozart_session); - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfaceProducer); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfaceProducer); }; } // namespace flutter_runner diff --git a/flow/BUILD.gn b/flow/BUILD.gn index cd5da80603714..da59ce2d46c9b 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -50,7 +50,7 @@ source_set("flow") { ] public_deps = [ - "//garnet/public/lib/ftl", + "//garnet/public/lib/fxl", ] deps = [ diff --git a/flow/compositor_context.h b/flow/compositor_context.h index da0312362c253..9ca1572521d0d 100644 --- a/flow/compositor_context.h +++ b/flow/compositor_context.h @@ -11,7 +11,7 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/process_info.h" #include "flutter/flow/raster_cache.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" @@ -44,7 +44,7 @@ class CompositorContext { friend class CompositorContext; - FTL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); + FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); }; CompositorContext(std::unique_ptr info); @@ -79,7 +79,7 @@ class CompositorContext { void EndFrame(ScopedFrame& frame, bool enable_instrumentation); - FTL_DISALLOW_COPY_AND_ASSIGN(CompositorContext); + FXL_DISALLOW_COPY_AND_ASSIGN(CompositorContext); }; } // namespace flow diff --git a/flow/debug_print.h b/flow/debug_print.h index c54bcc5457e65..20612966d2b4d 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/ftl/macros.h" +#include "lib/fxl/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 3949cb03ae32d..b6452b7e3244e 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -5,12 +5,12 @@ #include "flutter/flow/export_node.h" #include "flutter/common/threads.h" -#include "lib/ftl/functional/make_copyable.h" +#include "lib/fxl/functional/make_copyable.h" namespace flow { ExportNodeHolder::ExportNodeHolder( - ftl::RefPtr export_token_handle) + fxl::RefPtr export_token_handle) : export_node_(std::make_unique(export_token_handle)) { ASSERT_IS_UI_THREAD; } @@ -26,18 +26,18 @@ void ExportNodeHolder::Bind(SceneUpdateContext& context, ExportNodeHolder::~ExportNodeHolder() { ASSERT_IS_UI_THREAD; blink::Threads::Gpu()->PostTask( - ftl::MakeCopyable([export_node = std::move(export_node_)]() { + fxl::MakeCopyable([export_node = std::move(export_node_)]() { export_node->Dispose(true); })); } -ExportNode::ExportNode(ftl::RefPtr export_token_handle) +ExportNode::ExportNode(fxl::RefPtr export_token_handle) : export_token_(export_token_handle->ReleaseHandle()) {} ExportNode::~ExportNode() { // Ensure that we properly released the node. - FTL_DCHECK(!node_); - FTL_DCHECK(scene_update_context_ == nullptr); + FXL_DCHECK(!node_); + FXL_DCHECK(scene_update_context_ == nullptr); } void ExportNode::Bind(SceneUpdateContext& context, @@ -75,7 +75,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). - FTL_DCHECK(scene_update_context_ || !node_); + FXL_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 e60e7e3a376a3..aa8b55f49ee1b 100644 --- a/flow/export_node.h +++ b/flow/export_node.h @@ -12,11 +12,11 @@ #include "lib/ui/scenic/client/resources.h" #include "flutter/flow/scene_update_context.h" #include "dart-pkg/zircon/sdk_ext/handle.h" -#include "lib/ftl/build_config.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/ref_counted.h" -#include "lib/ftl/synchronization/mutex.h" -#include "lib/ftl/synchronization/thread_annotations.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/synchronization/mutex.h" +#include "lib/fxl/synchronization/thread_annotations.h" #include "third_party/skia/include/core/SkPoint.h" namespace flow { @@ -24,9 +24,9 @@ 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 ftl::RefCountedThreadSafe { +class ExportNodeHolder : public fxl::RefCountedThreadSafe { public: - ExportNodeHolder(ftl::RefPtr export_token_handle); + ExportNodeHolder(fxl::RefPtr export_token_handle); ~ExportNodeHolder(); // Calls Bind() on the wrapped ExportNode. @@ -42,7 +42,7 @@ class ExportNodeHolder : public ftl::RefCountedThreadSafe { FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); FRIEND_REF_COUNTED_THREAD_SAFE(ExportNodeHolder); - FTL_DISALLOW_COPY_AND_ASSIGN(ExportNodeHolder); + FXL_DISALLOW_COPY_AND_ASSIGN(ExportNodeHolder); }; // Represents a node which is being exported from the session. @@ -50,7 +50,7 @@ class ExportNodeHolder : public ftl::RefCountedThreadSafe { // must be created and destroyed by the rasterizer thread. class ExportNode { public: - ExportNode(ftl::RefPtr export_token_handle); + ExportNode(fxl::RefPtr export_token_handle); ~ExportNode(); @@ -74,7 +74,7 @@ class ExportNode { mx::eventpair export_token_; std::unique_ptr node_; - FTL_DISALLOW_COPY_AND_ASSIGN(ExportNode); + FXL_DISALLOW_COPY_AND_ASSIGN(ExportNode); }; } // namespace flow diff --git a/flow/instrumentation.cc b/flow/instrumentation.cc index 74ddb5351d6d5..4dcd18aa9fed9 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_(ftl::TimePoint::Now()), current_sample_(0) { - const ftl::TimeDelta delta = ftl::TimeDelta::Zero(); +Stopwatch::Stopwatch() : start_(fxl::TimePoint::Now()), current_sample_(0) { + const fxl::TimeDelta delta = fxl::TimeDelta::Zero(); laps_.resize(kMaxSamples, delta); } Stopwatch::~Stopwatch() = default; void Stopwatch::Start() { - start_ = ftl::TimePoint::Now(); + start_ = fxl::TimePoint::Now(); current_sample_ = (current_sample_ + 1) % kMaxSamples; } void Stopwatch::Stop() { - laps_[current_sample_] = ftl::TimePoint::Now() - start_; + laps_[current_sample_] = fxl::TimePoint::Now() - start_; } -void Stopwatch::SetLapTime(const ftl::TimeDelta& delta) { +void Stopwatch::SetLapTime(const fxl::TimeDelta& delta) { current_sample_ = (current_sample_ + 1) % kMaxSamples; laps_[current_sample_] = delta; } -const ftl::TimeDelta& Stopwatch::LastLap() const { +const fxl::TimeDelta& Stopwatch::LastLap() const { return laps_[(current_sample_ - 1) % kMaxSamples]; } @@ -51,8 +51,8 @@ static inline double UnitHeight(double frame_time_ms, return unitHeight; } -ftl::TimeDelta Stopwatch::MaxDelta() const { - ftl::TimeDelta max_delta; +fxl::TimeDelta Stopwatch::MaxDelta() const { + fxl::TimeDelta max_delta; for (size_t i = 0; i < kMaxSamples; i++) { if (laps_[i] > max_delta) max_delta = laps_[i]; diff --git a/flow/instrumentation.h b/flow/instrumentation.h index 95ff6584847bc..1692c8aec4955 100644 --- a/flow/instrumentation.h +++ b/flow/instrumentation.h @@ -7,9 +7,9 @@ #include -#include "lib/ftl/macros.h" -#include "lib/ftl/time/time_delta.h" -#include "lib/ftl/time/time_point.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/time/time_delta.h" +#include "lib/fxl/time/time_point.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { @@ -22,11 +22,11 @@ class Stopwatch { ~Stopwatch(); - const ftl::TimeDelta& LastLap() const; + const fxl::TimeDelta& LastLap() const; - ftl::TimeDelta CurrentLap() const { return ftl::TimePoint::Now() - start_; } + fxl::TimeDelta CurrentLap() const { return fxl::TimePoint::Now() - start_; } - ftl::TimeDelta MaxDelta() const; + fxl::TimeDelta MaxDelta() const; void Visualize(SkCanvas& canvas, const SkRect& rect) const; @@ -34,14 +34,14 @@ class Stopwatch { void Stop(); - void SetLapTime(const ftl::TimeDelta& delta); + void SetLapTime(const fxl::TimeDelta& delta); private: - ftl::TimePoint start_; - std::vector laps_; + fxl::TimePoint start_; + std::vector laps_; size_t current_sample_; - FTL_DISALLOW_COPY_AND_ASSIGN(Stopwatch); + FXL_DISALLOW_COPY_AND_ASSIGN(Stopwatch); }; class Counter { @@ -57,7 +57,7 @@ class Counter { private: size_t count_; - FTL_DISALLOW_COPY_AND_ASSIGN(Counter); + FXL_DISALLOW_COPY_AND_ASSIGN(Counter); }; class CounterValues { @@ -80,7 +80,7 @@ class CounterValues { std::vector values_; size_t current_sample_; - FTL_DISALLOW_COPY_AND_ASSIGN(CounterValues); + FXL_DISALLOW_COPY_AND_ASSIGN(CounterValues); }; } // namespace flow diff --git a/flow/layers/backdrop_filter_layer.cc b/flow/layers/backdrop_filter_layer.cc index 0077f6f87e451..45b44610f7f9f 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) { TRACE_EVENT0("flutter", "BackdropFilterLayer::Paint"); - FTL_DCHECK(needs_painting()); + FXL_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 6e016e78014f4..5dfe58fdb78b0 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_; - FTL_DISALLOW_COPY_AND_ASSIGN(BackdropFilterLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(BackdropFilterLayer); }; } // namespace flow diff --git a/flow/layers/child_scene_layer.cc b/flow/layers/child_scene_layer.cc index 37fbd16e43fa8..4b19ffefa23bb 100644 --- a/flow/layers/child_scene_layer.cc +++ b/flow/layers/child_scene_layer.cc @@ -15,11 +15,11 @@ void ChildSceneLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { } void ChildSceneLayer::Paint(PaintContext& context) { - FTL_NOTREACHED() << "This layer never needs painting."; + FXL_NOTREACHED() << "This layer never needs painting."; } void ChildSceneLayer::UpdateScene(SceneUpdateContext& context) { - FTL_DCHECK(needs_system_composite()); + FXL_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 dbca89359d71c..f8e8e3ee8d521 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( - ftl::RefPtr export_node_holder) { + fxl::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_; - ftl::RefPtr export_node_holder_; + fxl::RefPtr export_node_holder_; bool hit_testable_ = true; - FTL_DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer); }; } // namespace flow diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index b8d119e2bc39a..eedebd7cae16c 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -28,7 +28,7 @@ void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { - FTL_DCHECK(needs_system_composite()); + FXL_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. @@ -46,7 +46,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { void ClipPathLayer::Paint(PaintContext& context) { TRACE_EVENT0("flutter", "ClipPathLayer::Paint"); - FTL_DCHECK(needs_painting()); + FXL_DCHECK(needs_painting()); Layer::AutoSaveLayer save(context, paint_bounds(), nullptr); context.canvas.clipPath(clip_path_, true); diff --git a/flow/layers/clip_path_layer.h b/flow/layers/clip_path_layer.h index 1b2354a342c55..dde2232e4f2fb 100644 --- a/flow/layers/clip_path_layer.h +++ b/flow/layers/clip_path_layer.h @@ -26,7 +26,7 @@ class ClipPathLayer : public ContainerLayer { private: SkPath clip_path_; - FTL_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer); }; } // namespace flow diff --git a/flow/layers/clip_rect_layer.cc b/flow/layers/clip_rect_layer.cc index 789c1d1fd8d06..e0aa00bf7ff14 100644 --- a/flow/layers/clip_rect_layer.cc +++ b/flow/layers/clip_rect_layer.cc @@ -22,7 +22,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { - FTL_DCHECK(needs_system_composite()); + FXL_DCHECK(needs_system_composite()); scenic_lib::Rectangle shape(context.session(), // session clip_rect_.width(), // width @@ -37,7 +37,7 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { void ClipRectLayer::Paint(PaintContext& context) { TRACE_EVENT0("flutter", "ClipRectLayer::Paint"); - FTL_DCHECK(needs_painting()); + FXL_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.clipRect(paint_bounds()); diff --git a/flow/layers/clip_rect_layer.h b/flow/layers/clip_rect_layer.h index 51416f20fa9fc..1fb119b1ea86b 100644 --- a/flow/layers/clip_rect_layer.h +++ b/flow/layers/clip_rect_layer.h @@ -26,7 +26,7 @@ class ClipRectLayer : public ContainerLayer { private: SkRect clip_rect_; - FTL_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer); }; } // namespace flow diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index 0e239e12d87b2..913af8df19050 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -22,7 +22,7 @@ void ClipRRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { - FTL_DCHECK(needs_system_composite()); + FXL_DCHECK(needs_system_composite()); // TODO(MZ-137): Need to be able to express the radii as vectors. scenic_lib::RoundedRectangle shape( @@ -44,7 +44,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { void ClipRRectLayer::Paint(PaintContext& context) { TRACE_EVENT0("flutter", "ClipRRectLayer::Paint"); - FTL_DCHECK(needs_painting()); + FXL_DCHECK(needs_painting()); Layer::AutoSaveLayer save(context, paint_bounds(), nullptr); context.canvas.clipRRect(clip_rrect_, true); diff --git a/flow/layers/clip_rrect_layer.h b/flow/layers/clip_rrect_layer.h index 67ba0345361d8..530fc6bd9722f 100644 --- a/flow/layers/clip_rrect_layer.h +++ b/flow/layers/clip_rrect_layer.h @@ -26,7 +26,7 @@ class ClipRRectLayer : public ContainerLayer { private: SkRRect clip_rrect_; - FTL_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer); }; } // namespace flow diff --git a/flow/layers/color_filter_layer.cc b/flow/layers/color_filter_layer.cc index 0471d58da3d6e..fad3408182453 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) { TRACE_EVENT0("flutter", "ColorFilterLayer::Paint"); - FTL_DCHECK(needs_painting()); + FXL_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 f327f121a4ad8..e7fa5dfd14af8 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_; - FTL_DISALLOW_COPY_AND_ASSIGN(ColorFilterLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(ColorFilterLayer); }; } // namespace flow diff --git a/flow/layers/container_layer.cc b/flow/layers/container_layer.cc index d9665d2d00464..b437d4369bf11 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 { - FTL_DCHECK(needs_painting()); + FXL_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) { - FTL_DCHECK(needs_system_composite()); + FXL_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 f21fa15a0b992..9b30d28c9f44a 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_; - FTL_DISALLOW_COPY_AND_ASSIGN(ContainerLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(ContainerLayer); }; } // namespace flow diff --git a/flow/layers/layer.h b/flow/layers/layer.h index 61310fa9afba3..ffab33ef0ad83 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -11,9 +11,9 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache.h" #include "flutter/glue/trace_event.h" -#include "lib/ftl/build_config.h" -#include "lib/ftl/logging.h" -#include "lib/ftl/macros.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" @@ -108,7 +108,7 @@ class Layer { bool needs_system_composite_; SkRect paint_bounds_; - FTL_DISALLOW_COPY_AND_ASSIGN(Layer); + FXL_DISALLOW_COPY_AND_ASSIGN(Layer); }; } // namespace flow diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index bf7ceb22ba380..65f96b82e2789 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/ftl/macros.h" -#include "lib/ftl/time/time_delta.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/time/time_delta.h" #include "third_party/skia/include/core/SkSize.h" namespace flow { @@ -51,11 +51,11 @@ class LayerTree { void set_frame_size(const SkISize& frame_size) { frame_size_ = frame_size; } - void set_construction_time(const ftl::TimeDelta& delta) { + void set_construction_time(const fxl::TimeDelta& delta) { construction_time_ = delta; } - const ftl::TimeDelta& construction_time() const { return construction_time_; } + const fxl::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 @@ -79,7 +79,7 @@ class LayerTree { private: SkISize frame_size_; // Physical pixels. std::unique_ptr root_layer_; - ftl::TimeDelta construction_time_; + fxl::TimeDelta construction_time_; uint32_t rasterizer_tracing_threshold_; bool checkerboard_raster_cache_images_; bool checkerboard_offscreen_layers_; @@ -88,7 +88,7 @@ class LayerTree { float device_pixel_ratio_ = 1.f; #endif - FTL_DISALLOW_COPY_AND_ASSIGN(LayerTree); + FXL_DISALLOW_COPY_AND_ASSIGN(LayerTree); }; } // namespace flow diff --git a/flow/layers/opacity_layer.cc b/flow/layers/opacity_layer.cc index 32eb634c61444..3c7ad015d3b44 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) { TRACE_EVENT0("flutter", "OpacityLayer::Paint"); - FTL_DCHECK(needs_painting()); + FXL_DCHECK(needs_painting()); SkPaint paint; paint.setAlpha(alpha_); diff --git a/flow/layers/opacity_layer.h b/flow/layers/opacity_layer.h index c1bdbc158a59a..c391dc8e79b00 100644 --- a/flow/layers/opacity_layer.h +++ b/flow/layers/opacity_layer.h @@ -24,7 +24,7 @@ class OpacityLayer : public ContainerLayer { private: int alpha_; - FTL_DISALLOW_COPY_AND_ASSIGN(OpacityLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(OpacityLayer); }; } // namespace flow diff --git a/flow/layers/performance_overlay_layer.h b/flow/layers/performance_overlay_layer.h index 913cbd2d59b4d..1ea3d1c6b37be 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/ftl/macros.h" +#include "lib/fxl/macros.h" namespace flow { @@ -26,7 +26,7 @@ class PerformanceOverlayLayer : public Layer { private: int options_; - FTL_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer); }; } // namespace flow diff --git a/flow/layers/physical_model_layer.cc b/flow/layers/physical_model_layer.cc index 9ac3a565dac22..9603a8136d17e 100644 --- a/flow/layers/physical_model_layer.cc +++ b/flow/layers/physical_model_layer.cc @@ -39,7 +39,7 @@ void PhysicalModelLayer::Preroll(PrerollContext* context, #if defined(OS_FUCHSIA) void PhysicalModelLayer::UpdateScene(SceneUpdateContext& context) { - FTL_DCHECK(needs_system_composite()); + FXL_DCHECK(needs_system_composite()); SceneUpdateContext::Frame frame(context, rrect_, color_, elevation_); for (auto& layer : layers()) { @@ -55,7 +55,7 @@ void PhysicalModelLayer::UpdateScene(SceneUpdateContext& context) { void PhysicalModelLayer::Paint(PaintContext& context) { TRACE_EVENT0("flutter", "PhysicalModelLayer::Paint"); - FTL_DCHECK(needs_painting()); + FXL_DCHECK(needs_painting()); SkPath path; path.addRRect(rrect_); diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index cedeec474c04a..e2bcb03c44001 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -5,7 +5,7 @@ #include "flutter/flow/layers/picture_layer.h" #include "flutter/common/threads.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace flow { @@ -33,8 +33,8 @@ void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { void PictureLayer::Paint(PaintContext& context) { TRACE_EVENT0("flutter", "PictureLayer::Paint"); - FTL_DCHECK(picture_); - FTL_DCHECK(needs_painting()); + FXL_DCHECK(picture_); + FXL_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 516bcb2c09cde..e32aef8b3e975 100644 --- a/flow/layers/picture_layer.h +++ b/flow/layers/picture_layer.h @@ -33,7 +33,7 @@ class PictureLayer : public Layer { bool will_change_ = false; RasterCacheResult raster_cache_result_; - FTL_DISALLOW_COPY_AND_ASSIGN(PictureLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(PictureLayer); }; } // namespace flow diff --git a/flow/layers/shader_mask_layer.cc b/flow/layers/shader_mask_layer.cc index 447b867b363dd..56cb1134a0384 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) { TRACE_EVENT0("flutter", "ShaderMaskLayer::Paint"); - FTL_DCHECK(needs_painting()); + FXL_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 21c1d4ee81e79..be137f2ec164a 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_; - FTL_DISALLOW_COPY_AND_ASSIGN(ShaderMaskLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(ShaderMaskLayer); }; } // namespace flow diff --git a/flow/layers/transform_layer.cc b/flow/layers/transform_layer.cc index 6479163b57508..5e3eee17af756 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) { - FTL_DCHECK(needs_system_composite()); + FXL_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) { TRACE_EVENT0("flutter", "TransformLayer::Paint"); - FTL_DCHECK(needs_painting()); + FXL_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 e3f47f4462434..317902b818d0d 100644 --- a/flow/layers/transform_layer.h +++ b/flow/layers/transform_layer.h @@ -26,7 +26,7 @@ class TransformLayer : public ContainerLayer { private: SkMatrix transform_; - FTL_DISALLOW_COPY_AND_ASSIGN(TransformLayer); + FXL_DISALLOW_COPY_AND_ASSIGN(TransformLayer); }; } // namespace flow diff --git a/flow/matrix_decomposition.h b/flow/matrix_decomposition.h index d0819a13e4cf0..1392ed8aad020 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/ftl/macros.h" +#include "lib/fxl/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_; - FTL_DISALLOW_COPY_AND_ASSIGN(MatrixDecomposition); + FXL_DISALLOW_COPY_AND_ASSIGN(MatrixDecomposition); }; } // namespace flow diff --git a/flow/process_info.h b/flow/process_info.h index 25d25125f50fe..6623fe7257396 100644 --- a/flow/process_info.h +++ b/flow/process_info.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FLOW_PROCESS_INFO_H_ #define FLUTTER_FLOW_PROCESS_INFO_H_ -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace flow { diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 0653519d1a653..4d0efa286a727 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -9,7 +9,7 @@ #include "flutter/common/threads.h" #include "flutter/flow/paint_utils.h" #include "flutter/glue/trace_event.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkPicture.h" diff --git a/flow/raster_cache.h b/flow/raster_cache.h index b538931195944..3278eb355b030 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/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSize.h" @@ -73,9 +73,9 @@ class RasterCache { const size_t threshold_; RasterCacheKey::Map cache_; bool checkerboard_images_; - ftl::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; - FTL_DISALLOW_COPY_AND_ASSIGN(RasterCache); + FXL_DISALLOW_COPY_AND_ASSIGN(RasterCache); }; } // namespace flow diff --git a/flow/raster_cache_key.h b/flow/raster_cache_key.h index f7ccb231d2a7e..1f28ea5320d36 100644 --- a/flow/raster_cache_key.h +++ b/flow/raster_cache_key.h @@ -7,7 +7,7 @@ #include #include "flutter/flow/matrix_decomposition.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkPicture.h" diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index 5bbadf224b177..e26e0a7709b3f 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -15,7 +15,7 @@ namespace flow { SceneUpdateContext::SceneUpdateContext(scenic_lib::Session* session, SurfaceProducer* surface_producer) : session_(session), surface_producer_(surface_producer) { - FTL_DCHECK(surface_producer_ != nullptr); + FXL_DCHECK(surface_producer_ != nullptr); } SceneUpdateContext::~SceneUpdateContext() { @@ -31,7 +31,7 @@ void SceneUpdateContext::AddChildScene(ExportNode* export_node, SkPoint offset, bool hit_testable) { ASSERT_IS_GPU_THREAD; - FTL_DCHECK(top_entity_); + FXL_DCHECK(top_entity_); export_node->Bind(*this, top_entity_->entity_node(), offset, hit_testable); } @@ -169,7 +169,7 @@ scenic_lib::Image* SceneUpdateContext::GenerateImageIfNeeded( auto surface = surface_producer_->ProduceSurface(physical_size); if (!surface) { - FTL_LOG(ERROR) << "Could not acquire a surface from the surface producer " + FXL_LOG(ERROR) << "Could not acquire a surface from the surface producer " "of size: " << physical_size.width() << "x" << physical_size.height(); return nullptr; @@ -193,7 +193,7 @@ SceneUpdateContext::ExecutePaintTasks(CompositorContext::ScopedFrame& frame) { TRACE_EVENT0("flutter", "SceneUpdateContext::ExecutePaintTasks"); std::vector> surfaces_to_submit; for (auto& task : paint_tasks_) { - FTL_DCHECK(task.surface); + FXL_DCHECK(task.surface); SkCanvas* canvas = task.surface->GetSkiaSurface()->getCanvas(); Layer::PaintContext context = {*canvas, frame.context().frame_time(), frame.context().engine_time(), @@ -222,7 +222,7 @@ SceneUpdateContext::Entity::Entity(SceneUpdateContext& context) } SceneUpdateContext::Entity::~Entity() { - FTL_DCHECK(context_.top_entity_ == this); + FXL_DCHECK(context_.top_entity_ == this); context_.top_entity_ = previous_entity_; } @@ -310,7 +310,7 @@ SceneUpdateContext::Frame::~Frame() { } void SceneUpdateContext::Frame::AddPaintedLayer(Layer* layer) { - FTL_DCHECK(layer->needs_painting()); + FXL_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 627f3159d8dc6..918bfebc47a84 100644 --- a/flow/scene_update_context.h +++ b/flow/scene_update_context.h @@ -10,9 +10,9 @@ #include "lib/ui/scenic/client/resources.h" #include "flutter/flow/compositor_context.h" -#include "lib/ftl/build_config.h" -#include "lib/ftl/logging.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkRect.h" #include "third_party/skia/include/core/SkSurface.h" @@ -140,7 +140,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. - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT std::vector> ExecutePaintTasks( CompositorContext::ScopedFrame& frame); @@ -188,7 +188,7 @@ class SceneUpdateContext { // Save ExportNodes so we can dispose them in our destructor. std::set export_nodes_; - FTL_DISALLOW_COPY_AND_ASSIGN(SceneUpdateContext); + FXL_DISALLOW_COPY_AND_ASSIGN(SceneUpdateContext); }; } // namespace flow diff --git a/fml/icu_util.cc b/fml/icu_util.cc index c2964d6a4474a..a214c4f2593aa 100644 --- a/fml/icu_util.cc +++ b/fml/icu_util.cc @@ -9,8 +9,8 @@ #include "flutter/fml/mapping.h" #include "flutter/fml/paths.h" -#include "lib/ftl/build_config.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/logging.h" #include "third_party/icu/source/common/unicode/udata.h" namespace fml { @@ -51,8 +51,8 @@ class ICUContext { return false; } - // FIXME(chinmaygarde): There is no Path::Join in FTL. So a non-portable - // version is used here. Patch FTL and update. + // FIXME(chinmaygarde): There is no Path::Join in FXL. So a non-portable + // version is used here. Patch FXL and update. auto file = std::make_unique(directory.second + "/" + kIcuDataFileName); if (file->GetSize() != 0) { @@ -85,12 +85,12 @@ class ICUContext { bool valid_; std::unique_ptr mapping_; - FTL_DISALLOW_COPY_AND_ASSIGN(ICUContext); + FXL_DISALLOW_COPY_AND_ASSIGN(ICUContext); }; void InitializeICUOnce(const std::string& icu_data_path) { static ICUContext* context = new ICUContext(icu_data_path); - FTL_CHECK(context->IsValid()) << "Must be able to initialize the ICU context"; + FXL_CHECK(context->IsValid()) << "Must be able to initialize the ICU context"; } std::once_flag g_icu_init_flag; diff --git a/fml/icu_util.h b/fml/icu_util.h index ab3c3af2e8f4d..2d31e151139b2 100644 --- a/fml/icu_util.h +++ b/fml/icu_util.h @@ -7,7 +7,7 @@ #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace fml { namespace icu { diff --git a/fml/mapping.cc b/fml/mapping.cc index a584ccd426d80..07f7edb074ab9 100644 --- a/fml/mapping.cc +++ b/fml/mapping.cc @@ -11,8 +11,8 @@ #include -#include "lib/ftl/build_config.h" -#include "lib/ftl/files/eintr_wrapper.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/files/eintr_wrapper.h" #if OS_MACOSX @@ -40,10 +40,10 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { } FileMapping::FileMapping(const std::string& path) - : FileMapping(ftl::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}) { + : FileMapping(fxl::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}) { } -FileMapping::FileMapping(const ftl::UniqueFD& handle) +FileMapping::FileMapping(const fxl::UniqueFD& handle) : size_(0), mapping_(nullptr) { if (!handle.is_valid()) { return; diff --git a/fml/mapping.h b/fml/mapping.h index da3f050601c44..eba438b4f6ff0 100644 --- a/fml/mapping.h +++ b/fml/mapping.h @@ -7,8 +7,8 @@ #include -#include "lib/ftl/files/unique_fd.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" namespace fml { @@ -23,7 +23,7 @@ class Mapping { virtual const uint8_t* GetMapping() const = 0; private: - FTL_DISALLOW_COPY_AND_ASSIGN(Mapping); + FXL_DISALLOW_COPY_AND_ASSIGN(Mapping); }; bool PlatformHasResourcesBundle(); @@ -34,7 +34,7 @@ class FileMapping : public Mapping { public: FileMapping(const std::string& path); - FileMapping(const ftl::UniqueFD& fd); + FileMapping(const fxl::UniqueFD& fd); ~FileMapping() override; @@ -46,7 +46,7 @@ class FileMapping : public Mapping { size_t size_; uint8_t* mapping_; - FTL_DISALLOW_COPY_AND_ASSIGN(FileMapping); + FXL_DISALLOW_COPY_AND_ASSIGN(FileMapping); }; } // namespace fml diff --git a/fml/message_loop.cc b/fml/message_loop.cc index 87fc88e8f2916..cdc081fad2eba 100644 --- a/fml/message_loop.cc +++ b/fml/message_loop.cc @@ -9,8 +9,8 @@ #include "flutter/fml/message_loop_impl.h" #include "flutter/fml/task_runner.h" #include "flutter/fml/thread_local.h" -#include "lib/ftl/memory/ref_counted.h" -#include "lib/ftl/memory/ref_ptr.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" namespace fml { @@ -20,7 +20,7 @@ FML_THREAD_LOCAL ThreadLocal tls_message_loop([](intptr_t value) { MessageLoop& MessageLoop::GetCurrent() { auto loop = reinterpret_cast(tls_message_loop.Get()); - FTL_CHECK(loop != nullptr) + FXL_CHECK(loop != nullptr) << "MessageLoop::EnsureInitializedForCurrentThread was not called on " "this thread prior to message loop use."; return *loop; @@ -40,9 +40,9 @@ bool MessageLoop::IsInitializedForCurrentThread() { MessageLoop::MessageLoop() : loop_(MessageLoopImpl::Create()), - task_runner_(ftl::MakeRefCounted(loop_)) { - FTL_CHECK(loop_); - FTL_CHECK(task_runner_); + task_runner_(fxl::MakeRefCounted(loop_)) { + FXL_CHECK(loop_); + FXL_CHECK(task_runner_); } MessageLoop::~MessageLoop() = default; @@ -55,11 +55,11 @@ void MessageLoop::Terminate() { loop_->DoTerminate(); } -ftl::RefPtr MessageLoop::GetTaskRunner() const { +fxl::RefPtr MessageLoop::GetTaskRunner() const { return task_runner_; } -ftl::RefPtr MessageLoop::GetLoopImpl() const { +fxl::RefPtr MessageLoop::GetLoopImpl() const { return loop_; } diff --git a/fml/message_loop.h b/fml/message_loop.h index cf49b4186aacb..a9f32285acd7e 100644 --- a/fml/message_loop.h +++ b/fml/message_loop.h @@ -6,8 +6,8 @@ #define FLUTTER_FML_MESSAGE_LOOP_H_ #include "flutter/fml/task_observer.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/tasks/task_runner.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/tasks/task_runner.h" namespace fml { @@ -28,7 +28,7 @@ class MessageLoop { void RemoveTaskObserver(TaskObserver* observer); - ftl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; static void EnsureInitializedForCurrentThread(); @@ -40,14 +40,14 @@ class MessageLoop { friend class TaskRunner; friend class MessageLoopImpl; - ftl::RefPtr loop_; - ftl::RefPtr task_runner_; + fxl::RefPtr loop_; + fxl::RefPtr task_runner_; MessageLoop(); - ftl::RefPtr GetLoopImpl() const; + fxl::RefPtr GetLoopImpl() const; - FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoop); + FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoop); }; } // namespace fml diff --git a/fml/message_loop_impl.cc b/fml/message_loop_impl.cc index ee39dc9d876bc..8ccf5083768fe 100644 --- a/fml/message_loop_impl.cc +++ b/fml/message_loop_impl.cc @@ -8,7 +8,7 @@ #include #include "flutter/fml/trace_event.h" -#include "lib/ftl/build_config.h" +#include "lib/fxl/build_config.h" #if OS_MACOSX @@ -38,16 +38,16 @@ using PlatformMessageLoopImpl = fml::MessageLoopWin; namespace fml { -ftl::RefPtr MessageLoopImpl::Create() { - return ftl::MakeRefCounted<::PlatformMessageLoopImpl>(); +fxl::RefPtr MessageLoopImpl::Create() { + return fxl::MakeRefCounted<::PlatformMessageLoopImpl>(); } MessageLoopImpl::MessageLoopImpl() : order_(0), terminated_(false) {} MessageLoopImpl::~MessageLoopImpl() = default; -void MessageLoopImpl::PostTask(ftl::Closure task, ftl::TimePoint target_time) { - FTL_DCHECK(task != nullptr); +void MessageLoopImpl::PostTask(fxl::Closure task, fxl::TimePoint target_time) { + FXL_DCHECK(task != nullptr); RegisterTask(task, target_time); } @@ -56,16 +56,16 @@ void MessageLoopImpl::RunExpiredTasksNow() { } void MessageLoopImpl::AddTaskObserver(TaskObserver* observer) { - FTL_DCHECK(observer != nullptr); - FTL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) + FXL_DCHECK(observer != nullptr); + FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be added on the same thread as the " "loop."; task_observers_.insert(observer); } void MessageLoopImpl::RemoveTaskObserver(TaskObserver* observer) { - FTL_DCHECK(observer != nullptr); - FTL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) + FXL_DCHECK(observer != nullptr); + FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be removed from the same thread as " "the loop."; task_observers_.erase(observer); @@ -94,7 +94,7 @@ void MessageLoopImpl::DoRun() { // should be destructed on the message loop's thread. We have just returned // from the implementations |Run| method which we know is on the correct // thread. Drop all pending tasks on the floor. - ftl::MutexLocker lock(&delayed_tasks_mutex_); + fxl::MutexLocker lock(&delayed_tasks_mutex_); delayed_tasks_ = {}; } @@ -103,31 +103,31 @@ void MessageLoopImpl::DoTerminate() { Terminate(); } -void MessageLoopImpl::RegisterTask(ftl::Closure task, - ftl::TimePoint target_time) { - FTL_DCHECK(task != nullptr); +void MessageLoopImpl::RegisterTask(fxl::Closure task, + fxl::TimePoint target_time) { + FXL_DCHECK(task != nullptr); if (terminated_) { // If the message loop has already been terminated, PostTask should destruct // |task| synchronously within this function. return; } - ftl::MutexLocker lock(&delayed_tasks_mutex_); + fxl::MutexLocker lock(&delayed_tasks_mutex_); delayed_tasks_.push({++order_, std::move(task), target_time}); WakeUp(delayed_tasks_.top().target_time); } void MessageLoopImpl::RunExpiredTasks() { TRACE_EVENT0("fml", "MessageLoop::RunExpiredTasks"); - std::vector invocations; + std::vector invocations; { - ftl::MutexLocker lock(&delayed_tasks_mutex_); + fxl::MutexLocker lock(&delayed_tasks_mutex_); if (delayed_tasks_.empty()) { return; } - auto now = ftl::TimePoint::Now(); + auto now = fxl::TimePoint::Now(); while (!delayed_tasks_.empty()) { const auto& top = delayed_tasks_.top(); if (top.target_time > now) { @@ -137,7 +137,7 @@ void MessageLoopImpl::RunExpiredTasks() { delayed_tasks_.pop(); } - WakeUp(delayed_tasks_.empty() ? ftl::TimePoint::Max() + WakeUp(delayed_tasks_.empty() ? fxl::TimePoint::Max() : delayed_tasks_.top().target_time); } diff --git a/fml/message_loop_impl.h b/fml/message_loop_impl.h index f353a056f38d4..92a9b482d43f4 100644 --- a/fml/message_loop_impl.h +++ b/fml/message_loop_impl.h @@ -12,18 +12,18 @@ #include #include "flutter/fml/message_loop.h" -#include "lib/ftl/functional/closure.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/ref_counted.h" -#include "lib/ftl/synchronization/mutex.h" -#include "lib/ftl/synchronization/thread_annotations.h" -#include "lib/ftl/time/time_point.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/synchronization/mutex.h" +#include "lib/fxl/synchronization/thread_annotations.h" +#include "lib/fxl/time/time_point.h" namespace fml { -class MessageLoopImpl : public ftl::RefCountedThreadSafe { +class MessageLoopImpl : public fxl::RefCountedThreadSafe { public: - static ftl::RefPtr Create(); + static fxl::RefPtr Create(); virtual ~MessageLoopImpl(); @@ -31,9 +31,9 @@ class MessageLoopImpl : public ftl::RefCountedThreadSafe { virtual void Terminate() = 0; - virtual void WakeUp(ftl::TimePoint time_point) = 0; + virtual void WakeUp(fxl::TimePoint time_point) = 0; - void PostTask(ftl::Closure task, ftl::TimePoint target_time); + void PostTask(fxl::Closure task, fxl::TimePoint target_time); void AddTaskObserver(TaskObserver* observer); @@ -51,12 +51,12 @@ class MessageLoopImpl : public ftl::RefCountedThreadSafe { private: struct DelayedTask { size_t order; - ftl::Closure task; - ftl::TimePoint target_time; + fxl::Closure task; + fxl::TimePoint target_time; DelayedTask(size_t p_order, - ftl::Closure p_task, - ftl::TimePoint p_target_time) + fxl::Closure p_task, + fxl::TimePoint p_target_time) : order(p_order), task(std::move(p_task)), target_time(p_target_time) {} }; @@ -71,16 +71,16 @@ class MessageLoopImpl : public ftl::RefCountedThreadSafe { priority_queue, DelayedTaskCompare>; std::set task_observers_; - ftl::Mutex delayed_tasks_mutex_; - DelayedTaskQueue delayed_tasks_ FTL_GUARDED_BY(delayed_tasks_mutex_); - size_t order_ FTL_GUARDED_BY(delayed_tasks_mutex_); + fxl::Mutex delayed_tasks_mutex_; + DelayedTaskQueue delayed_tasks_ FXL_GUARDED_BY(delayed_tasks_mutex_); + size_t order_ FXL_GUARDED_BY(delayed_tasks_mutex_); std::atomic_bool terminated_; - void RegisterTask(ftl::Closure task, ftl::TimePoint target_time); + void RegisterTask(fxl::Closure task, fxl::TimePoint target_time); void RunExpiredTasks(); - FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoopImpl); + FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopImpl); }; } // namespace fml diff --git a/fml/message_loop_unittests.cc b/fml/message_loop_unittests.cc index 3277c76f70213..f2a74a5f4a11c 100644 --- a/fml/message_loop_unittests.cc +++ b/fml/message_loop_unittests.cc @@ -6,7 +6,7 @@ #include "flutter/fml/message_loop.h" #include "gtest/gtest.h" -#include "lib/ftl/synchronization/waitable_event.h" +#include "lib/fxl/synchronization/waitable_event.h" #define TIME_SENSITIVE(x) TimeSensitiveTest_##x @@ -20,8 +20,8 @@ TEST(MessageLoop, GetCurrent) { TEST(MessageLoop, DifferentThreadsHaveDifferentLoops) { fml::MessageLoop* loop1 = nullptr; - ftl::AutoResetWaitableEvent latch1; - ftl::AutoResetWaitableEvent term1; + fxl::AutoResetWaitableEvent latch1; + fxl::AutoResetWaitableEvent term1; std::thread thread1([&loop1, &latch1, &term1]() { fml::MessageLoop::EnsureInitializedForCurrentThread(); loop1 = &fml::MessageLoop::GetCurrent(); @@ -30,8 +30,8 @@ TEST(MessageLoop, DifferentThreadsHaveDifferentLoops) { }); fml::MessageLoop* loop2 = nullptr; - ftl::AutoResetWaitableEvent latch2; - ftl::AutoResetWaitableEvent term2; + fxl::AutoResetWaitableEvent latch2; + fxl::AutoResetWaitableEvent term2; std::thread thread2([&loop2, &latch2, &term2]() { fml::MessageLoop::EnsureInitializedForCurrentThread(); loop2 = &fml::MessageLoop::GetCurrent(); @@ -102,7 +102,7 @@ TEST(MessageLoop, DelayedTasksAtSameTimeAreRunInOrder) { auto& loop = fml::MessageLoop::GetCurrent(); size_t current = 0; const auto now_plus_some = - ftl::TimePoint::Now() + ftl::TimeDelta::FromMilliseconds(2); + fxl::TimePoint::Now() + fxl::TimeDelta::FromMilliseconds(2); for (size_t i = 0; i < count; i++) { loop.GetTaskRunner()->PostTaskForTime( [&terminated, i, ¤t]() { @@ -125,8 +125,8 @@ TEST(MessageLoop, DelayedTasksAtSameTimeAreRunInOrder) { } TEST(MessageLoop, CheckRunsTaskOnCurrentThread) { - ftl::RefPtr runner; - ftl::AutoResetWaitableEvent latch; + fxl::RefPtr runner; + fxl::AutoResetWaitableEvent latch; std::thread thread([&runner, &latch]() { fml::MessageLoop::EnsureInitializedForCurrentThread(); auto& loop = fml::MessageLoop::GetCurrent(); @@ -145,17 +145,17 @@ TEST(MessageLoop, TIME_SENSITIVE(SingleDelayedTaskByDelta)) { std::thread thread([&checked]() { fml::MessageLoop::EnsureInitializedForCurrentThread(); auto& loop = fml::MessageLoop::GetCurrent(); - auto begin = ftl::TimePoint::Now(); + auto begin = fxl::TimePoint::Now(); loop.GetTaskRunner()->PostDelayedTask( [begin, &checked]() { - auto delta = ftl::TimePoint::Now() - begin; + auto delta = fxl::TimePoint::Now() - begin; auto ms = delta.ToMillisecondsF(); ASSERT_GE(ms, 3); ASSERT_LE(ms, 7); checked = true; fml::MessageLoop::GetCurrent().Terminate(); }, - ftl::TimeDelta::FromMilliseconds(5)); + fxl::TimeDelta::FromMilliseconds(5)); loop.Run(); }); thread.join(); @@ -167,17 +167,17 @@ TEST(MessageLoop, TIME_SENSITIVE(SingleDelayedTaskForTime)) { std::thread thread([&checked]() { fml::MessageLoop::EnsureInitializedForCurrentThread(); auto& loop = fml::MessageLoop::GetCurrent(); - auto begin = ftl::TimePoint::Now(); + auto begin = fxl::TimePoint::Now(); loop.GetTaskRunner()->PostTaskForTime( [begin, &checked]() { - auto delta = ftl::TimePoint::Now() - begin; + auto delta = fxl::TimePoint::Now() - begin; auto ms = delta.ToMillisecondsF(); ASSERT_GE(ms, 3); ASSERT_LE(ms, 7); checked = true; fml::MessageLoop::GetCurrent().Terminate(); }, - ftl::TimePoint::Now() + ftl::TimeDelta::FromMilliseconds(5)); + fxl::TimePoint::Now() + fxl::TimeDelta::FromMilliseconds(5)); loop.Run(); }); thread.join(); @@ -191,10 +191,10 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithIncreasingDeltas)) { fml::MessageLoop::EnsureInitializedForCurrentThread(); auto& loop = fml::MessageLoop::GetCurrent(); for (int target_ms = 0 + 2; target_ms < count + 2; target_ms++) { - auto begin = ftl::TimePoint::Now(); + auto begin = fxl::TimePoint::Now(); loop.GetTaskRunner()->PostDelayedTask( [begin, target_ms, &checked]() { - auto delta = ftl::TimePoint::Now() - begin; + auto delta = fxl::TimePoint::Now() - begin; auto ms = delta.ToMillisecondsF(); ASSERT_GE(ms, target_ms - 2); ASSERT_LE(ms, target_ms + 2); @@ -203,7 +203,7 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithIncreasingDeltas)) { fml::MessageLoop::GetCurrent().Terminate(); } }, - ftl::TimeDelta::FromMilliseconds(target_ms)); + fxl::TimeDelta::FromMilliseconds(target_ms)); } loop.Run(); }); @@ -218,10 +218,10 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithDecreasingDeltas)) { fml::MessageLoop::EnsureInitializedForCurrentThread(); auto& loop = fml::MessageLoop::GetCurrent(); for (int target_ms = count + 2; target_ms > 0 + 2; target_ms--) { - auto begin = ftl::TimePoint::Now(); + auto begin = fxl::TimePoint::Now(); loop.GetTaskRunner()->PostDelayedTask( [begin, target_ms, &checked]() { - auto delta = ftl::TimePoint::Now() - begin; + auto delta = fxl::TimePoint::Now() - begin; auto ms = delta.ToMillisecondsF(); ASSERT_GE(ms, target_ms - 2); ASSERT_LE(ms, target_ms + 2); @@ -230,7 +230,7 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithDecreasingDeltas)) { fml::MessageLoop::GetCurrent().Terminate(); } }, - ftl::TimeDelta::FromMilliseconds(target_ms)); + fxl::TimeDelta::FromMilliseconds(target_ms)); } loop.Run(); }); diff --git a/fml/platform/android/jni_util.cc b/fml/platform/android/jni_util.cc index a1dd2d3a29ce0..2d4375b7ece44 100644 --- a/fml/platform/android/jni_util.cc +++ b/fml/platform/android/jni_util.cc @@ -7,26 +7,26 @@ #include #include -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace fml { namespace jni { static JavaVM* g_jvm = nullptr; -#define ASSERT_NO_EXCEPTION() FTL_CHECK(env->ExceptionCheck() == JNI_FALSE); +#define ASSERT_NO_EXCEPTION() FXL_CHECK(env->ExceptionCheck() == JNI_FALSE); void InitJavaVM(JavaVM* vm) { - FTL_DCHECK(g_jvm == nullptr); + FXL_DCHECK(g_jvm == nullptr); g_jvm = vm; } JNIEnv* AttachCurrentThread() { - FTL_DCHECK(g_jvm != nullptr) + FXL_DCHECK(g_jvm != nullptr) << "Trying to attach to current thread without calling InitJavaVM first."; JNIEnv* env = nullptr; jint ret = g_jvm->AttachCurrentThread(&env, nullptr); - FTL_DCHECK(JNI_OK == ret); + FXL_DCHECK(JNI_OK == ret); return env; } @@ -97,10 +97,10 @@ std::vector StringArrayToVector(JNIEnv* env, jobjectArray array) { ScopedJavaLocalRef VectorToStringArray( JNIEnv* env, const std::vector& vector) { - FTL_DCHECK(env); + FXL_DCHECK(env); ScopedJavaLocalRef string_clazz(env, env->FindClass("java/lang/String")); - FTL_DCHECK(!string_clazz.is_null()); + FXL_DCHECK(!string_clazz.is_null()); jobjectArray joa = env->NewObjectArray(vector.size(), string_clazz.obj(), NULL); ASSERT_NO_EXCEPTION(); diff --git a/fml/platform/android/jni_util.h b/fml/platform/android/jni_util.h index 99fafee13cdb3..358d14d0e9805 100644 --- a/fml/platform/android/jni_util.h +++ b/fml/platform/android/jni_util.h @@ -10,7 +10,7 @@ #include #include "flutter/fml/platform/android/scoped_java_ref.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace fml { namespace jni { diff --git a/fml/platform/android/jni_weak_ref.cc b/fml/platform/android/jni_weak_ref.cc index 62aea8cee0228..c28f6660b667e 100644 --- a/fml/platform/android/jni_weak_ref.cc +++ b/fml/platform/android/jni_weak_ref.cc @@ -5,7 +5,7 @@ #include "flutter/fml/platform/android/jni_weak_ref.h" #include "flutter/fml/platform/android/jni_util.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace fml { namespace jni { @@ -20,7 +20,7 @@ JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef( JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef(JNIEnv* env, jobject obj) : obj_(env->NewWeakGlobalRef(obj)) { - FTL_DCHECK(obj_); + FXL_DCHECK(obj_); } JavaObjectWeakGlobalRef::~JavaObjectWeakGlobalRef() { @@ -47,7 +47,7 @@ ScopedJavaLocalRef GetRealObject(JNIEnv* env, jweak obj) { if (obj) { real = env->NewLocalRef(obj); if (!real) - FTL_DLOG(ERROR) << "The real object has been deleted!"; + FXL_DLOG(ERROR) << "The real object has been deleted!"; } return ScopedJavaLocalRef(env, real); } diff --git a/fml/platform/android/message_loop_android.cc b/fml/platform/android/message_loop_android.cc index 8be30eb1f8c13..7a83e22509449 100644 --- a/fml/platform/android/message_loop_android.cc +++ b/fml/platform/android/message_loop_android.cc @@ -8,7 +8,7 @@ #include #include "flutter/fml/platform/linux/timerfd.h" -#include "lib/ftl/files/eintr_wrapper.h" +#include "lib/fxl/files/eintr_wrapper.h" namespace fml { @@ -33,8 +33,8 @@ MessageLoopAndroid::MessageLoopAndroid() : looper_(AcquireLooperForThread()), timer_fd_(::timerfd_create(kClockType, TFD_NONBLOCK | TFD_CLOEXEC)), running_(false) { - FTL_CHECK(looper_.is_valid()); - FTL_CHECK(timer_fd_.is_valid()); + FXL_CHECK(looper_.is_valid()); + FXL_CHECK(timer_fd_.is_valid()); static const int kWakeEvents = ALOOPER_EVENT_INPUT; @@ -52,16 +52,16 @@ MessageLoopAndroid::MessageLoopAndroid() read_event_fd, // callback this // baton ); - FTL_CHECK(add_result == 1); + FXL_CHECK(add_result == 1); } MessageLoopAndroid::~MessageLoopAndroid() { int remove_result = ::ALooper_removeFd(looper_.get(), timer_fd_.get()); - FTL_CHECK(remove_result == 1); + FXL_CHECK(remove_result == 1); } void MessageLoopAndroid::Run() { - FTL_DCHECK(looper_.get() == ALooper_forThread()); + FXL_DCHECK(looper_.get() == ALooper_forThread()); running_ = true; @@ -83,9 +83,9 @@ void MessageLoopAndroid::Terminate() { ALooper_wake(looper_.get()); } -void MessageLoopAndroid::WakeUp(ftl::TimePoint time_point) { +void MessageLoopAndroid::WakeUp(fxl::TimePoint time_point) { bool result = TimerRearm(timer_fd_.get(), time_point); - FTL_DCHECK(result); + FXL_DCHECK(result); } void MessageLoopAndroid::OnEventFired() { diff --git a/fml/platform/android/message_loop_android.h b/fml/platform/android/message_loop_android.h index 82a11b06031c8..e6d04e8253401 100644 --- a/fml/platform/android/message_loop_android.h +++ b/fml/platform/android/message_loop_android.h @@ -10,9 +10,9 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "lib/ftl/files/unique_fd.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/unique_object.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/unique_object.h" namespace fml { @@ -24,8 +24,8 @@ struct UniqueLooperTraits { class MessageLoopAndroid : public MessageLoopImpl { private: - ftl::UniqueObject looper_; - ftl::UniqueFD timer_fd_; + fxl::UniqueObject looper_; + fxl::UniqueFD timer_fd_; bool running_; MessageLoopAndroid(); @@ -36,13 +36,13 @@ class MessageLoopAndroid : public MessageLoopImpl { void Terminate() override; - void WakeUp(ftl::TimePoint time_point) override; + void WakeUp(fxl::TimePoint time_point) override; void OnEventFired(); FRIEND_MAKE_REF_COUNTED(MessageLoopAndroid); FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopAndroid); - FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoopAndroid); + FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopAndroid); }; } // namespace fml diff --git a/fml/platform/android/scoped_java_ref.cc b/fml/platform/android/scoped_java_ref.cc index aadc9fbdd09c4..d682f60a4fd05 100644 --- a/fml/platform/android/scoped_java_ref.cc +++ b/fml/platform/android/scoped_java_ref.cc @@ -5,7 +5,7 @@ #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/platform/android/jni_util.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace fml { namespace jni { @@ -14,13 +14,13 @@ static const int kDefaultLocalFrameCapacity = 16; ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env) : env_(env) { int failed = env_->PushLocalFrame(kDefaultLocalFrameCapacity); - FTL_DCHECK(!failed); + FXL_DCHECK(!failed); } ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env, int capacity) : env_(env) { int failed = env_->PushLocalFrame(capacity); - FTL_DCHECK(!failed); + FXL_DCHECK(!failed); } ScopedJavaLocalFrame::~ScopedJavaLocalFrame() { @@ -31,7 +31,7 @@ JavaRef::JavaRef() : obj_(NULL) {} JavaRef::JavaRef(JNIEnv* env, jobject obj) : obj_(obj) { if (obj) { - FTL_DCHECK(env && env->GetObjectRefType(obj) == JNILocalRefType); + FXL_DCHECK(env && env->GetObjectRefType(obj) == JNILocalRefType); } } @@ -41,7 +41,7 @@ JNIEnv* JavaRef::SetNewLocalRef(JNIEnv* env, jobject obj) { if (!env) { env = AttachCurrentThread(); } else { - FTL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. + FXL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. } if (obj) obj = env->NewLocalRef(obj); @@ -55,7 +55,7 @@ void JavaRef::SetNewGlobalRef(JNIEnv* env, jobject obj) { if (!env) { env = AttachCurrentThread(); } else { - FTL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. + FXL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. } if (obj) obj = env->NewGlobalRef(obj); @@ -66,7 +66,7 @@ void JavaRef::SetNewGlobalRef(JNIEnv* env, jobject obj) { void JavaRef::ResetLocalRef(JNIEnv* env) { if (obj_) { - FTL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. + FXL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. env->DeleteLocalRef(obj_); obj_ = NULL; } diff --git a/fml/platform/android/scoped_java_ref.h b/fml/platform/android/scoped_java_ref.h index 144356657299c..f98aebf51d8de 100644 --- a/fml/platform/android/scoped_java_ref.h +++ b/fml/platform/android/scoped_java_ref.h @@ -8,7 +8,7 @@ #include #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace fml { namespace jni { @@ -27,7 +27,7 @@ class ScopedJavaLocalFrame { // it's safe to cache the non-threadsafe JNIEnv* inside this object. JNIEnv* env_; - FTL_DISALLOW_COPY_AND_ASSIGN(ScopedJavaLocalFrame); + FXL_DISALLOW_COPY_AND_ASSIGN(ScopedJavaLocalFrame); }; // Forward declare the generic java reference template class. @@ -65,7 +65,7 @@ class JavaRef { private: jobject obj_; - FTL_DISALLOW_COPY_AND_ASSIGN(JavaRef); + FXL_DISALLOW_COPY_AND_ASSIGN(JavaRef); }; // Generic base class for ScopedJavaLocalRef and ScopedJavaGlobalRef. Useful @@ -83,7 +83,7 @@ class JavaRef : public JavaRef { JavaRef(JNIEnv* env, T obj) : JavaRef(env, obj) {} private: - FTL_DISALLOW_COPY_AND_ASSIGN(JavaRef); + FXL_DISALLOW_COPY_AND_ASSIGN(JavaRef); }; // Holds a local reference to a Java object. The local reference is scoped diff --git a/fml/platform/darwin/cf_utils.h b/fml/platform/darwin/cf_utils.h index 309f1105f2701..e3e26adaed5c9 100644 --- a/fml/platform/darwin/cf_utils.h +++ b/fml/platform/darwin/cf_utils.h @@ -7,7 +7,7 @@ #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace fml { @@ -40,7 +40,7 @@ class CFRef { private: T instance_; - FTL_DISALLOW_COPY_AND_ASSIGN(CFRef); + FXL_DISALLOW_COPY_AND_ASSIGN(CFRef); }; } // namespace fml diff --git a/fml/platform/darwin/message_loop_darwin.h b/fml/platform/darwin/message_loop_darwin.h index 6702b056bf698..902aafd01291c 100644 --- a/fml/platform/darwin/message_loop_darwin.h +++ b/fml/platform/darwin/message_loop_darwin.h @@ -11,7 +11,7 @@ #include "flutter/fml/message_loop_impl.h" #include "flutter/fml/platform/darwin/cf_utils.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace fml { @@ -29,13 +29,13 @@ class MessageLoopDarwin : public MessageLoopImpl { void Terminate() override; - void WakeUp(ftl::TimePoint time_point) override; + void WakeUp(fxl::TimePoint time_point) override; static void OnTimerFire(CFRunLoopTimerRef timer, MessageLoopDarwin* loop); FRIEND_MAKE_REF_COUNTED(MessageLoopDarwin); FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopDarwin); - FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoopDarwin); + FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopDarwin); }; } // namespace fml diff --git a/fml/platform/darwin/platform_version.h b/fml/platform/darwin/platform_version.h index e6247e98c947d..b92641655ed47 100644 --- a/fml/platform/darwin/platform_version.h +++ b/fml/platform/darwin/platform_version.h @@ -6,7 +6,7 @@ #define FLUTTER_FML_PLATFORM_DARWIN_PLATFORM_VERSION_H_ #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace fml { diff --git a/fml/platform/darwin/resource_mapping_darwin.h b/fml/platform/darwin/resource_mapping_darwin.h index 033e15a608a05..c3b939cea7c7d 100644 --- a/fml/platform/darwin/resource_mapping_darwin.h +++ b/fml/platform/darwin/resource_mapping_darwin.h @@ -6,7 +6,7 @@ #define FLUTTER_FML_PLATFORM_DARWIN_RESOURCE_MAPPING_DARWIN_H_ #include "flutter/fml/mapping.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace fml { @@ -23,7 +23,7 @@ class ResourceMappingDarwin : public Mapping { private: FileMapping actual_; - FTL_DISALLOW_COPY_AND_ASSIGN(ResourceMappingDarwin); + FXL_DISALLOW_COPY_AND_ASSIGN(ResourceMappingDarwin); }; } // namespace fml diff --git a/fml/platform/darwin/scoped_block.h b/fml/platform/darwin/scoped_block.h index ee7434a580f95..e7a16e9d569ec 100644 --- a/fml/platform/darwin/scoped_block.h +++ b/fml/platform/darwin/scoped_block.h @@ -7,7 +7,7 @@ #include -#include "lib/ftl/compiler_specific.h" +#include "lib/fxl/compiler_specific.h" namespace fml { @@ -72,7 +72,7 @@ class ScopedBlock { block_ = temp; } - B release() FTL_WARN_UNUSED_RESULT { + B release() FXL_WARN_UNUSED_RESULT { B temp = block_; block_ = nullptr; return temp; diff --git a/fml/platform/darwin/scoped_nsobject.h b/fml/platform/darwin/scoped_nsobject.h index 03f0a824f7ee5..91d60ae8f3697 100644 --- a/fml/platform/darwin/scoped_nsobject.h +++ b/fml/platform/darwin/scoped_nsobject.h @@ -10,8 +10,8 @@ // singled out because it is most typically included from other header files. #import -#include "lib/ftl/compiler_specific.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" @class NSAutoreleasePool; @@ -81,7 +81,7 @@ class scoped_nsprotocol { // scoped_nsprotocol<>::release() is like scoped_ptr<>::release. It is NOT a // wrapper for [object_ release]. To force a scoped_nsprotocol<> to call // [object_ release], use scoped_nsprotocol<>::reset(). - NST release() FTL_WARN_UNUSED_RESULT { + NST release() FXL_WARN_UNUSED_RESULT { NST temp = object_; object_ = nil; return temp; @@ -155,7 +155,7 @@ template <> class scoped_nsobject { private: explicit scoped_nsobject(NSAutoreleasePool* object = nil); - FTL_DISALLOW_COPY_AND_ASSIGN(scoped_nsobject); + FXL_DISALLOW_COPY_AND_ASSIGN(scoped_nsobject); }; } // namespace fml diff --git a/fml/platform/linux/message_loop_linux.cc b/fml/platform/linux/message_loop_linux.cc index 70a94dd41a8e0..e80e7f9d1495e 100644 --- a/fml/platform/linux/message_loop_linux.cc +++ b/fml/platform/linux/message_loop_linux.cc @@ -8,7 +8,7 @@ #include #include "flutter/fml/platform/linux/timerfd.h" -#include "lib/ftl/files/eintr_wrapper.h" +#include "lib/fxl/files/eintr_wrapper.h" namespace fml { @@ -18,15 +18,15 @@ MessageLoopLinux::MessageLoopLinux() : epoll_fd_(HANDLE_EINTR(::epoll_create(1 /* unused */))), timer_fd_(::timerfd_create(kClockType, TFD_NONBLOCK | TFD_CLOEXEC)), running_(false) { - FTL_CHECK(epoll_fd_.is_valid()); - FTL_CHECK(timer_fd_.is_valid()); + FXL_CHECK(epoll_fd_.is_valid()); + FXL_CHECK(timer_fd_.is_valid()); bool added_source = AddOrRemoveTimerSource(true); - FTL_CHECK(added_source); + FXL_CHECK(added_source); } MessageLoopLinux::~MessageLoopLinux() { bool removed_source = AddOrRemoveTimerSource(false); - FTL_CHECK(removed_source); + FXL_CHECK(removed_source); } bool MessageLoopLinux::AddOrRemoveTimerSource(bool add) { @@ -73,12 +73,12 @@ void MessageLoopLinux::Run() { void MessageLoopLinux::Terminate() { running_ = false; - WakeUp(ftl::TimePoint::Now()); + WakeUp(fxl::TimePoint::Now()); } -void MessageLoopLinux::WakeUp(ftl::TimePoint time_point) { +void MessageLoopLinux::WakeUp(fxl::TimePoint time_point) { bool result = TimerRearm(timer_fd_.get(), time_point); - FTL_DCHECK(result); + FXL_DCHECK(result); } void MessageLoopLinux::OnEventFired() { diff --git a/fml/platform/linux/message_loop_linux.h b/fml/platform/linux/message_loop_linux.h index f47a0615df519..51dc690ce887b 100644 --- a/fml/platform/linux/message_loop_linux.h +++ b/fml/platform/linux/message_loop_linux.h @@ -8,15 +8,15 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "lib/ftl/files/unique_fd.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" namespace fml { class MessageLoopLinux : public MessageLoopImpl { private: - ftl::UniqueFD epoll_fd_; - ftl::UniqueFD timer_fd_; + fxl::UniqueFD epoll_fd_; + fxl::UniqueFD timer_fd_; bool running_; MessageLoopLinux(); @@ -27,7 +27,7 @@ class MessageLoopLinux : public MessageLoopImpl { void Terminate() override; - void WakeUp(ftl::TimePoint time_point) override; + void WakeUp(fxl::TimePoint time_point) override; void OnEventFired(); @@ -35,7 +35,7 @@ class MessageLoopLinux : public MessageLoopImpl { FRIEND_MAKE_REF_COUNTED(MessageLoopLinux); FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopLinux); - FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoopLinux); + FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopLinux); }; } // namespace fml diff --git a/fml/platform/linux/paths_linux.cc b/fml/platform/linux/paths_linux.cc index 64e361ca7d033..cca676e4d04bf 100644 --- a/fml/platform/linux/paths_linux.cc +++ b/fml/platform/linux/paths_linux.cc @@ -6,7 +6,7 @@ #include -#include "lib/ftl/files/path.h" +#include "lib/fxl/files/path.h" namespace fml { namespace paths { diff --git a/fml/platform/linux/timerfd.cc b/fml/platform/linux/timerfd.cc index e3137ea6003dc..1aa6ebeb53aeb 100644 --- a/fml/platform/linux/timerfd.cc +++ b/fml/platform/linux/timerfd.cc @@ -7,7 +7,7 @@ #include #include -#include "lib/ftl/files/eintr_wrapper.h" +#include "lib/fxl/files/eintr_wrapper.h" #if FML_TIMERFD_AVAILABLE == 0 @@ -33,7 +33,7 @@ namespace fml { #define NSEC_PER_SEC 1000000000 #endif -bool TimerRearm(int fd, ftl::TimePoint time_point) { +bool TimerRearm(int fd, fxl::TimePoint time_point) { const uint64_t nano_secs = time_point.ToEpochDelta().ToNanoseconds(); struct itimerspec spec = {}; diff --git a/fml/platform/linux/timerfd.h b/fml/platform/linux/timerfd.h index c8c6b7aa0aa21..d55a697176a7f 100644 --- a/fml/platform/linux/timerfd.h +++ b/fml/platform/linux/timerfd.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FML_PLATFORM_LINUX_TIMER_FD_H_ #define FLUTTER_FML_PLATFORM_LINUX_TIMER_FD_H_ -#include "lib/ftl/time/time_point.h" +#include "lib/fxl/time/time_point.h" // clang-format off #if __has_include() @@ -41,7 +41,7 @@ int timerfd_settime(int ufc, namespace fml { /// Rearms the timer to expire at the given time point. -bool TimerRearm(int fd, ftl::TimePoint time_point); +bool TimerRearm(int fd, fxl::TimePoint time_point); /// Drains the timer FD and retuns true if it has expired. This may be false in /// case the timer read is non-blocking and this routine was called before the diff --git a/fml/platform/win/message_loop_win.cc b/fml/platform/win/message_loop_win.cc index fcd5bafa4f572..67c592b3ea3ea 100644 --- a/fml/platform/win/message_loop_win.cc +++ b/fml/platform/win/message_loop_win.cc @@ -8,7 +8,7 @@ namespace fml { MessageLoopWin::MessageLoopWin() : timer_(CreateWaitableTimer(NULL, FALSE, NULL)) { - FTL_CHECK(timer_.is_valid()); + FXL_CHECK(timer_.is_valid()); } MessageLoopWin::~MessageLoopWin() = default; @@ -17,23 +17,23 @@ void MessageLoopWin::Run() { running_ = true; while (running_) { - FTL_CHECK(WaitForSingleObject(timer_.get(), INFINITE) == 0); + FXL_CHECK(WaitForSingleObject(timer_.get(), INFINITE) == 0); RunExpiredTasksNow(); } } void MessageLoopWin::Terminate() { running_ = false; - WakeUp(ftl::TimePoint::Now()); + WakeUp(fxl::TimePoint::Now()); } -void MessageLoopWin::WakeUp(ftl::TimePoint time_point) { +void MessageLoopWin::WakeUp(fxl::TimePoint time_point) { LARGE_INTEGER due_time = {0}; - ftl::TimePoint now = ftl::TimePoint::Now(); + fxl::TimePoint now = fxl::TimePoint::Now(); if (time_point > now) { due_time.QuadPart = (time_point - now).ToNanoseconds() / -100; } - FTL_CHECK(SetWaitableTimer(timer_.get(), &due_time, 0, NULL, NULL, FALSE)); + FXL_CHECK(SetWaitableTimer(timer_.get(), &due_time, 0, NULL, NULL, FALSE)); } } // namespace fml diff --git a/fml/platform/win/message_loop_win.h b/fml/platform/win/message_loop_win.h index 4bf3e91e7631a..1b02ad6cc22d2 100644 --- a/fml/platform/win/message_loop_win.h +++ b/fml/platform/win/message_loop_win.h @@ -10,8 +10,8 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/unique_object.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/unique_object.h" namespace fml { @@ -24,7 +24,7 @@ class MessageLoopWin : public MessageLoopImpl { }; bool running_; - ftl::UniqueObject timer_; + fxl::UniqueObject timer_; MessageLoopWin(); @@ -34,11 +34,11 @@ class MessageLoopWin : public MessageLoopImpl { void Terminate() override; - void WakeUp(ftl::TimePoint time_point) override; + void WakeUp(fxl::TimePoint time_point) override; FRIEND_MAKE_REF_COUNTED(MessageLoopWin); FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopWin); - FTL_DISALLOW_COPY_AND_ASSIGN(MessageLoopWin); + FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopWin); }; } // namespace fml diff --git a/fml/platform/win/paths_win.cc b/fml/platform/win/paths_win.cc index ef87a967719b3..505d40ae2236d 100644 --- a/fml/platform/win/paths_win.cc +++ b/fml/platform/win/paths_win.cc @@ -6,7 +6,7 @@ #include -#include "lib/ftl/files/path.h" +#include "lib/fxl/files/path.h" namespace fml { namespace paths { diff --git a/fml/task_observer.h b/fml/task_observer.h index b22a9bc43a907..21697cf022005 100644 --- a/fml/task_observer.h +++ b/fml/task_observer.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FML_TASK_OBSERVER_H_ #define FLUTTER_FML_TASK_OBSERVER_H_ -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace fml { diff --git a/fml/task_runner.cc b/fml/task_runner.cc index bc85571845db5..3d13674d78c11 100644 --- a/fml/task_runner.cc +++ b/fml/task_runner.cc @@ -11,24 +11,24 @@ namespace fml { -TaskRunner::TaskRunner(ftl::RefPtr loop) +TaskRunner::TaskRunner(fxl::RefPtr loop) : loop_(std::move(loop)) { - FTL_CHECK(loop_); + FXL_CHECK(loop_); } TaskRunner::~TaskRunner() = default; -void TaskRunner::PostTask(ftl::Closure task) { - loop_->PostTask(std::move(task), ftl::TimePoint::Now()); +void TaskRunner::PostTask(fxl::Closure task) { + loop_->PostTask(std::move(task), fxl::TimePoint::Now()); } -void TaskRunner::PostTaskForTime(ftl::Closure task, - ftl::TimePoint target_time) { +void TaskRunner::PostTaskForTime(fxl::Closure task, + fxl::TimePoint target_time) { loop_->PostTask(std::move(task), target_time); } -void TaskRunner::PostDelayedTask(ftl::Closure task, ftl::TimeDelta delay) { - loop_->PostTask(std::move(task), ftl::TimePoint::Now() + delay); +void TaskRunner::PostDelayedTask(fxl::Closure task, fxl::TimeDelta delay) { + loop_->PostTask(std::move(task), fxl::TimePoint::Now() + delay); } bool TaskRunner::RunsTasksOnCurrentThread() { diff --git a/fml/task_runner.h b/fml/task_runner.h index d70c02b022f8a..20ea85e4e521b 100644 --- a/fml/task_runner.h +++ b/fml/task_runner.h @@ -5,34 +5,34 @@ #ifndef FLUTTER_FML_TASK_RUNNER_H_ #define FLUTTER_FML_TASK_RUNNER_H_ -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/ref_counted.h" -#include "lib/ftl/tasks/task_runner.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/tasks/task_runner.h" namespace fml { class MessageLoopImpl; -class TaskRunner : public ftl::TaskRunner { +class TaskRunner : public fxl::TaskRunner { public: - void PostTask(ftl::Closure task) override; + void PostTask(fxl::Closure task) override; - void PostTaskForTime(ftl::Closure task, ftl::TimePoint target_time) override; + void PostTaskForTime(fxl::Closure task, fxl::TimePoint target_time) override; - void PostDelayedTask(ftl::Closure task, ftl::TimeDelta delay) override; + void PostDelayedTask(fxl::Closure task, fxl::TimeDelta delay) override; bool RunsTasksOnCurrentThread() override; private: - ftl::RefPtr loop_; + fxl::RefPtr loop_; - TaskRunner(ftl::RefPtr loop); + TaskRunner(fxl::RefPtr loop); ~TaskRunner(); FRIEND_MAKE_REF_COUNTED(TaskRunner); FRIEND_REF_COUNTED_THREAD_SAFE(TaskRunner); - FTL_DISALLOW_COPY_AND_ASSIGN(TaskRunner); + FXL_DISALLOW_COPY_AND_ASSIGN(TaskRunner); }; } // namespace fml diff --git a/fml/thread.cc b/fml/thread.cc index 03147d6fb2130..7043556675383 100644 --- a/fml/thread.cc +++ b/fml/thread.cc @@ -4,7 +4,7 @@ #include "flutter/fml/thread.h" -#include "lib/ftl/build_config.h" +#include "lib/fxl/build_config.h" #if defined(OS_WIN) #include @@ -16,13 +16,13 @@ #include #include "flutter/fml/message_loop.h" -#include "lib/ftl/synchronization/waitable_event.h" +#include "lib/fxl/synchronization/waitable_event.h" namespace fml { Thread::Thread(const std::string& name) : joined_(false) { - ftl::AutoResetWaitableEvent latch; - ftl::RefPtr runner; + fxl::AutoResetWaitableEvent latch; + fxl::RefPtr runner; thread_ = std::make_unique([&latch, &runner, name]() -> void { SetCurrentThreadName(name); fml::MessageLoop::EnsureInitializedForCurrentThread(); @@ -39,7 +39,7 @@ Thread::~Thread() { Join(); } -ftl::RefPtr Thread::GetTaskRunner() const { +fxl::RefPtr Thread::GetTaskRunner() const { return task_runner_; } diff --git a/fml/thread.h b/fml/thread.h index 83b0fca704554..44062f1032116 100644 --- a/fml/thread.h +++ b/fml/thread.h @@ -9,8 +9,8 @@ #include #include -#include "lib/ftl/macros.h" -#include "lib/ftl/tasks/task_runner.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/tasks/task_runner.h" namespace fml { @@ -20,18 +20,18 @@ class Thread { ~Thread(); - ftl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; void Join(); private: std::unique_ptr thread_; - ftl::RefPtr task_runner_; + fxl::RefPtr task_runner_; std::atomic_bool joined_; static void SetCurrentThreadName(const std::string& name); - FTL_DISALLOW_COPY_AND_ASSIGN(Thread); + FXL_DISALLOW_COPY_AND_ASSIGN(Thread); }; } // namespace fml diff --git a/fml/thread_local.h b/fml/thread_local.h index 1792b6bc03c37..c3c7295ef3e20 100644 --- a/fml/thread_local.h +++ b/fml/thread_local.h @@ -7,9 +7,9 @@ #include -#include "lib/ftl/build_config.h" -#include "lib/ftl/logging.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/macros.h" #define FML_THREAD_LOCAL_PTHREADS OS_MACOSX || OS_LINUX || OS_ANDROID @@ -55,11 +55,11 @@ class ThreadLocal { ThreadLocalDestroyCallback destroy_; intptr_t value_; - FTL_DISALLOW_COPY_AND_ASSIGN(Box); + FXL_DISALLOW_COPY_AND_ASSIGN(Box); }; static inline void ThreadLocalDestroy(void* value) { - FTL_CHECK(value != nullptr); + FXL_CHECK(value != nullptr); auto box = reinterpret_cast(value); box->DestroyValue(); delete box; @@ -71,14 +71,14 @@ class ThreadLocal { ThreadLocal(ThreadLocalDestroyCallback destroy) : destroy_(destroy) { auto callback = reinterpret_cast(&ThreadLocal::ThreadLocalDestroy); - FTL_CHECK(pthread_key_create(&_key, callback) == 0); + FXL_CHECK(pthread_key_create(&_key, callback) == 0); } void Set(intptr_t value) { auto box = reinterpret_cast(pthread_getspecific(_key)); if (box == nullptr) { box = new Box(destroy_, value); - FTL_CHECK(pthread_setspecific(_key, box) == 0); + FXL_CHECK(pthread_setspecific(_key, box) == 0); } else { box->SetValue(value); } @@ -99,14 +99,14 @@ class ThreadLocal { delete reinterpret_cast(pthread_getspecific(_key)); // Finally, collect the key - FTL_CHECK(pthread_key_delete(_key) == 0); + FXL_CHECK(pthread_key_delete(_key) == 0); } private: pthread_key_t _key; ThreadLocalDestroyCallback destroy_; - FTL_DISALLOW_COPY_AND_ASSIGN(ThreadLocal); + FXL_DISALLOW_COPY_AND_ASSIGN(ThreadLocal); }; #else // FML_THREAD_LOCAL_PTHREADS @@ -144,7 +144,7 @@ class ThreadLocal { ThreadLocalDestroyCallback destroy_; intptr_t value_; - FTL_DISALLOW_COPY_AND_ASSIGN(ThreadLocal); + FXL_DISALLOW_COPY_AND_ASSIGN(ThreadLocal); }; #endif // FML_THREAD_LOCAL_PTHREADS diff --git a/fml/trace_event.h b/fml/trace_event.h index 5006e5833411b..a8a56c02a82d5 100644 --- a/fml/trace_event.h +++ b/fml/trace_event.h @@ -9,7 +9,7 @@ #include #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #ifndef TRACE_EVENT_HIDE_MACROS @@ -115,7 +115,7 @@ class ScopedInstantEnd { private: const std::string label_; - FTL_DISALLOW_COPY_AND_ASSIGN(ScopedInstantEnd); + FXL_DISALLOW_COPY_AND_ASSIGN(ScopedInstantEnd); }; } // namespace tracing diff --git a/lib/io/dart_io.h b/lib/io/dart_io.h index a645ff68f0798..c239b0a1ea7b7 100644 --- a/lib/io/dart_io.h +++ b/lib/io/dart_io.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_LIB_IO_DART_IO_H_ #define FLUTTER_LIB_IO_DART_IO_H_ -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace blink { @@ -14,7 +14,7 @@ class DartIO { static void InitForIsolate(); private: - FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartIO); + FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartIO); }; } // namespace blink diff --git a/lib/ui/compositing/scene.cc b/lib/ui/compositing/scene.cc index da48bcb475eb6..52d26a897cada 100644 --- a/lib/ui/compositing/scene.cc +++ b/lib/ui/compositing/scene.cc @@ -19,11 +19,11 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Scene); DART_BIND_ALL(Scene, FOR_EACH_BINDING) -ftl::RefPtr Scene::create(std::unique_ptr rootLayer, +fxl::RefPtr Scene::create(std::unique_ptr rootLayer, uint32_t rasterizerTracingThreshold, bool checkerboardRasterCacheImages, bool checkerboardOffscreenLayers) { - return ftl::MakeRefCounted(std::move(rootLayer), + return fxl::MakeRefCounted(std::move(rootLayer), rasterizerTracingThreshold, checkerboardRasterCacheImages, checkerboardOffscreenLayers); diff --git a/lib/ui/compositing/scene.h b/lib/ui/compositing/scene.h index 7acf87fe11e2f..926fd9d83babd 100644 --- a/lib/ui/compositing/scene.h +++ b/lib/ui/compositing/scene.h @@ -18,14 +18,14 @@ class DartLibraryNatives; namespace blink { -class Scene : public ftl::RefCountedThreadSafe, +class Scene : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Scene); public: ~Scene() override; - static ftl::RefPtr create(std::unique_ptr rootLayer, + static fxl::RefPtr create(std::unique_ptr rootLayer, uint32_t rasterizerTracingThreshold, bool checkerboardRasterCacheImages, bool checkerboardOffscreenLayers); diff --git a/lib/ui/compositing/scene_builder.cc b/lib/ui/compositing/scene_builder.cc index 00ba21a0852a6..cf9087d0e4997 100644 --- a/lib/ui/compositing/scene_builder.cc +++ b/lib/ui/compositing/scene_builder.cc @@ -20,7 +20,7 @@ #include "flutter/lib/ui/painting/matrix.h" #include "flutter/lib/ui/painting/shader.h" #include "flutter/lib/ui/window/window.h" -#include "lib/ftl/build_config.h" +#include "lib/fxl/build_config.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -178,12 +178,12 @@ void SceneBuilder::pushPhysicalModel(const RRect& rrect, void SceneBuilder::addLayer(std::unique_ptr layer, const SkRect& cullRect) { - FTL_DCHECK(layer); + FXL_DCHECK(layer); m_cullRects.push(cullRect); if (!m_rootLayer) { - FTL_DCHECK(!m_currentLayer); + FXL_DCHECK(!m_currentLayer); m_rootLayer = std::move(layer); m_currentLayer = m_rootLayer.get(); return; @@ -270,11 +270,11 @@ void SceneBuilder::setCheckerboardOffscreenLayers(bool checkerboard) { m_checkerboardOffscreenLayers = checkerboard; } -ftl::RefPtr SceneBuilder::build() { +fxl::RefPtr SceneBuilder::build() { m_currentLayer = nullptr; int32_t threshold = m_currentRasterizerTracingThreshold; m_currentRasterizerTracingThreshold = 0; - ftl::RefPtr scene = Scene::create(std::move(m_rootLayer), threshold, + fxl::RefPtr scene = Scene::create(std::move(m_rootLayer), threshold, m_checkerboardRasterCacheImages, m_checkerboardOffscreenLayers); ClearDartWrapper(); diff --git a/lib/ui/compositing/scene_builder.h b/lib/ui/compositing/scene_builder.h index 43008d41f368c..e2519f79fab7b 100644 --- a/lib/ui/compositing/scene_builder.h +++ b/lib/ui/compositing/scene_builder.h @@ -22,14 +22,14 @@ namespace blink { -class SceneBuilder : public ftl::RefCountedThreadSafe, +class SceneBuilder : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(SceneBuilder); public: - static ftl::RefPtr create() { - return ftl::MakeRefCounted(); + static fxl::RefPtr create() { + return fxl::MakeRefCounted(); } ~SceneBuilder() override; @@ -69,7 +69,7 @@ class SceneBuilder : public ftl::RefCountedThreadSafe, void setCheckerboardRasterCacheImages(bool checkerboard); void setCheckerboardOffscreenLayers(bool checkerboard); - ftl::RefPtr build(); + fxl::RefPtr build(); static void RegisterNatives(tonic::DartLibraryNatives* natives); diff --git a/lib/ui/compositing/scene_host.cc b/lib/ui/compositing/scene_host.cc index 159d564d81ea2..c0e4c5332580a 100644 --- a/lib/ui/compositing/scene_host.cc +++ b/lib/ui/compositing/scene_host.cc @@ -31,18 +31,18 @@ void SceneHost::RegisterNatives(tonic::DartLibraryNatives* natives) { } #if defined(OS_FUCHSIA) -ftl::RefPtr SceneHost::create( - ftl::RefPtr export_token_handle) { - return ftl::MakeRefCounted(export_token_handle); +fxl::RefPtr SceneHost::create( + fxl::RefPtr export_token_handle) { + return fxl::MakeRefCounted(export_token_handle); } -SceneHost::SceneHost(ftl::RefPtr export_token_handle) { +SceneHost::SceneHost(fxl::RefPtr export_token_handle) { export_node_holder_ = - ftl::MakeRefCounted(export_token_handle); + fxl::MakeRefCounted(export_token_handle); } #else -ftl::RefPtr SceneHost::create(Dart_Handle export_token_handle) { - return ftl::MakeRefCounted(export_token_handle); +fxl::RefPtr SceneHost::create(Dart_Handle export_token_handle) { + return fxl::MakeRefCounted(export_token_handle); } SceneHost::SceneHost(Dart_Handle export_token_handle) {} diff --git a/lib/ui/compositing/scene_host.h b/lib/ui/compositing/scene_host.h index 4414625939b75..0d142b6199c70 100644 --- a/lib/ui/compositing/scene_host.h +++ b/lib/ui/compositing/scene_host.h @@ -19,23 +19,23 @@ class DartLibraryNatives; namespace blink { -class SceneHost : public ftl::RefCountedThreadSafe, +class SceneHost : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(SceneHost); public: #if defined(OS_FUCHSIA) - static ftl::RefPtr create( - ftl::RefPtr export_token_handle); + static fxl::RefPtr create( + fxl::RefPtr export_token_handle); #else - static ftl::RefPtr create(Dart_Handle export_token_handle); + static fxl::RefPtr create(Dart_Handle export_token_handle); #endif ~SceneHost() override; #if defined(OS_FUCHSIA) - const ftl::RefPtr& export_node_holder() const { + const fxl::RefPtr& export_node_holder() const { return export_node_holder_; } #endif @@ -46,11 +46,11 @@ class SceneHost : public ftl::RefCountedThreadSafe, private: #if defined(OS_FUCHSIA) - ftl::RefPtr export_node_holder_; + fxl::RefPtr export_node_holder_; #endif #if defined(OS_FUCHSIA) - explicit SceneHost(ftl::RefPtr export_token_handle); + explicit SceneHost(fxl::RefPtr export_token_handle); #else explicit SceneHost(Dart_Handle export_token_handle); #endif diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index 3236f97c10326..d0b3742e2335c 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -12,8 +12,8 @@ #include "dart/runtime/include/dart_api.h" #include "dart/runtime/include/dart_tools_api.h" #include "flutter/common/settings.h" -#include "lib/ftl/build_config.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/logging.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_library_natives.h" #include "lib/tonic/dart_microtask_queue.h" @@ -100,7 +100,7 @@ static void InitDartAsync(Dart_Handle builtin_library, schedule_microtask = GetClosure(builtin_library, "_getScheduleMicrotaskClosure"); } else { - FTL_CHECK(isolate_type == DartRuntimeHooks::SecondaryIsolate); + FXL_CHECK(isolate_type == DartRuntimeHooks::SecondaryIsolate); Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate")); Dart_Handle method_name = Dart_NewStringFromCString("_getIsolateScheduleImmediateClosure"); diff --git a/lib/ui/dart_runtime_hooks.h b/lib/ui/dart_runtime_hooks.h index e9522a8bdf338..2f88ef901a409 100644 --- a/lib/ui/dart_runtime_hooks.h +++ b/lib/ui/dart_runtime_hooks.h @@ -7,7 +7,7 @@ #include "dart/runtime/include/dart_api.h" #include "lib/tonic/dart_library_natives.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace blink { @@ -22,7 +22,7 @@ class DartRuntimeHooks { static void RegisterNatives(tonic::DartLibraryNatives* natives); private: - FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartRuntimeHooks); + FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartRuntimeHooks); }; } // namespace blink diff --git a/lib/ui/dart_ui.cc b/lib/ui/dart_ui.cc index ae7e8a1ee317d..b3c8425995439 100644 --- a/lib/ui/dart_ui.cc +++ b/lib/ui/dart_ui.cc @@ -23,7 +23,7 @@ #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_builder.h" #include "flutter/lib/ui/window/window.h" -#include "lib/ftl/build_config.h" +#include "lib/fxl/build_config.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/logging/dart_error.h" @@ -73,7 +73,7 @@ void DartUI::InitForGlobal() { } void DartUI::InitForIsolate() { - FTL_DCHECK(g_natives); + FXL_DCHECK(g_natives); DART_CHECK_VALID(Dart_SetNativeResolver(Dart_LookupLibrary(ToDart("dart:ui")), GetNativeFunction, GetSymbol)); } diff --git a/lib/ui/dart_ui.h b/lib/ui/dart_ui.h index 6460444960c07..2846ec8c84a17 100644 --- a/lib/ui/dart_ui.h +++ b/lib/ui/dart_ui.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_LIB_UI_DART_UI_H_ #define FLUTTER_LIB_UI_DART_UI_H_ -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace blink { @@ -15,7 +15,7 @@ class DartUI { static void InitForIsolate(); private: - FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartUI); + FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartUI); }; } // namespace blink diff --git a/lib/ui/painting/canvas.cc b/lib/ui/painting/canvas.cc index 84b5cfd1924d4..8dec3a7cf69c1 100644 --- a/lib/ui/painting/canvas.cc +++ b/lib/ui/painting/canvas.cc @@ -69,15 +69,15 @@ void Canvas::RegisterNatives(tonic::DartLibraryNatives* natives) { FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -ftl::RefPtr Canvas::Create(PictureRecorder* recorder, +fxl::RefPtr Canvas::Create(PictureRecorder* recorder, double left, double top, double right, double bottom) { if (!recorder) Dart_ThrowException(ToDart("Canvas constructor called with non-genuine PictureRecorder.")); - FTL_DCHECK(!recorder->isRecording()); // verified by Dart code - ftl::RefPtr canvas = ftl::MakeRefCounted( + FXL_DCHECK(!recorder->isRecording()); // verified by Dart code + fxl::RefPtr canvas = fxl::MakeRefCounted( recorder->BeginRecording(SkRect::MakeLTRB(left, top, right, bottom))); recorder->set_canvas(canvas); return canvas; diff --git a/lib/ui/painting/canvas.h b/lib/ui/painting/canvas.h index f10e3ac283de1..1d171467fb1aa 100644 --- a/lib/ui/painting/canvas.h +++ b/lib/ui/painting/canvas.h @@ -25,13 +25,13 @@ class DartLibraryNatives; namespace blink { class CanvasImage; -class Canvas : public ftl::RefCountedThreadSafe, +class Canvas : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Canvas); public: - static ftl::RefPtr Create(PictureRecorder* recorder, + static fxl::RefPtr Create(PictureRecorder* recorder, double left, double top, double right, diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index 06a75a4d5a358..e0d19584ea56d 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -31,16 +31,16 @@ void CanvasGradient::RegisterNatives(tonic::DartLibraryNatives* natives) { FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -ftl::RefPtr CanvasGradient::Create() { - return ftl::MakeRefCounted(); +fxl::RefPtr CanvasGradient::Create() { + return fxl::MakeRefCounted(); } void CanvasGradient::initLinear(const tonic::Float32List& end_points, const tonic::Int32List& colors, const tonic::Float32List& color_stops, SkShader::TileMode tile_mode) { - FTL_DCHECK(end_points.num_elements() == 4); - FTL_DCHECK(colors.num_elements() == color_stops.num_elements() || + FXL_DCHECK(end_points.num_elements() == 4); + FXL_DCHECK(colors.num_elements() == color_stops.num_elements() || color_stops.data() == nullptr); static_assert(sizeof(SkPoint) == sizeof(float) * 2, @@ -60,7 +60,7 @@ void CanvasGradient::initRadial(double center_x, const tonic::Int32List& colors, const tonic::Float32List& color_stops, SkShader::TileMode tile_mode) { - FTL_DCHECK(colors.num_elements() == color_stops.num_elements() || + FXL_DCHECK(colors.num_elements() == color_stops.num_elements() || color_stops.data() == nullptr); static_assert(sizeof(SkColor) == sizeof(int32_t), diff --git a/lib/ui/painting/gradient.h b/lib/ui/painting/gradient.h index 84f9c6715e0d1..063b10673d780 100644 --- a/lib/ui/painting/gradient.h +++ b/lib/ui/painting/gradient.h @@ -25,7 +25,7 @@ class CanvasGradient : public Shader { public: ~CanvasGradient() override; - static ftl::RefPtr Create(); + static fxl::RefPtr Create(); void initLinear(const tonic::Float32List& end_points, const tonic::Int32List& colors, diff --git a/lib/ui/painting/image.h b/lib/ui/painting/image.h index ba416cc57b643..8ad11660721f0 100644 --- a/lib/ui/painting/image.h +++ b/lib/ui/painting/image.h @@ -14,15 +14,15 @@ class DartLibraryNatives; namespace blink { -class CanvasImage final : public ftl::RefCountedThreadSafe, +class CanvasImage final : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(CanvasImage); public: ~CanvasImage() override; - static ftl::RefPtr Create() { - return ftl::MakeRefCounted(); + static fxl::RefPtr Create() { + return fxl::MakeRefCounted(); } int width() { return image_->width(); } diff --git a/lib/ui/painting/image_decoding.cc b/lib/ui/painting/image_decoding.cc index 4f2d061603f2e..fdcff961b2cfd 100644 --- a/lib/ui/painting/image_decoding.cc +++ b/lib/ui/painting/image_decoding.cc @@ -8,8 +8,8 @@ #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/painting/image.h" #include "flutter/lib/ui/painting/resource_context.h" -#include "lib/ftl/build_config.h" -#include "lib/ftl/functional/make_copyable.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_persistent_value.h" #include "lib/tonic/dart_state.h" #include "lib/tonic/logging/dart_invoke.h" @@ -56,7 +56,7 @@ void InvokeImageCallback(sk_sp image, if (!image) { DartInvoke(callback->value(), {Dart_Null()}); } else { - ftl::RefPtr resultImage = CanvasImage::Create(); + fxl::RefPtr resultImage = CanvasImage::Create(); resultImage->set_image(std::move(image)); DartInvoke(callback->value(), {ToDart(resultImage)}); } @@ -68,7 +68,7 @@ void DecodeImageAndInvokeImageCallback( sk_sp buffer, size_t trace_id) { sk_sp image = DecodeImage(std::move(buffer), trace_id); - Threads::UI()->PostTask(ftl::MakeCopyable([ + Threads::UI()->PostTask(fxl::MakeCopyable([ callback = std::move(callback), image, trace_id ]() mutable { InvokeImageCallback(image, std::move(callback), trace_id); })); } @@ -97,7 +97,7 @@ void DecodeImageFromList(Dart_NativeArguments args) { auto buffer = SkData::MakeWithCopy(list.data(), list.num_elements()); - Threads::IO()->PostTask(ftl::MakeCopyable([ + Threads::IO()->PostTask(fxl::MakeCopyable([ callback = std::make_unique( tonic::DartState::Current(), callback_handle), buffer = std::move(buffer), trace_id diff --git a/lib/ui/painting/image_filter.cc b/lib/ui/painting/image_filter.cc index 04b44932c2bee..13bb0c9be39a9 100644 --- a/lib/ui/painting/image_filter.cc +++ b/lib/ui/painting/image_filter.cc @@ -33,8 +33,8 @@ void ImageFilter::RegisterNatives(tonic::DartLibraryNatives* natives) { FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -ftl::RefPtr ImageFilter::Create() { - return ftl::MakeRefCounted(); +fxl::RefPtr ImageFilter::Create() { + return fxl::MakeRefCounted(); } ImageFilter::ImageFilter() {} diff --git a/lib/ui/painting/image_filter.h b/lib/ui/painting/image_filter.h index 77973787f2cc1..9aec7074dd393 100644 --- a/lib/ui/painting/image_filter.h +++ b/lib/ui/painting/image_filter.h @@ -12,14 +12,14 @@ namespace blink { -class ImageFilter : public ftl::RefCountedThreadSafe, +class ImageFilter : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(ImageFilter); public: ~ImageFilter() override; - static ftl::RefPtr Create(); + static fxl::RefPtr Create(); void initImage(CanvasImage* image); void initPicture(Picture*); diff --git a/lib/ui/painting/image_shader.cc b/lib/ui/painting/image_shader.cc index 491a2a25e5ee7..504c1471f7a46 100644 --- a/lib/ui/painting/image_shader.cc +++ b/lib/ui/painting/image_shader.cc @@ -29,8 +29,8 @@ void ImageShader::RegisterNatives(tonic::DartLibraryNatives* natives) { FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -ftl::RefPtr ImageShader::Create() { - return ftl::MakeRefCounted(); +fxl::RefPtr ImageShader::Create() { + return fxl::MakeRefCounted(); } void ImageShader::initWithImage(CanvasImage* image, diff --git a/lib/ui/painting/image_shader.h b/lib/ui/painting/image_shader.h index 3a1602f841647..1bdb310a59c85 100644 --- a/lib/ui/painting/image_shader.h +++ b/lib/ui/painting/image_shader.h @@ -26,7 +26,7 @@ class ImageShader : public Shader { public: ~ImageShader() override; - static ftl::RefPtr Create(); + static fxl::RefPtr Create(); void initWithImage(CanvasImage* image, SkShader::TileMode tmx, diff --git a/lib/ui/painting/mask_filter.cc b/lib/ui/painting/mask_filter.cc index 0e6866ae44d64..13d43fb1844bb 100644 --- a/lib/ui/painting/mask_filter.cc +++ b/lib/ui/painting/mask_filter.cc @@ -26,8 +26,8 @@ void MaskFilter::RegisterNatives(tonic::DartLibraryNatives* natives) { }); } -ftl::RefPtr MaskFilter::Create(unsigned style, double sigma) { - return ftl::MakeRefCounted( +fxl::RefPtr MaskFilter::Create(unsigned style, double sigma) { + return fxl::MakeRefCounted( SkBlurMaskFilter::Make(static_cast(style), sigma)); } diff --git a/lib/ui/painting/mask_filter.h b/lib/ui/painting/mask_filter.h index 902be41c83db7..31cacf68ebe45 100644 --- a/lib/ui/painting/mask_filter.h +++ b/lib/ui/painting/mask_filter.h @@ -16,14 +16,14 @@ class DartLibraryNatives; namespace blink { -class MaskFilter : public ftl::RefCountedThreadSafe, +class MaskFilter : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(MaskFilter); public: ~MaskFilter() override; - static ftl::RefPtr Create(unsigned style, double sigma); + static fxl::RefPtr Create(unsigned style, double sigma); const sk_sp& filter() { return filter_; } diff --git a/lib/ui/painting/matrix.cc b/lib/ui/painting/matrix.cc index aeb76816fafd0..dbf2df5704998 100644 --- a/lib/ui/painting/matrix.cc +++ b/lib/ui/painting/matrix.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/painting/matrix.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace blink { @@ -18,7 +18,7 @@ static const int kSkMatrixIndexToMatrix4Index[] = { }; SkMatrix ToSkMatrix(const tonic::Float64List& matrix4) { - FTL_DCHECK(matrix4.data()); + FXL_DCHECK(matrix4.data()); SkMatrix sk_matrix; for (int i = 0; i < 9; ++i) { int matrix4_index = kSkMatrixIndexToMatrix4Index[i]; diff --git a/lib/ui/painting/paint.cc b/lib/ui/painting/paint.cc index cb754715d266f..430e6ffafc98b 100644 --- a/lib/ui/painting/paint.cc +++ b/lib/ui/painting/paint.cc @@ -6,7 +6,7 @@ #include "flutter/lib/ui/painting/mask_filter.h" #include "flutter/lib/ui/painting/shader.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "lib/tonic/typed_data/dart_byte_data.h" #include "third_party/skia/include/core/SkColorFilter.h" #include "third_party/skia/include/core/SkMaskFilter.h" @@ -50,20 +50,20 @@ Paint DartConverter::FromArguments(Dart_NativeArguments args, int index, Dart_Handle& exception) { Dart_Handle paint_objects = Dart_GetNativeArgument(args, index); - FTL_DCHECK(!LogIfError(paint_objects)); + FXL_DCHECK(!LogIfError(paint_objects)); Dart_Handle paint_data = Dart_GetNativeArgument(args, index + 1); - FTL_DCHECK(!LogIfError(paint_data)); + FXL_DCHECK(!LogIfError(paint_data)); Paint result; SkPaint& paint = result.paint_; if (!Dart_IsNull(paint_objects)) { - FTL_DCHECK(Dart_IsList(paint_objects)); + FXL_DCHECK(Dart_IsList(paint_objects)); intptr_t length = 0; Dart_ListLength(paint_objects, &length); - FTL_CHECK(length == kObjectCount); + FXL_CHECK(length == kObjectCount); Dart_Handle values[kObjectCount]; if (Dart_IsError(Dart_ListGetRange(paint_objects, 0, kObjectCount, values))) return result; @@ -82,7 +82,7 @@ Paint DartConverter::FromArguments(Dart_NativeArguments args, } tonic::DartByteData byte_data(paint_data); - FTL_CHECK(byte_data.length_in_bytes() == kDataByteCount); + FXL_CHECK(byte_data.length_in_bytes() == kDataByteCount); const uint32_t* uint_data = static_cast(byte_data.data()); const float* float_data = static_cast(byte_data.data()); diff --git a/lib/ui/painting/path.cc b/lib/ui/painting/path.cc index 9e10e4e0170b9..0353ebeb8d0cf 100644 --- a/lib/ui/painting/path.cc +++ b/lib/ui/painting/path.cc @@ -190,15 +190,15 @@ bool CanvasPath::contains(double x, double y) { return path_.contains(x, y); } -ftl::RefPtr CanvasPath::shift(double dx, double dy) { - ftl::RefPtr path = CanvasPath::Create(); +fxl::RefPtr CanvasPath::shift(double dx, double dy) { + fxl::RefPtr path = CanvasPath::Create(); path_.offset(dx, dy, &path->path_); return path; } -ftl::RefPtr CanvasPath::transform( +fxl::RefPtr CanvasPath::transform( tonic::Float64List& matrix4) { - ftl::RefPtr path = CanvasPath::Create(); + fxl::RefPtr path = CanvasPath::Create(); path_.transform(ToSkMatrix(matrix4), &path->path_); matrix4.Release(); return path; diff --git a/lib/ui/painting/path.h b/lib/ui/painting/path.h index daa8b0bd42ee6..40e959e6f5147 100644 --- a/lib/ui/painting/path.h +++ b/lib/ui/painting/path.h @@ -17,15 +17,15 @@ class DartLibraryNatives; namespace blink { -class CanvasPath : public ftl::RefCountedThreadSafe, +class CanvasPath : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(CanvasPath); public: ~CanvasPath() override; - static ftl::RefPtr Create() { - return ftl::MakeRefCounted(); + static fxl::RefPtr Create() { + return fxl::MakeRefCounted(); } int getFillType(); @@ -68,8 +68,8 @@ class CanvasPath : public ftl::RefCountedThreadSafe, void close(); void reset(); bool contains(double x, double y); - ftl::RefPtr shift(double dx, double dy); - ftl::RefPtr transform(tonic::Float64List& matrix4); + fxl::RefPtr shift(double dx, double dy); + fxl::RefPtr transform(tonic::Float64List& matrix4); const SkPath& path() const { return path_; } diff --git a/lib/ui/painting/picture.cc b/lib/ui/painting/picture.cc index 6a0809e697fe2..ace8387c2f919 100644 --- a/lib/ui/painting/picture.cc +++ b/lib/ui/painting/picture.cc @@ -23,8 +23,8 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Picture); DART_BIND_ALL(Picture, FOR_EACH_BINDING) -ftl::RefPtr Picture::Create(sk_sp picture) { - return ftl::MakeRefCounted(std::move(picture)); +fxl::RefPtr Picture::Create(sk_sp picture) { + return fxl::MakeRefCounted(std::move(picture)); } Picture::Picture(sk_sp picture) : picture_(std::move(picture)) {} @@ -35,8 +35,8 @@ Picture::~Picture() { SkiaUnrefOnIOThread(&picture_); } -ftl::RefPtr Picture::toImage(int width, int height) { - ftl::RefPtr image = CanvasImage::Create(); +fxl::RefPtr Picture::toImage(int width, int height) { + fxl::RefPtr image = CanvasImage::Create(); // TODO(abarth): We should pass in an SkColorSpace at some point. image->set_image( SkImage::MakeFromPicture(picture_, SkISize::Make(width, height), nullptr, diff --git a/lib/ui/painting/picture.h b/lib/ui/painting/picture.h index a11762a84ff6a..4a26d01c08374 100644 --- a/lib/ui/painting/picture.h +++ b/lib/ui/painting/picture.h @@ -16,18 +16,18 @@ class DartLibraryNatives; namespace blink { class Canvas; -class Picture : public ftl::RefCountedThreadSafe, +class Picture : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Picture); public: ~Picture() override; - static ftl::RefPtr Create(sk_sp picture); + static fxl::RefPtr Create(sk_sp picture); const sk_sp& picture() const { return picture_; } - ftl::RefPtr toImage(int width, int height); + fxl::RefPtr toImage(int width, int height); void dispose(); diff --git a/lib/ui/painting/picture_recorder.cc b/lib/ui/painting/picture_recorder.cc index 8938d4cf34a5a..f3365e283cb66 100644 --- a/lib/ui/painting/picture_recorder.cc +++ b/lib/ui/painting/picture_recorder.cc @@ -31,8 +31,8 @@ void PictureRecorder::RegisterNatives(tonic::DartLibraryNatives* natives) { FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -ftl::RefPtr PictureRecorder::Create() { - return ftl::MakeRefCounted(); +fxl::RefPtr PictureRecorder::Create() { + return fxl::MakeRefCounted(); } PictureRecorder::PictureRecorder() {} @@ -47,10 +47,10 @@ SkCanvas* PictureRecorder::BeginRecording(SkRect bounds) { return picture_recorder_.beginRecording(bounds, &rtree_factory_); } -ftl::RefPtr PictureRecorder::endRecording() { +fxl::RefPtr PictureRecorder::endRecording() { if (!isRecording()) return nullptr; - ftl::RefPtr picture = + fxl::RefPtr picture = Picture::Create(picture_recorder_.finishRecordingAsPicture()); canvas_->Clear(); canvas_->ClearDartWrapper(); diff --git a/lib/ui/painting/picture_recorder.h b/lib/ui/painting/picture_recorder.h index 155dfc65ed008..61e83bd834516 100644 --- a/lib/ui/painting/picture_recorder.h +++ b/lib/ui/painting/picture_recorder.h @@ -16,21 +16,21 @@ namespace blink { class Canvas; class Picture; -class PictureRecorder : public ftl::RefCountedThreadSafe, +class PictureRecorder : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(PictureRecorder); public: - static ftl::RefPtr Create(); + static fxl::RefPtr Create(); ~PictureRecorder(); SkCanvas* BeginRecording(SkRect bounds); - ftl::RefPtr endRecording(); + fxl::RefPtr endRecording(); bool isRecording(); - void set_canvas(ftl::RefPtr canvas) { canvas_ = std::move(canvas); } + void set_canvas(fxl::RefPtr canvas) { canvas_ = std::move(canvas); } static void RegisterNatives(tonic::DartLibraryNatives* natives); @@ -39,7 +39,7 @@ class PictureRecorder : public ftl::RefCountedThreadSafe, SkRTreeFactory rtree_factory_; SkPictureRecorder picture_recorder_; - ftl::RefPtr canvas_; + fxl::RefPtr canvas_; }; } // namespace blink diff --git a/lib/ui/painting/resource_context.cc b/lib/ui/painting/resource_context.cc index 8e565faf1d526..fecbf356b91c1 100644 --- a/lib/ui/painting/resource_context.cc +++ b/lib/ui/painting/resource_context.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/painting/resource_context.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace blink { namespace { @@ -14,7 +14,7 @@ static GrContext* g_context = nullptr; } // namespace void ResourceContext::Set(GrContext* context) { - FTL_DCHECK(!g_context); + FXL_DCHECK(!g_context); g_context = context; } diff --git a/lib/ui/painting/rrect.cc b/lib/ui/painting/rrect.cc index c310a61220709..cfc1d0daaef38 100644 --- a/lib/ui/painting/rrect.cc +++ b/lib/ui/painting/rrect.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/painting/rrect.h" #include "lib/tonic/logging/dart_error.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "lib/tonic/typed_data/float32_list.h" using namespace blink; @@ -39,7 +39,7 @@ RRect DartConverter::FromArguments(Dart_NativeArguments args, int index, Dart_Handle& exception) { Dart_Handle value = Dart_GetNativeArgument(args, index); - FTL_DCHECK(!LogIfError(value)); + FXL_DCHECK(!LogIfError(value)); return FromDart(value); } diff --git a/lib/ui/painting/shader.h b/lib/ui/painting/shader.h index 6bee161741696..9c0f3c601db56 100644 --- a/lib/ui/painting/shader.h +++ b/lib/ui/painting/shader.h @@ -10,7 +10,7 @@ namespace blink { -class Shader : public ftl::RefCountedThreadSafe, +class Shader : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Shader); diff --git a/lib/ui/painting/utils.cc b/lib/ui/painting/utils.cc index c6ee205fdd2e8..3666d0b98861b 100644 --- a/lib/ui/painting/utils.cc +++ b/lib/ui/painting/utils.cc @@ -9,7 +9,7 @@ namespace blink { namespace { -constexpr ftl::TimeDelta kDrainDelay = ftl::TimeDelta::FromMilliseconds(250); +constexpr fxl::TimeDelta kDrainDelay = fxl::TimeDelta::FromMilliseconds(250); } // anonymous namespace @@ -23,7 +23,7 @@ SkiaUnrefQueue& SkiaUnrefQueue::Get() { } void SkiaUnrefQueue::Unref(SkRefCnt* object) { - ftl::MutexLocker lock(&mutex_); + fxl::MutexLocker lock(&mutex_); objects_.push_back(object); if (!drain_pending_) { drain_pending_ = true; @@ -35,7 +35,7 @@ void SkiaUnrefQueue::Unref(SkRefCnt* object) { void SkiaUnrefQueue::Drain() { std::deque skia_objects; { - ftl::MutexLocker lock(&mutex_); + fxl::MutexLocker lock(&mutex_); objects_.swap(skia_objects); drain_pending_ = false; } diff --git a/lib/ui/painting/utils.h b/lib/ui/painting/utils.h index eedd9f929f967..0aab9b7e4c70e 100644 --- a/lib/ui/painting/utils.h +++ b/lib/ui/painting/utils.h @@ -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/ftl/synchronization/mutex.h" +#include "lib/fxl/synchronization/mutex.h" #include "third_party/skia/include/core/SkRefCnt.h" #include @@ -22,9 +22,9 @@ class SkiaUnrefQueue { static SkiaUnrefQueue instance_; - ftl::Mutex mutex_; - std::deque objects_ FTL_GUARDED_BY(mutex_); - bool drain_pending_ FTL_GUARDED_BY(mutex_); + fxl::Mutex mutex_; + std::deque objects_ FXL_GUARDED_BY(mutex_); + bool drain_pending_ FXL_GUARDED_BY(mutex_); }; template void SkiaUnrefOnIOThread(sk_sp* sp) { diff --git a/lib/ui/painting/vertices.cc b/lib/ui/painting/vertices.cc index 6426c174e3fdf..65ba1372684b3 100644 --- a/lib/ui/painting/vertices.cc +++ b/lib/ui/painting/vertices.cc @@ -45,8 +45,8 @@ void Vertices::RegisterNatives(tonic::DartLibraryNatives* natives) { FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -ftl::RefPtr Vertices::Create() { - return ftl::MakeRefCounted(); +fxl::RefPtr Vertices::Create() { + return fxl::MakeRefCounted(); } void Vertices::init(SkVertices::VertexMode vertex_mode, diff --git a/lib/ui/painting/vertices.h b/lib/ui/painting/vertices.h index 20874a6648efe..f3deda7ef742e 100644 --- a/lib/ui/painting/vertices.h +++ b/lib/ui/painting/vertices.h @@ -16,7 +16,7 @@ class DartLibraryNatives; namespace blink { -class Vertices : public ftl::RefCountedThreadSafe, +class Vertices : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Vertices); @@ -26,7 +26,7 @@ class Vertices : public ftl::RefCountedThreadSafe, static void RegisterNatives(tonic::DartLibraryNatives* natives); - static ftl::RefPtr Create(); + static fxl::RefPtr Create(); void init( SkVertices::VertexMode vertex_mode, diff --git a/lib/ui/semantics/semantics_update.cc b/lib/ui/semantics/semantics_update.cc index 2df3bfb57da57..e091433958659 100644 --- a/lib/ui/semantics/semantics_update.cc +++ b/lib/ui/semantics/semantics_update.cc @@ -20,9 +20,9 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, SemanticsUpdate); DART_BIND_ALL(SemanticsUpdate, FOR_EACH_BINDING) -ftl::RefPtr SemanticsUpdate::create( +fxl::RefPtr SemanticsUpdate::create( std::vector nodes) { - return ftl::MakeRefCounted(std::move(nodes)); + return fxl::MakeRefCounted(std::move(nodes)); } SemanticsUpdate::SemanticsUpdate(std::vector nodes) diff --git a/lib/ui/semantics/semantics_update.h b/lib/ui/semantics/semantics_update.h index 1c100f8aba61a..166e02e32e056 100644 --- a/lib/ui/semantics/semantics_update.h +++ b/lib/ui/semantics/semantics_update.h @@ -16,14 +16,14 @@ class DartLibraryNatives; namespace blink { -class SemanticsUpdate : public ftl::RefCountedThreadSafe, +class SemanticsUpdate : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(SemanticsUpdate); public: ~SemanticsUpdate() override; - static ftl::RefPtr create(std::vector nodes); + static fxl::RefPtr create(std::vector nodes); std::vector takeNodes(); diff --git a/lib/ui/semantics/semantics_update_builder.cc b/lib/ui/semantics/semantics_update_builder.cc index 4f06191920177..265a91c805541 100644 --- a/lib/ui/semantics/semantics_update_builder.cc +++ b/lib/ui/semantics/semantics_update_builder.cc @@ -58,7 +58,7 @@ void SemanticsUpdateBuilder::updateNode(int id, nodes_.push_back(node); } -ftl::RefPtr SemanticsUpdateBuilder::build() { +fxl::RefPtr SemanticsUpdateBuilder::build() { return SemanticsUpdate::create(std::move(nodes_)); } diff --git a/lib/ui/semantics/semantics_update_builder.h b/lib/ui/semantics/semantics_update_builder.h index 542955df057c6..c63e045de5a51 100644 --- a/lib/ui/semantics/semantics_update_builder.h +++ b/lib/ui/semantics/semantics_update_builder.h @@ -13,14 +13,14 @@ namespace blink { class SemanticsUpdateBuilder - : public ftl::RefCountedThreadSafe, + : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(SemanticsUpdateBuilder); public: - static ftl::RefPtr create() { - return ftl::MakeRefCounted(); + static fxl::RefPtr create() { + return fxl::MakeRefCounted(); } ~SemanticsUpdateBuilder() override; @@ -37,7 +37,7 @@ class SemanticsUpdateBuilder const tonic::Float64List& transform, const tonic::Int32List& children); - ftl::RefPtr build(); + fxl::RefPtr build(); static void RegisterNatives(tonic::DartLibraryNatives* natives); diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index def903dc0f175..c12284d7d9eb3 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -31,14 +31,14 @@ std::shared_ptr FontCollection::GetFontCollection() const { } void FontCollection::RegisterFontsFromAssetStore( - ftl::RefPtr asset_store) { + fxl::RefPtr asset_store) { if (!asset_store) { return; } std::vector manifest_data; if (!asset_store->GetAsBuffer("FontManifest.json", &manifest_data)) { - FTL_DLOG(WARNING) << "Could not find the font manifest in the asset store."; + FXL_DLOG(WARNING) << "Could not find the font manifest in the asset store."; return; } @@ -51,7 +51,7 @@ void FontCollection::RegisterFontsFromAssetStore( manifest_data.size()); if (document.HasParseError()) { - FTL_DLOG(WARNING) << "Error parsing the font manifest in the asset store."; + FXL_DLOG(WARNING) << "Error parsing the font manifest in the asset store."; return; } diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index d79a5ae2f72ca..4de8a93169ad4 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -8,8 +8,8 @@ #include #include #include "flutter/assets/zip_asset_store.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/ref_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_ptr.h" #include "txt/asset_data_provider.h" #include "txt/font_collection.h" @@ -22,7 +22,7 @@ class FontCollection { std::shared_ptr GetFontCollection() const; void RegisterFontsFromAssetStore( - ftl::RefPtr asset_store); + fxl::RefPtr asset_store); private: std::shared_ptr collection_; @@ -31,7 +31,7 @@ class FontCollection { ~FontCollection(); - FTL_DISALLOW_COPY_AND_ASSIGN(FontCollection); + FXL_DISALLOW_COPY_AND_ASSIGN(FontCollection); }; } // namespace blink diff --git a/lib/ui/text/paragraph.cc b/lib/ui/text/paragraph.cc index 19ad075ed35c3..858ccd01d4ef6 100644 --- a/lib/ui/text/paragraph.cc +++ b/lib/ui/text/paragraph.cc @@ -14,8 +14,8 @@ #include "flutter/sky/engine/platform/graphics/GraphicsContext.h" #include "flutter/sky/engine/platform/text/TextBoundaries.h" #include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "lib/ftl/logging.h" -#include "lib/ftl/tasks/task_runner.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/tasks/task_runner.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" diff --git a/lib/ui/text/paragraph.h b/lib/ui/text/paragraph.h index f11db49194291..1b2019373553a 100644 --- a/lib/ui/text/paragraph.h +++ b/lib/ui/text/paragraph.h @@ -21,19 +21,19 @@ class DartLibraryNatives; namespace blink { -class Paragraph : public ftl::RefCountedThreadSafe, +class Paragraph : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Paragraph); public: - static ftl::RefPtr Create(PassOwnPtr renderView) { - return ftl::MakeRefCounted(renderView); + static fxl::RefPtr Create(PassOwnPtr renderView) { + return fxl::MakeRefCounted(renderView); } - static ftl::RefPtr Create( + static fxl::RefPtr Create( std::unique_ptr paragraph) { - return ftl::MakeRefCounted(std::move(paragraph)); + return fxl::MakeRefCounted(std::move(paragraph)); } ~Paragraph() override; diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index ccf6b3b135a0b..ec50efb0776f5 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -19,7 +19,7 @@ #include "flutter/third_party/txt/src/txt/text_align.h" #include "flutter/third_party/txt/src/txt/text_decoration.h" #include "flutter/third_party/txt/src/txt/text_style.h" -#include "lib/ftl/tasks/task_runner.h" +#include "lib/fxl/tasks/task_runner.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -111,7 +111,7 @@ PassRefPtr decodeParagraphStyle(RenderStyle* parentStyle, double fontSize, double lineHeight, const std::u16string& ellipsis) { - FTL_DCHECK(encoded.num_elements() == 6); // also update text.dart + FXL_DCHECK(encoded.num_elements() == 6); // also update text.dart RefPtr style = RenderStyle::create(); style->inheritFrom(parentStyle); @@ -195,13 +195,13 @@ void ParagraphBuilder::RegisterNatives(tonic::DartLibraryNatives* natives) { FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -ftl::RefPtr ParagraphBuilder::create( +fxl::RefPtr ParagraphBuilder::create( tonic::Int32List& encoded, const std::string& fontFamily, double fontSize, double lineHeight, const std::u16string& ellipsis) { - return ftl::MakeRefCounted(encoded, fontFamily, fontSize, + return fxl::MakeRefCounted(encoded, fontFamily, fontSize, lineHeight, ellipsis); } @@ -276,7 +276,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, double letterSpacing, double wordSpacing, double height) { - FTL_DCHECK(encoded.num_elements() == 8); + FXL_DCHECK(encoded.num_elements() == 8); int32_t mask = encoded[0]; @@ -433,7 +433,7 @@ void ParagraphBuilder::addText(const std::string& text) { } } -ftl::RefPtr ParagraphBuilder::build() { +fxl::RefPtr ParagraphBuilder::build() { m_currentRenderObject = nullptr; if (!Settings::Get().using_blink) { return Paragraph::Create(m_paragraphBuilder->Build()); diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index 19dca760d7e6c..091c6f1f21424 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -21,13 +21,13 @@ namespace blink { class Paragraph; -class ParagraphBuilder : public ftl::RefCountedThreadSafe, +class ParagraphBuilder : public fxl::RefCountedThreadSafe, public tonic::DartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(ParagraphBuilder); public: - static ftl::RefPtr create(tonic::Int32List& encoded, + static fxl::RefPtr create(tonic::Int32List& encoded, const std::string& fontFamily, double fontSize, double lineHeight, @@ -46,7 +46,7 @@ class ParagraphBuilder : public ftl::RefCountedThreadSafe, void addText(const std::string& text); - ftl::RefPtr build(); + fxl::RefPtr build(); static void RegisterNatives(tonic::DartLibraryNatives* natives); diff --git a/lib/ui/text/paragraph_impl_blink.cc b/lib/ui/text/paragraph_impl_blink.cc index 55b5f05b7f5b8..f6a16ecf629a1 100644 --- a/lib/ui/text/paragraph_impl_blink.cc +++ b/lib/ui/text/paragraph_impl_blink.cc @@ -14,7 +14,7 @@ #include "flutter/sky/engine/platform/fonts/FontCache.h" #include "flutter/sky/engine/platform/graphics/GraphicsContext.h" #include "flutter/sky/engine/platform/text/TextBoundaries.h" -#include "lib/ftl/tasks/task_runner.h" +#include "lib/fxl/tasks/task_runner.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -90,7 +90,7 @@ void ParagraphImplBlink::paint(Canvas* canvas, double x, double y) { GraphicsContext context(skCanvas); Vector layers; LayoutRect bounds = box->absoluteBoundingBoxRect(); - FTL_DCHECK(bounds.x() == 0 && bounds.y() == 0); + FXL_DCHECK(bounds.x() == 0 && bounds.y() == 0); PaintInfo paintInfo(&context, enclosingIntRect(bounds), box); box->paint(paintInfo, LayoutPoint(), layers); // Note we're ignoring any layers encountered. @@ -127,7 +127,7 @@ std::vector ParagraphImplBlink::getRectsForRange(unsigned start, int ParagraphImplBlink::absoluteOffsetForPosition( const PositionWithAffinity& position) { - FTL_DCHECK(position.renderer()); + FXL_DCHECK(position.renderer()); unsigned offset = 0; for (RenderObject* object = m_renderView.get(); object; object = object->nextInPreOrder()) { @@ -138,7 +138,7 @@ int ParagraphImplBlink::absoluteOffsetForPosition( offset += text->textLength(); } } - FTL_DCHECK(false); + FXL_DCHECK(false); return 0; } diff --git a/lib/ui/text/paragraph_impl_txt.cc b/lib/ui/text/paragraph_impl_txt.cc index 369af9559395e..d2eb877d690ad 100644 --- a/lib/ui/text/paragraph_impl_txt.cc +++ b/lib/ui/text/paragraph_impl_txt.cc @@ -7,8 +7,8 @@ #include "flutter/common/threads.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_impl.h" -#include "lib/ftl/logging.h" -#include "lib/ftl/tasks/task_runner.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/tasks/task_runner.h" #include "lib/tonic/converter/dart_converter.h" #include "third_party/skia/include/core/SkPoint.h" diff --git a/lib/ui/text/text_box.cc b/lib/ui/text/text_box.cc index 511615aead240..3c7a000a6670e 100644 --- a/lib/ui/text/text_box.cc +++ b/lib/ui/text/text_box.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/text/text_box.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "lib/tonic/dart_class_library.h" #include "lib/tonic/dart_state.h" #include "lib/tonic/logging/dart_error.h" @@ -19,7 +19,7 @@ Dart_Handle DartConverter::ToDart(const TextBox& val) { DartClassLibrary& class_library = DartState::Current()->class_library(); Dart_Handle type = Dart_HandleFromPersistent(class_library.GetClass("ui", "TextBox")); - FTL_DCHECK(!LogIfError(type)); + FXL_DCHECK(!LogIfError(type)); constexpr int argc = 5; Dart_Handle argv[argc] = { tonic::ToDart(val.sk_rect.fLeft), diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index ef6796fc47d60..ac38e9ff0c015 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -34,7 +34,7 @@ UIDartState* UIDartState::CreateForChildIsolate() { } void UIDartState::DidSetIsolate() { - FTL_DCHECK(!debug_name_prefix_.empty()); + FXL_DCHECK(!debug_name_prefix_.empty()); main_port_ = Dart_GetMainPortId(); std::ostringstream debug_name; debug_name << debug_name_prefix_ << "$main-" << main_port_; diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index 99af0a432d058..8c5d9928b65d7 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -9,7 +9,7 @@ #include "dart/runtime/include/dart_api.h" #include "flutter/sky/engine/wtf/RefPtr.h" -#include "lib/ftl/build_config.h" +#include "lib/fxl/build_config.h" #include "lib/tonic/dart_persistent_value.h" #include "lib/tonic/dart_state.h" diff --git a/lib/ui/window/platform_message.cc b/lib/ui/window/platform_message.cc index e4adac16dbc3a..291fc4c522c0a 100644 --- a/lib/ui/window/platform_message.cc +++ b/lib/ui/window/platform_message.cc @@ -10,13 +10,13 @@ namespace blink { PlatformMessage::PlatformMessage(std::string channel, std::vector data, - ftl::RefPtr response) + fxl::RefPtr response) : channel_(std::move(channel)), data_(std::move(data)), hasData_(true), response_(std::move(response)) {} PlatformMessage::PlatformMessage(std::string channel, - ftl::RefPtr response) + fxl::RefPtr response) : channel_(std::move(channel)), data_(), hasData_(false), diff --git a/lib/ui/window/platform_message.h b/lib/ui/window/platform_message.h index 6aca2bdaa4e6d..76981ec52b257 100644 --- a/lib/ui/window/platform_message.h +++ b/lib/ui/window/platform_message.h @@ -9,12 +9,12 @@ #include #include "flutter/lib/ui/window/platform_message_response.h" -#include "lib/ftl/memory/ref_counted.h" -#include "lib/ftl/memory/ref_ptr.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" namespace blink { -class PlatformMessage : public ftl::RefCountedThreadSafe { +class PlatformMessage : public fxl::RefCountedThreadSafe { FRIEND_REF_COUNTED_THREAD_SAFE(PlatformMessage); FRIEND_MAKE_REF_COUNTED(PlatformMessage); @@ -23,22 +23,22 @@ class PlatformMessage : public ftl::RefCountedThreadSafe { const std::vector& data() const { return data_; } bool hasData() { return hasData_; } - const ftl::RefPtr& response() const { + const fxl::RefPtr& response() const { return response_; } private: PlatformMessage(std::string name, std::vector data, - ftl::RefPtr response); + fxl::RefPtr response); PlatformMessage(std::string name, - ftl::RefPtr response); + fxl::RefPtr response); ~PlatformMessage(); std::string channel_; std::vector data_; bool hasData_; - ftl::RefPtr response_; + fxl::RefPtr response_; }; } // namespace blink diff --git a/lib/ui/window/platform_message_response.h b/lib/ui/window/platform_message_response.h index 7109f9917127d..10105e182320c 100644 --- a/lib/ui/window/platform_message_response.h +++ b/lib/ui/window/platform_message_response.h @@ -7,13 +7,13 @@ #include -#include "lib/ftl/memory/ref_counted.h" -#include "lib/ftl/memory/ref_ptr.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" namespace blink { class PlatformMessageResponse - : public ftl::RefCountedThreadSafe { + : public fxl::RefCountedThreadSafe { FRIEND_REF_COUNTED_THREAD_SAFE(PlatformMessageResponse); public: diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc index 38d8c1493ed5c..1e80040cccd10 100644 --- a/lib/ui/window/platform_message_response_dart.cc +++ b/lib/ui/window/platform_message_response_dart.cc @@ -7,7 +7,7 @@ #include #include "flutter/common/threads.h" -#include "lib/ftl/functional/make_copyable.h" +#include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_state.h" #include "lib/tonic/logging/dart_invoke.h" @@ -20,7 +20,7 @@ PlatformMessageResponseDart::PlatformMessageResponseDart( PlatformMessageResponseDart::~PlatformMessageResponseDart() { if (!callback_.is_empty()) { Threads::UI()->PostTask( - ftl::MakeCopyable([callback = std::move(callback_)]() mutable { + fxl::MakeCopyable([callback = std::move(callback_)]() mutable { callback.Clear(); })); } @@ -29,9 +29,9 @@ PlatformMessageResponseDart::~PlatformMessageResponseDart() { void PlatformMessageResponseDart::Complete(std::vector data) { if (callback_.is_empty()) return; - FTL_DCHECK(!is_complete_); + FXL_DCHECK(!is_complete_); is_complete_ = true; - Threads::UI()->PostTask(ftl::MakeCopyable( + Threads::UI()->PostTask(fxl::MakeCopyable( [ callback = std::move(callback_), data = std::move(data) ]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) @@ -47,8 +47,8 @@ void PlatformMessageResponseDart::Complete(std::vector data) { Dart_TypedData_Type type; DART_CHECK_VALID( Dart_TypedDataAcquireData(byte_buffer, &type, &buffer, &length)); - FTL_CHECK(type == Dart_TypedData_kByteData); - FTL_CHECK(static_cast(length) == data.size()); + FXL_CHECK(type == Dart_TypedData_kByteData); + FXL_CHECK(static_cast(length) == data.size()); memcpy(buffer, data.data(), length); Dart_TypedDataReleaseData(byte_buffer); tonic::DartInvoke(callback.Release(), {byte_buffer}); @@ -58,9 +58,9 @@ void PlatformMessageResponseDart::Complete(std::vector data) { void PlatformMessageResponseDart::CompleteEmpty() { if (callback_.is_empty()) return; - FTL_DCHECK(!is_complete_); + FXL_DCHECK(!is_complete_); is_complete_ = true; - Threads::UI()->PostTask(ftl::MakeCopyable( + Threads::UI()->PostTask(fxl::MakeCopyable( [ callback = std::move(callback_) ]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) diff --git a/lib/ui/window/pointer_data_packet.h b/lib/ui/window/pointer_data_packet.h index 786a183ccf9ab..fb3fb5d773946 100644 --- a/lib/ui/window/pointer_data_packet.h +++ b/lib/ui/window/pointer_data_packet.h @@ -10,7 +10,7 @@ #include #include "flutter/lib/ui/window/pointer_data.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace blink { @@ -26,7 +26,7 @@ class PointerDataPacket { private: std::vector data_; - FTL_DISALLOW_COPY_AND_ASSIGN(PointerDataPacket); + FXL_DISALLOW_COPY_AND_ASSIGN(PointerDataPacket); }; } // namespace blink diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 755bf23b4fa36..a156c4764e460 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -31,7 +31,7 @@ Dart_Handle ToByteData(const std::vector& buffer) { Dart_TypedData_Type type; void* data = nullptr; intptr_t num_bytes = 0; - FTL_CHECK(!Dart_IsError( + FXL_CHECK(!Dart_IsError( Dart_TypedDataAcquireData(data_handle, &type, &data, &num_bytes))); memcpy(data, buffer.data(), num_bytes); @@ -76,19 +76,19 @@ void SendPlatformMessage(Dart_Handle window, const tonic::DartByteData& data) { UIDartState* dart_state = UIDartState::Current(); - ftl::RefPtr response; + fxl::RefPtr response; if (!Dart_IsNull(callback)) { - response = ftl::MakeRefCounted( + response = fxl::MakeRefCounted( tonic::DartPersistentValue(dart_state, callback)); } if (Dart_IsNull(data.dart_handle())) { UIDartState::Current()->window()->client()->HandlePlatformMessage( - ftl::MakeRefCounted(name, response)); + fxl::MakeRefCounted(name, response)); } else { const uint8_t* buffer = static_cast(data.data()); UIDartState::Current()->window()->client()->HandlePlatformMessage( - ftl::MakeRefCounted( + fxl::MakeRefCounted( name, std::vector(buffer, buffer + data.length_in_bytes()), response)); } @@ -172,7 +172,7 @@ void Window::UpdateSemanticsEnabled(bool enabled) { {ToDart(enabled)}); } -void Window::DispatchPlatformMessage(ftl::RefPtr message) { +void Window::DispatchPlatformMessage(fxl::RefPtr message) { tonic::DartState* dart_state = library_.dart_state().get(); if (!dart_state) return; @@ -217,13 +217,13 @@ void Window::DispatchSemanticsAction(int32_t id, SemanticsAction action) { {ToDart(id), ToDart(static_cast(action))}); } -void Window::BeginFrame(ftl::TimePoint frameTime) { +void Window::BeginFrame(fxl::TimePoint frameTime) { tonic::DartState* dart_state = library_.dart_state().get(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); - int64_t microseconds = (frameTime - ftl::TimePoint()).ToMicroseconds(); + int64_t microseconds = (frameTime - fxl::TimePoint()).ToMicroseconds(); DartInvokeField(library_.value(), "_beginFrame", { diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index 49b66b25c2c5f..c3ac6564b6c3f 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -11,7 +11,7 @@ #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/viewport_metrics.h" -#include "lib/ftl/time/time_point.h" +#include "lib/fxl/time/time_point.h" #include "lib/tonic/dart_persistent_value.h" namespace tonic { @@ -27,7 +27,7 @@ class WindowClient { virtual void ScheduleFrame() = 0; virtual void Render(Scene* scene) = 0; virtual void UpdateSemantics(SemanticsUpdate* update) = 0; - virtual void HandlePlatformMessage(ftl::RefPtr message) = 0; + virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; protected: virtual ~WindowClient(); @@ -46,10 +46,10 @@ class Window { void UpdateLocale(const std::string& language_code, const std::string& country_code); void UpdateSemanticsEnabled(bool enabled); - void DispatchPlatformMessage(ftl::RefPtr message); + void DispatchPlatformMessage(fxl::RefPtr message); void DispatchPointerDataPacket(const PointerDataPacket& packet); void DispatchSemanticsAction(int32_t id, SemanticsAction action); - void BeginFrame(ftl::TimePoint frameTime); + void BeginFrame(fxl::TimePoint frameTime); void CompletePlatformMessageResponse(int response_id, std::vector data); @@ -64,7 +64,7 @@ class Window { // We use id 0 to mean that no response is expected. int next_response_id_ = 1; - std::unordered_map> + std::unordered_map> pending_responses_; }; diff --git a/runtime/asset_font_selector.cc b/runtime/asset_font_selector.cc index 499bb03e9e1f3..66e2bcc41d809 100644 --- a/runtime/asset_font_selector.cc +++ b/runtime/asset_font_selector.cc @@ -9,7 +9,7 @@ #include "flutter/sky/engine/platform/fonts/FontData.h" #include "flutter/sky/engine/platform/fonts/FontFaceCreationParams.h" #include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "lib/ftl/arraysize.h" +#include "lib/fxl/arraysize.h" #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkTypeface.h" @@ -80,14 +80,14 @@ struct FontMatcher { } // namespace -void AssetFontSelector::Install(ftl::RefPtr asset_store) { +void AssetFontSelector::Install(fxl::RefPtr asset_store) { RefPtr font_selector = adoptRef(new AssetFontSelector(std::move(asset_store))); font_selector->parseFontManifest(); UIDartState::Current()->set_font_selector(font_selector); } -AssetFontSelector::AssetFontSelector(ftl::RefPtr asset_store) +AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_store) : asset_store_(std::move(asset_store)) {} AssetFontSelector::~AssetFontSelector() {} diff --git a/runtime/asset_font_selector.h b/runtime/asset_font_selector.h index 323c7e83868f3..a016c0dc64fb7 100644 --- a/runtime/asset_font_selector.h +++ b/runtime/asset_font_selector.h @@ -23,7 +23,7 @@ class AssetFontSelector : public FontSelector { ~AssetFontSelector() override; - static void Install(ftl::RefPtr asset_store); + static void Install(fxl::RefPtr asset_store); PassRefPtr getFontData(const FontDescription& font_description, const AtomicString& family_name) override; @@ -39,14 +39,14 @@ class AssetFontSelector : public FontSelector { private: struct TypefaceAsset; - explicit AssetFontSelector(ftl::RefPtr asset_store); + explicit AssetFontSelector(fxl::RefPtr asset_store); void parseFontManifest(); sk_sp getTypefaceAsset(const FontDescription& font_description, const AtomicString& family_name); - ftl::RefPtr asset_store_; + fxl::RefPtr asset_store_; HashMap> font_family_map_; diff --git a/runtime/dart_controller.cc b/runtime/dart_controller.cc index 452f4c51483bb..1452f9ebba8a2 100644 --- a/runtime/dart_controller.cc +++ b/runtime/dart_controller.cc @@ -16,8 +16,8 @@ #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/runtime/dart_init.h" #include "flutter/runtime/dart_service_isolate.h" -#include "lib/ftl/files/directory.h" -#include "lib/ftl/files/path.h" +#include "lib/fxl/files/directory.h" +#include "lib/fxl/files/path.h" #include "lib/tonic/dart_class_library.h" #include "lib/tonic/dart_message_handler.h" #include "lib/tonic/dart_state.h" @@ -35,7 +35,7 @@ using tonic::ToDart; namespace blink { namespace { -// TODO(abarth): Consider adding this to //garnet/public/lib/ftl. +// TODO(abarth): Consider adding this to //garnet/public/lib/fxl. std::string ResolvePath(std::string path) { if (!path.empty() && path[0] == '/') return path; @@ -68,7 +68,7 @@ bool DartController::SendStartMessage(Dart_Handle root_library) { { // Temporarily exit the isolate while we make it runnable. Dart_Isolate isolate = dart_state()->isolate(); - FTL_DCHECK(Dart_CurrentIsolate() == isolate); + FXL_DCHECK(Dart_CurrentIsolate() == isolate); Dart_ExitIsolate(); Dart_IsolateMakeRunnable(isolate); Dart_EnterIsolate(isolate); @@ -127,7 +127,7 @@ tonic::DartErrorHandleType DartController::RunFromKernel( tonic::DartErrorHandleType DartController::RunFromPrecompiledSnapshot() { TRACE_EVENT0("flutter", "DartController::RunFromPrecompiledSnapshot"); - FTL_DCHECK(Dart_CurrentIsolate() == nullptr); + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); tonic::DartState::Scope scope(dart_state()); if (SendStartMessage(Dart_RootLibrary())) { return tonic::kUnknownErrorType; @@ -152,7 +152,7 @@ tonic::DartErrorHandleType DartController::RunFromSource( tonic::DartState::Scope scope(dart_state()); tonic::FileLoader& loader = dart_state()->file_loader(); if (!packages.empty() && !loader.LoadPackagesMap(ResolvePath(packages))) - FTL_LOG(WARNING) << "Failed to load package map: " << packages; + FXL_LOG(WARNING) << "Failed to load package map: " << packages; Dart_Handle result = loader.LoadScript(main); LogIfError(result); tonic::DartErrorHandleType error = tonic::GetErrorHandleType(result); @@ -187,7 +187,7 @@ void DartController::CreateIsolateFor(const std::string& script_uri, isolate_snapshot_instr, nullptr, static_cast(state.get()), &error); } - FTL_CHECK(isolate) << error; + FXL_CHECK(isolate) << error; ui_dart_state_ = state.release(); dart_state()->message_handler().Initialize(blink::Threads::UI()); @@ -195,7 +195,7 @@ void DartController::CreateIsolateFor(const std::string& script_uri, ui_dart_state_->set_debug_name_prefix(script_uri); ui_dart_state_->SetIsolate(isolate); - FTL_CHECK(!LogIfError( + FXL_CHECK(!LogIfError( Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); { diff --git a/runtime/dart_controller.h b/runtime/dart_controller.h index 05a9cb877c7a6..16c0ace08d458 100644 --- a/runtime/dart_controller.h +++ b/runtime/dart_controller.h @@ -9,7 +9,7 @@ #include #include "dart/runtime/include/dart_api.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "lib/tonic/logging/dart_error.h" namespace blink { @@ -47,7 +47,7 @@ class DartController { // incrementally build the dart objects from it. uint8_t* platform_kernel_bytes; - FTL_DISALLOW_COPY_AND_ASSIGN(DartController); + FXL_DISALLOW_COPY_AND_ASSIGN(DartController); }; } diff --git a/runtime/dart_init.cc b/runtime/dart_init.cc index 02b39393a0532..f11d78e5b2ded 100644 --- a/runtime/dart_init.cc +++ b/runtime/dart_init.cc @@ -26,10 +26,10 @@ #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/runtime/dart_service_isolate.h" #include "flutter/runtime/start_up.h" -#include "lib/ftl/arraysize.h" -#include "lib/ftl/build_config.h" -#include "lib/ftl/logging.h" -#include "lib/ftl/time/time_delta.h" +#include "lib/fxl/arraysize.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/time/time_delta.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_class_library.h" #include "lib/tonic/dart_state.h" @@ -84,7 +84,7 @@ static const char* kDartPrecompilationArgs[] = { "--precompilation", }; -static const char* kDartWriteProtectCodeArgs[] FTL_ALLOW_UNUSED_TYPE = { +static const char* kDartWriteProtectCodeArgs[] FXL_ALLOW_UNUSED_TYPE = { "--no_write_protect_code", }; @@ -109,7 +109,7 @@ static const char* kDartEndlessTraceBufferArgs[]{ "--timeline_recorder=endless", }; -static const char* kDartFuchsiaTraceArgs[] FTL_ALLOW_UNUSED_TYPE = { +static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { "--systrace_timeline", "--timeline_streams=VM,Isolate,Compiler,Dart,GC", }; @@ -127,10 +127,10 @@ static RegisterNativeServiceProtocolExtensionHook void IsolateShutdownCallback(void* callback_data) { if (tonic::DartStickyError::IsSet()) { tonic::DartApiScope api_scope; - FTL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) + FXL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) << " exited with an error"; Dart_Handle sticky_error = Dart_GetStickyError(); - FTL_CHECK(LogIfError(sticky_error)); + FXL_CHECK(LogIfError(sticky_error)); } tonic::DartState* dart_state = static_cast(callback_data); delete dart_state; @@ -159,8 +159,8 @@ bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { // We add one to st_mtime because st_mtime has less precision than since_ms // and we want to treat the file as modified if the since time is between // ticks of the mtime. - ftl::TimeDelta mtime = ftl::TimeDelta::FromSeconds(info.st_mtime + 1); - ftl::TimeDelta since = ftl::TimeDelta::FromMilliseconds(since_ms); + fxl::TimeDelta mtime = fxl::TimeDelta::FromSeconds(info.st_mtime + 1); + fxl::TimeDelta since = fxl::TimeDelta::FromMilliseconds(since_ms); return mtime > since; } @@ -191,10 +191,10 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, Dart_Isolate isolate = Dart_CreateIsolate( script_uri, "main", g_default_isolate_snapshot_data, g_default_isolate_snapshot_instructions, nullptr, dart_state, error); - FTL_CHECK(isolate) << error; + FXL_CHECK(isolate) << error; dart_state->SetIsolate(isolate); - FTL_CHECK(Dart_IsServiceIsolate(isolate)); - FTL_CHECK(!LogIfError( + FXL_CHECK(Dart_IsServiceIsolate(isolate)); + FXL_CHECK(!LogIfError( Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); { tonic::DartApiScope dart_api_scope; @@ -209,7 +209,7 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, const bool service_isolate_booted = DartServiceIsolate::Startup( ip, port, tonic::DartState::HandleLibraryTag, IsRunningPrecompiledCode(), disable_websocket_origin_check, error); - FTL_CHECK(service_isolate_booted) << error; + FXL_CHECK(service_isolate_booted) << error; } if (g_service_isolate_hook) @@ -260,8 +260,8 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, if (!running_from_source) { // Attempt to copy the snapshot from the asset bundle. const std::string& bundle_path = entry_path; - ftl::RefPtr zip_asset_store = - ftl::MakeRefCounted( + fxl::RefPtr zip_asset_store = + fxl::MakeRefCounted( GetUnzipperProviderForPath(std::move(bundle_path))); zip_asset_store->GetAsBuffer(kKernelAssetKey, &kernel_data); zip_asset_store->GetAsBuffer(kSnapshotAssetKey, &snapshot_data); @@ -271,7 +271,7 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, if (!platform_data.empty()) { kernel_platform = Dart_ReadKernelBinary(platform_data.data(), platform_data.size()); - FTL_DCHECK(kernel_platform != NULL); + FXL_DCHECK(kernel_platform != NULL); } } } @@ -284,9 +284,9 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, nullptr /* flags */, dart_state, error) : Dart_CreateIsolate(script_uri, main, g_default_isolate_snapshot_data, g_default_isolate_snapshot_instructions, nullptr, dart_state, error); - FTL_CHECK(isolate) << error; + FXL_CHECK(isolate) << error; dart_state->SetIsolate(isolate); - FTL_CHECK(!LogIfError( + FXL_CHECK(!LogIfError( Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); { @@ -302,11 +302,11 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, if (!kernel_data.empty()) { // We are running kernel code. - FTL_CHECK(!LogIfError(Dart_LoadKernel(Dart_ReadKernelBinary(kernel_data.data(), + FXL_CHECK(!LogIfError(Dart_LoadKernel(Dart_ReadKernelBinary(kernel_data.data(), kernel_data.size())))); } else if (!snapshot_data.empty()) { // We are running from a script snapshot. - FTL_CHECK(!LogIfError(Dart_LoadScriptFromSnapshot(snapshot_data.data(), + FXL_CHECK(!LogIfError(Dart_LoadScriptFromSnapshot(snapshot_data.data(), snapshot_data.size()))); } else if (running_from_source) { // We are running from source. @@ -316,10 +316,10 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, const std::string& packages = parent_loader.packages(); tonic::FileLoader& loader = dart_state->file_loader(); if (!packages.empty() && !loader.LoadPackagesMap(packages)) { - FTL_LOG(WARNING) << "Failed to load package map: " << packages; + FXL_LOG(WARNING) << "Failed to load package map: " << packages; } // Load the script. - FTL_CHECK(!LogIfError(loader.LoadScript(entry_path))); + FXL_CHECK(!LogIfError(loader.LoadScript(entry_path))); } dart_state->isolate_client()->DidCreateSecondaryIsolate(isolate); @@ -327,7 +327,7 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, Dart_ExitIsolate(); - FTL_CHECK(Dart_IsolateMakeRunnable(isolate)); + FXL_CHECK(Dart_IsolateMakeRunnable(isolate)); return isolate; } @@ -419,13 +419,13 @@ static std::vector ProfilingFlags(bool enable_profiling) { } void SetServiceIsolateHook(ServiceIsolateHook hook) { - FTL_CHECK(!g_service_isolate_initialized); + FXL_CHECK(!g_service_isolate_initialized); g_service_isolate_hook = hook; } void SetRegisterNativeServiceProtocolExtensionHook( RegisterNativeServiceProtocolExtensionHook hook) { - FTL_CHECK(!g_service_isolate_initialized); + FXL_CHECK(!g_service_isolate_initialized); g_register_native_service_protocol_extensions_hook = hook; } @@ -526,7 +526,7 @@ void InitDartVM(const uint8_t* vm_snapshot_data, for (size_t i = 0; i < settings.dart_flags.size(); i++) args.push_back(settings.dart_flags[i].c_str()); - FTL_CHECK(Dart_SetVMFlags(args.size(), args.data())); + FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); #if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE if (!IsRunningPrecompiledCode()) { @@ -557,7 +557,7 @@ void InitDartVM(const uint8_t* vm_snapshot_data, params.get_service_assets = GetVMServiceAssetsArchiveCallback; char* init_error = Dart_Initialize(¶ms); if (init_error != nullptr) - FTL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; + FXL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; free(init_error); // Send the earliest available timestamp in the application lifecycle to diff --git a/runtime/dart_init.h b/runtime/dart_init.h index 12496c3b999be..64a18fb80e3b7 100644 --- a/runtime/dart_init.h +++ b/runtime/dart_init.h @@ -6,8 +6,8 @@ #define FLUTTER_RUNTIME_DART_INIT_H_ #include "dart/runtime/include/dart_api.h" -#include "lib/ftl/functional/closure.h" -#include "lib/ftl/build_config.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/build_config.h" #include #include @@ -25,7 +25,7 @@ extern const char kPlatformKernelAssetKey[]; bool IsRunningPrecompiledCode(); -using EmbedderTracingCallback = ftl::Closure; +using EmbedderTracingCallback = fxl::Closure; typedef void (*ServiceIsolateHook)(bool); typedef void (*RegisterNativeServiceProtocolExtensionHook)(bool); diff --git a/runtime/dart_service_isolate.cc b/runtime/dart_service_isolate.cc index 8d1300c1e8fb0..9a6184f8800a9 100644 --- a/runtime/dart_service_isolate.cc +++ b/runtime/dart_service_isolate.cc @@ -8,7 +8,7 @@ #include "dart/runtime/include/dart_api.h" #include "flutter/runtime/embedder_resources.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_library_natives.h" #include "lib/tonic/logging/dart_error.h" @@ -46,12 +46,12 @@ static std::string observatory_uri_; Dart_NativeFunction GetNativeFunction(Dart_Handle name, int argument_count, bool* auto_setup_scope) { - FTL_CHECK(g_natives); + FXL_CHECK(g_natives); return g_natives->GetNativeFunction(name, argument_count, auto_setup_scope); } const uint8_t* GetSymbol(Dart_NativeFunction native_function) { - FTL_CHECK(g_natives); + FXL_CHECK(g_natives); return g_natives->GetSymbol(native_function); } @@ -59,9 +59,9 @@ const uint8_t* GetSymbol(Dart_NativeFunction native_function) { void DartServiceIsolate::TriggerResourceLoad(Dart_NativeArguments args) { Dart_Handle library = Dart_RootLibrary(); - FTL_DCHECK(!Dart_IsError(library)); + FXL_DCHECK(!Dart_IsError(library)); Dart_Handle result = LoadResources(library); - FTL_DCHECK(!Dart_IsError(result)); + FXL_DCHECK(!Dart_IsError(result)); } void DartServiceIsolate::NotifyServerState(Dart_NativeArguments args) { @@ -87,11 +87,11 @@ bool DartServiceIsolate::Startup(std::string server_ip, bool disable_origin_check, char** error) { Dart_Isolate isolate = Dart_CurrentIsolate(); - FTL_CHECK(isolate); + FXL_CHECK(isolate); // Remember the embedder's library tag handler. g_embedder_tag_handler = embedder_tag_handler; - FTL_CHECK(g_embedder_tag_handler); + FXL_CHECK(g_embedder_tag_handler); // Setup native entries. if (!g_natives) { @@ -122,7 +122,7 @@ bool DartServiceIsolate::Startup(std::string server_ip, Dart_SetLibraryTagHandler(DartServiceIsolate::LibraryTagHandler); // Load main script. Dart_Handle library = LoadScript(kServiceIsolateScript); - FTL_DCHECK(library != Dart_Null()); + FXL_DCHECK(library != Dart_Null()); SHUTDOWN_ON_ERROR(library); // Setup native entry resolution. result = Dart_SetNativeResolver(library, GetNativeFunction, GetSymbol); @@ -181,7 +181,7 @@ Dart_Handle DartServiceIsolate::GetSource(const char* name) { name); const char* vmservice_source = NULL; int r = g_resources->ResourceLookup(buffer, &vmservice_source); - FTL_DCHECK(r != EmbedderResources::kNoSuchInstance); + FXL_DCHECK(r != EmbedderResources::kNoSuchInstance); return Dart_NewStringFromCString(vmservice_source); } @@ -206,7 +206,7 @@ Dart_Handle DartServiceIsolate::LoadResource(Dart_Handle library, const char* data_buffer = NULL; int data_buffer_length = g_resources->ResourceLookup(resource_name, &data_buffer); - FTL_DCHECK(data_buffer_length != EmbedderResources::kNoSuchInstance); + FXL_DCHECK(data_buffer_length != EmbedderResources::kNoSuchInstance); Dart_Handle data_list = Dart_NewTypedData(Dart_TypedData_kUint8, data_buffer_length); RETURN_ERROR_HANDLE(data_list); @@ -216,9 +216,9 @@ Dart_Handle DartServiceIsolate::LoadResource(Dart_Handle library, Dart_Handle result = Dart_TypedDataAcquireData( data_list, &type, &data_list_buffer, &data_list_buffer_length); RETURN_ERROR_HANDLE(result); - FTL_DCHECK(data_buffer_length == data_list_buffer_length); - FTL_DCHECK(data_list_buffer != NULL); - FTL_DCHECK(type = Dart_TypedData_kUint8); + FXL_DCHECK(data_buffer_length == data_list_buffer_length); + FXL_DCHECK(data_list_buffer != NULL); + FXL_DCHECK(type = Dart_TypedData_kUint8); memmove(data_list_buffer, &data_buffer[0], data_buffer_length); result = Dart_TypedDataReleaseData(data_list); RETURN_ERROR_HANDLE(result); @@ -272,7 +272,7 @@ Dart_Handle DartServiceIsolate::LibraryTagHandler(Dart_LibraryTag tag, // Embedder handles all requests for external libraries. return g_embedder_tag_handler(tag, library, url); } - FTL_DCHECK((tag == Dart_kSourceTag) || (tag == Dart_kCanonicalizeUrl)); + FXL_DCHECK((tag == Dart_kSourceTag) || (tag == Dart_kCanonicalizeUrl)); if (tag == Dart_kCanonicalizeUrl) { // url is already canonicalized. return url; diff --git a/runtime/embedder_resources.cc b/runtime/embedder_resources.cc index 7fe01c5372103..187dbaf81d1a1 100644 --- a/runtime/embedder_resources.cc +++ b/runtime/embedder_resources.cc @@ -6,7 +6,7 @@ #include -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace blink { @@ -22,7 +22,7 @@ int EmbedderResources::ResourceLookup(const char* path, const char** resource) { const ResourcesEntry& entry = resources_table_[i]; if (strcmp(path, entry.path_) == 0) { *resource = entry.resource_; - FTL_DCHECK(entry.length_ > 0); + FXL_DCHECK(entry.length_ > 0); return entry.length_; } } @@ -30,17 +30,17 @@ int EmbedderResources::ResourceLookup(const char* path, const char** resource) { } const char* EmbedderResources::Path(int idx) { - FTL_DCHECK(idx >= 0); + FXL_DCHECK(idx >= 0); ResourcesEntry* entry = At(idx); if (entry == nullptr) { return nullptr; } - FTL_DCHECK(entry->path_ != nullptr); + FXL_DCHECK(entry->path_ != nullptr); return entry->path_; } ResourcesEntry* EmbedderResources::At(int idx) { - FTL_DCHECK(idx >= 0); + FXL_DCHECK(idx >= 0); for (int i = 0; resources_table_[i].path_ != nullptr; i++) { if (idx == i) { return &resources_table_[i]; diff --git a/runtime/platform_impl.h b/runtime/platform_impl.h index 0a669c5e6bc23..5c9b02b69acca 100644 --- a/runtime/platform_impl.h +++ b/runtime/platform_impl.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_RUNTIME_PLATFORM_IMPL_H_ #define FLUTTER_RUNTIME_PLATFORM_IMPL_H_ -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "flutter/sky/engine/public/platform/Platform.h" namespace blink { @@ -19,7 +19,7 @@ class PlatformImpl : public Platform { std::string defaultLocale() override; private: - FTL_DISALLOW_COPY_AND_ASSIGN(PlatformImpl); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformImpl); }; } // namespace blink diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 8d04e2036ca18..e388b36142f57 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -30,7 +30,7 @@ void RuntimeController::CreateDartController( const std::string& script_uri, const uint8_t* isolate_snapshot_data, const uint8_t* isolate_snapshot_instr, const std::vector& platform_kernel) { - FTL_DCHECK(!dart_controller_); + FXL_DCHECK(!dart_controller_); dart_controller_.reset(new DartController()); dart_controller_->CreateIsolateFor( @@ -72,7 +72,7 @@ void RuntimeController::SetSemanticsEnabled(bool enabled) { GetWindow()->UpdateSemanticsEnabled(semantics_enabled_); } -void RuntimeController::BeginFrame(ftl::TimePoint frame_time) { +void RuntimeController::BeginFrame(fxl::TimePoint frame_time) { GetWindow()->BeginFrame(frame_time); } @@ -86,7 +86,7 @@ void RuntimeController::NotifyIdle(int64_t deadline) { } void RuntimeController::DispatchPlatformMessage( - ftl::RefPtr message) { + fxl::RefPtr message) { TRACE_EVENT0("flutter", "RuntimeController::DispatchPlatformMessage"); GetWindow()->DispatchPlatformMessage(std::move(message)); } @@ -125,7 +125,7 @@ void RuntimeController::UpdateSemantics(SemanticsUpdate* update) { } void RuntimeController::HandlePlatformMessage( - ftl::RefPtr message) { + fxl::RefPtr message) { client_->HandlePlatformMessage(std::move(message)); } diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 21245c2140e77..82032394bc0e4 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -11,7 +11,7 @@ #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/window.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace blink { class DartController; @@ -37,10 +37,10 @@ class RuntimeController : public WindowClient, public IsolateClient { const std::string& country_code); void SetSemanticsEnabled(bool enabled); - void BeginFrame(ftl::TimePoint frame_time); + void BeginFrame(fxl::TimePoint frame_time); void NotifyIdle(int64_t deadline); - void DispatchPlatformMessage(ftl::RefPtr message); + void DispatchPlatformMessage(fxl::RefPtr message); void DispatchPointerDataPacket(const PointerDataPacket& packet); void DispatchSemanticsAction(int32_t id, SemanticsAction action); @@ -58,7 +58,7 @@ class RuntimeController : public WindowClient, public IsolateClient { void ScheduleFrame() override; void Render(Scene* scene) override; void UpdateSemantics(SemanticsUpdate* update) override; - void HandlePlatformMessage(ftl::RefPtr message) override; + void HandlePlatformMessage(fxl::RefPtr message) override; void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; @@ -68,7 +68,7 @@ class RuntimeController : public WindowClient, public IsolateClient { bool semantics_enabled_ = false; std::unique_ptr dart_controller_; - FTL_DISALLOW_COPY_AND_ASSIGN(RuntimeController); + FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeController); }; } // namespace blink diff --git a/runtime/runtime_delegate.h b/runtime/runtime_delegate.h index e9c8d15c6f4b8..c3324bbd020e0 100644 --- a/runtime/runtime_delegate.h +++ b/runtime/runtime_delegate.h @@ -21,7 +21,7 @@ class RuntimeDelegate { virtual void ScheduleFrame() = 0; virtual void Render(std::unique_ptr layer_tree) = 0; virtual void UpdateSemantics(std::vector update) = 0; - virtual void HandlePlatformMessage(ftl::RefPtr message) = 0; + virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; virtual void DidCreateMainIsolate(Dart_Isolate isolate); virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate); diff --git a/runtime/runtime_init.cc b/runtime/runtime_init.cc index b25e5b0edbae2..cd05861cefd8e 100644 --- a/runtime/runtime_init.cc +++ b/runtime/runtime_init.cc @@ -8,7 +8,7 @@ #include "flutter/runtime/dart_init.h" #include "flutter/runtime/platform_impl.h" #include "flutter/sky/engine/public/web/Sky.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace blink { namespace { @@ -23,7 +23,7 @@ void InitRuntime(const uint8_t* vm_snapshot_data, const uint8_t* default_isolate_snapshot_instructions) { TRACE_EVENT0("flutter", "InitRuntime"); - FTL_CHECK(!g_platform_impl); + FXL_CHECK(!g_platform_impl); g_platform_impl = new PlatformImpl(); InitEngine(g_platform_impl); InitDartVM(vm_snapshot_data, vm_snapshot_instructions, diff --git a/runtime/test_font_selector.h b/runtime/test_font_selector.h index de0f006c8fdb3..90ab55bfd04a1 100644 --- a/runtime/test_font_selector.h +++ b/runtime/test_font_selector.h @@ -7,7 +7,7 @@ #include "flutter/sky/engine/platform/fonts/FontSelector.h" #include "flutter/sky/engine/wtf/RefPtr.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkTypeface.h" namespace blink { @@ -34,7 +34,7 @@ class TestFontSelector : public FontSelector { TestFontSelector(); - FTL_DISALLOW_COPY_AND_ASSIGN(TestFontSelector); + FXL_DISALLOW_COPY_AND_ASSIGN(TestFontSelector); }; } // namespace blink diff --git a/shell/common/animator.cc b/shell/common/animator.cc index 3202af2f0f823..b671d98ce5733 100644 --- a/shell/common/animator.cc +++ b/shell/common/animator.cc @@ -6,12 +6,12 @@ #include "flutter/common/threads.h" #include "flutter/fml/trace_event.h" -#include "lib/ftl/time/stopwatch.h" +#include "lib/fxl/time/stopwatch.h" #include "dart/runtime/include/dart_tools_api.h" namespace shell { -Animator::Animator(ftl::WeakPtr rasterizer, +Animator::Animator(fxl::WeakPtr rasterizer, VsyncWaiter* waiter, Engine* engine) : rasterizer_(rasterizer), @@ -19,7 +19,7 @@ Animator::Animator(ftl::WeakPtr rasterizer, engine_(engine), last_begin_frame_time_(), dart_frame_deadline_(0), - layer_tree_pipeline_(ftl::MakeRefCounted(2)), + layer_tree_pipeline_(fxl::MakeRefCounted(2)), pending_frame_semaphore_(1), frame_number_(1), paused_(false), @@ -41,14 +41,14 @@ void Animator::Start() { RequestFrame(); } -static int64_t FtlToDartOrEarlier(ftl::TimePoint time) { +static int64_t FxlToDartOrEarlier(fxl::TimePoint time) { int64_t dart_now = Dart_TimelineGetMicros(); - ftl::TimePoint ftl_now = ftl::TimePoint::Now(); - return (time - ftl_now).ToMicroseconds() + dart_now; + fxl::TimePoint fxl_now = fxl::TimePoint::Now(); + return (time - fxl_now).ToMicroseconds() + dart_now; } -void Animator::BeginFrame(ftl::TimePoint frame_start_time, - ftl::TimePoint frame_target_time) { +void Animator::BeginFrame(fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time) { TRACE_EVENT_ASYNC_END0("flutter", "Frame Request Pending", frame_number_++); frame_scheduled_ = false; @@ -72,10 +72,10 @@ void Animator::BeginFrame(ftl::TimePoint frame_start_time, // We have acquired a valid continuation from the pipeline and are ready // to service potential frame. - FTL_DCHECK(producer_continuation_); + FXL_DCHECK(producer_continuation_); last_begin_frame_time_ = frame_start_time; - dart_frame_deadline_ = FtlToDartOrEarlier(frame_target_time); + dart_frame_deadline_ = FxlToDartOrEarlier(frame_target_time); engine_->BeginFrame(last_begin_frame_time_); if (!frame_scheduled_) { @@ -88,7 +88,7 @@ void Animator::BeginFrame(ftl::TimePoint frame_start_time, void Animator::Render(std::unique_ptr layer_tree) { if (layer_tree) { // Note the frame time for instrumentation. - layer_tree->set_construction_time(ftl::TimePoint::Now() - + layer_tree->set_construction_time(fxl::TimePoint::Now() - last_begin_frame_time_); } @@ -135,7 +135,7 @@ void Animator::RequestFrame() { void Animator::AwaitVSync() { waiter_->AsyncWaitForVsync([self = weak_factory_.GetWeakPtr()]( - ftl::TimePoint frame_start_time, ftl::TimePoint frame_target_time) { + fxl::TimePoint frame_start_time, fxl::TimePoint frame_target_time) { if (self) self->BeginFrame(frame_start_time, frame_target_time); }); diff --git a/shell/common/animator.h b/shell/common/animator.h index 1057ec999972f..010f3dfe3d8de 100644 --- a/shell/common/animator.h +++ b/shell/common/animator.h @@ -10,15 +10,15 @@ #include "flutter/shell/common/vsync_waiter.h" #include "flutter/synchronization/pipeline.h" #include "flutter/synchronization/semaphore.h" -#include "lib/ftl/memory/ref_ptr.h" -#include "lib/ftl/memory/weak_ptr.h" -#include "lib/ftl/time/time_point.h" +#include "lib/fxl/memory/ref_ptr.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/time/time_point.h" namespace shell { class Animator { public: - Animator(ftl::WeakPtr rasterizer, + Animator(fxl::WeakPtr rasterizer, VsyncWaiter* waiter, Engine* engine); @@ -35,27 +35,27 @@ class Animator { private: using LayerTreePipeline = flutter::Pipeline; - void BeginFrame(ftl::TimePoint frame_start_time, - ftl::TimePoint frame_target_time); + void BeginFrame(fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time); void AwaitVSync(); - ftl::WeakPtr rasterizer_; + fxl::WeakPtr rasterizer_; VsyncWaiter* waiter_; Engine* engine_; - ftl::TimePoint last_begin_frame_time_; + fxl::TimePoint last_begin_frame_time_; int64_t dart_frame_deadline_; - ftl::RefPtr layer_tree_pipeline_; + fxl::RefPtr layer_tree_pipeline_; flutter::Semaphore pending_frame_semaphore_; LayerTreePipeline::ProducerContinuation producer_continuation_; int64_t frame_number_; bool paused_; bool frame_scheduled_; - ftl::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; - FTL_DISALLOW_COPY_AND_ASSIGN(Animator); + FXL_DISALLOW_COPY_AND_ASSIGN(Animator); }; } // namespace shell diff --git a/shell/common/diagnostic/diagnostic_server.cc b/shell/common/diagnostic/diagnostic_server.cc index 2730dfd732a91..64ae0738e60ed 100644 --- a/shell/common/diagnostic/diagnostic_server.cc +++ b/shell/common/diagnostic/diagnostic_server.cc @@ -13,7 +13,7 @@ #include "flutter/shell/common/picture_serializer.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/shell.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" #include "lib/tonic/logging/dart_invoke.h" @@ -42,12 +42,12 @@ constexpr char kDiagnosticServerScript[] = "/diagnostic_server.dart"; Dart_NativeFunction GetNativeFunction(Dart_Handle name, int argument_count, bool* auto_setup_scope) { - FTL_CHECK(g_natives); + FXL_CHECK(g_natives); return g_natives->GetNativeFunction(name, argument_count, auto_setup_scope); } const uint8_t* GetSymbol(Dart_NativeFunction native_function) { - FTL_CHECK(g_natives); + FXL_CHECK(g_natives); return g_natives->GetSymbol(native_function); } @@ -75,7 +75,7 @@ void DiagnosticServer::Start(uint32_t port, bool ipv6) { const char* source = nullptr; int source_length = resources.ResourceLookup(kDiagnosticServerScript, &source); - FTL_DCHECK(source_length != EmbedderResources::kNoSuchInstance); + FXL_DCHECK(source_length != EmbedderResources::kNoSuchInstance); Dart_Handle diagnostic_library = Dart_LoadLibrary( Dart_NewStringFromCString("dart:diagnostic_server"), Dart_Null(), @@ -83,14 +83,14 @@ void DiagnosticServer::Start(uint32_t port, bool ipv6) { source_length), 0, 0); - FTL_CHECK(!LogIfError(diagnostic_library)); - FTL_CHECK(!LogIfError(Dart_SetNativeResolver(diagnostic_library, + FXL_CHECK(!LogIfError(diagnostic_library)); + FXL_CHECK(!LogIfError(Dart_SetNativeResolver(diagnostic_library, GetNativeFunction, GetSymbol))); - FTL_CHECK(!LogIfError(Dart_LibraryImportLibrary( + FXL_CHECK(!LogIfError(Dart_LibraryImportLibrary( Dart_RootLibrary(), diagnostic_library, Dart_Null()))); - FTL_CHECK(!LogIfError(Dart_FinalizeLoading(false))); + FXL_CHECK(!LogIfError(Dart_FinalizeLoading(false))); DartInvokeField(Dart_RootLibrary(), "diagnosticServerStart", {ToDart(port), ToDart(ipv6)}); @@ -98,13 +98,13 @@ void DiagnosticServer::Start(uint32_t port, bool ipv6) { void DiagnosticServer::HandleSkiaPictureRequest(Dart_Handle send_port) { Dart_Port port_id; - FTL_CHECK(!LogIfError(Dart_SendPortGetId(send_port, &port_id))); + FXL_CHECK(!LogIfError(Dart_SendPortGetId(send_port, &port_id))); blink::Threads::Gpu()->PostTask([port_id]() { SkiaPictureTask(port_id); }); } void DiagnosticServer::SkiaPictureTask(Dart_Port port_id) { - std::vector> rasterizers; + std::vector> rasterizers; Shell::Shared().GetRasterizers(&rasterizers); if (rasterizers.size() != 1) { SendNull(port_id); diff --git a/shell/common/engine.cc b/shell/common/engine.cc index f7d8128198da4..85b9f76033971 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -28,11 +28,11 @@ #include "flutter/shell/common/animator.h" #include "flutter/shell/common/platform_view.h" #include "flutter/sky/engine/public/web/Sky.h" -#include "lib/ftl/files/eintr_wrapper.h" -#include "lib/ftl/files/file.h" -#include "lib/ftl/files/path.h" -#include "lib/ftl/files/unique_fd.h" -#include "lib/ftl/functional/make_copyable.h" +#include "lib/fxl/files/eintr_wrapper.h" +#include "lib/fxl/files/file.h" +#include "lib/fxl/files/path.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/functional/make_copyable.h" #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" @@ -80,7 +80,7 @@ Engine::Engine(PlatformView* platform_view) Engine::~Engine() {} -ftl::WeakPtr Engine::GetWeakPtr() { +fxl::WeakPtr Engine::GetWeakPtr() { return weak_factory_.GetWeakPtr(); } @@ -104,7 +104,7 @@ static const uint8_t* MemMapSnapshot(const std::string& aot_snapshot_path, } int64_t asset_size = info.st_size; - ftl::UniqueFD fd(HANDLE_EINTR(open(asset_path.c_str(), O_RDONLY))); + fxl::UniqueFD fd(HANDLE_EINTR(open(asset_path.c_str(), O_RDONLY))); if (fd.get() == -1) { return nullptr; } @@ -145,7 +145,7 @@ void Engine::Init() { void* library_handle = dlopen(application_library_path, RTLD_NOW); const char* err = dlerror(); if (err != nullptr) { - FTL_LOG(FATAL) << "dlopen failed: " << err; + FXL_LOG(FATAL) << "dlopen failed: " << err; } vm_snapshot_data = reinterpret_cast( dlsym(library_handle, "kDartVmSnapshotData")); @@ -158,7 +158,7 @@ void Engine::Init() { #elif OS(ANDROID) const blink::Settings& settings = blink::Settings::Get(); const std::string& aot_snapshot_path = settings.aot_snapshot_path; - FTL_CHECK(!aot_snapshot_path.empty()); + FXL_CHECK(!aot_snapshot_path.empty()); vm_snapshot_data = MemMapSnapshot(aot_snapshot_path, "vm_snapshot_data", settings.aot_vm_snapshot_data_filename, false); @@ -227,7 +227,7 @@ void Engine::RunBundleAndSource(const std::string& bundle_path, const std::string& main, const std::string& packages) { TRACE_EVENT0("flutter", "Engine::RunBundleAndSource"); - FTL_CHECK(!blink::IsRunningPrecompiledCode()) + FXL_CHECK(!blink::IsRunningPrecompiledCode()) << "Cannot run from source in a precompiled build."; std::string packages_path = packages; if (packages_path.empty()) @@ -239,7 +239,7 @@ void Engine::RunBundleAndSource(const std::string& bundle_path, runtime_->dart_controller()->RunFromSource(main, packages_path); } -void Engine::BeginFrame(ftl::TimePoint frame_time) { +void Engine::BeginFrame(fxl::TimePoint frame_time) { TRACE_EVENT0("flutter", "Engine::BeginFrame"); if (runtime_) runtime_->BeginFrame(frame_time); @@ -286,7 +286,7 @@ tonic::DartErrorHandleType Engine::GetLoadScriptError() { return load_script_error_; } -void Engine::OnOutputSurfaceCreated(const ftl::Closure& gpu_continuation) { +void Engine::OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation) { blink::Threads::Gpu()->PostTask(gpu_continuation); have_surface_ = true; StartAnimatorIfPossible(); @@ -294,7 +294,7 @@ void Engine::OnOutputSurfaceCreated(const ftl::Closure& gpu_continuation) { ScheduleFrame(); } -void Engine::OnOutputSurfaceDestroyed(const ftl::Closure& gpu_continuation) { +void Engine::OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation) { have_surface_ = false; StopAnimator(); blink::Threads::Gpu()->PostTask(gpu_continuation); @@ -307,7 +307,7 @@ void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) { } void Engine::DispatchPlatformMessage( - ftl::RefPtr message) { + fxl::RefPtr message) { if (message->channel() == kLifecycleChannel) { if (HandleLifecyclePlatformMessage(message.get())) return; @@ -349,8 +349,8 @@ bool Engine::HandleLifecyclePlatformMessage(blink::PlatformMessage* message) { } bool Engine::HandleNavigationPlatformMessage( - ftl::RefPtr message) { - FTL_DCHECK(!runtime_); + fxl::RefPtr message) { + FXL_DCHECK(!runtime_); const auto& data = message->data(); rapidjson::Document document; @@ -367,7 +367,7 @@ bool Engine::HandleNavigationPlatformMessage( } bool Engine::HandleLocalizationPlatformMessage( - ftl::RefPtr message) { + fxl::RefPtr message) { const auto& data = message->data(); rapidjson::Document document; @@ -420,7 +420,7 @@ void Engine::ConfigureAssetBundle(const std::string& path) { // custom font loading in hot reload. if (::stat(path.c_str(), &stat_result) != 0) { - FTL_LOG(INFO) << "Could not configure asset bundle at path: " << path; + FXL_LOG(INFO) << "Could not configure asset bundle at path: " << path; return; } @@ -431,7 +431,7 @@ void Engine::ConfigureAssetBundle(const std::string& path) { } if (S_ISREG(stat_result.st_mode)) { - asset_store_ = ftl::MakeRefCounted( + asset_store_ = fxl::MakeRefCounted( blink::GetUnzipperProviderForPath(path)); return; } @@ -496,7 +496,7 @@ void Engine::Render(std::unique_ptr layer_tree) { } void Engine::UpdateSemantics(std::vector update) { - blink::Threads::Platform()->PostTask(ftl::MakeCopyable([ + blink::Threads::Platform()->PostTask(fxl::MakeCopyable([ platform_view = platform_view_.lock(), update = std::move(update) ]() mutable { if (platform_view) @@ -505,7 +505,7 @@ void Engine::UpdateSemantics(std::vector update) { } void Engine::HandlePlatformMessage( - ftl::RefPtr message) { + fxl::RefPtr message) { if (message->channel() == kAssetChannel) { HandleAssetPlatformMessage(std::move(message)); return; @@ -519,8 +519,8 @@ void Engine::HandlePlatformMessage( } void Engine::HandleAssetPlatformMessage( - ftl::RefPtr message) { - ftl::RefPtr response = message->response(); + fxl::RefPtr message) { + fxl::RefPtr response = message->response(); if (!response) return; const auto& data = message->data(); diff --git a/shell/common/engine.h b/shell/common/engine.h index 0ec339390c087..1198b2494369d 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -11,8 +11,8 @@ #include "flutter/runtime/runtime_controller.h" #include "flutter/runtime/runtime_delegate.h" #include "flutter/shell/common/rasterizer.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkPicture.h" namespace blink { @@ -31,7 +31,7 @@ class Engine : public blink::RuntimeDelegate { ~Engine() override; - ftl::WeakPtr GetWeakPtr(); + fxl::WeakPtr GetWeakPtr(); static void Init(); @@ -49,7 +49,7 @@ class Engine : public blink::RuntimeDelegate { const std::string& main, const std::string& packages); - void BeginFrame(ftl::TimePoint frame_time); + void BeginFrame(fxl::TimePoint frame_time); void NotifyIdle(int64_t deadline); void RunFromSource(const std::string& main, @@ -62,10 +62,10 @@ class Engine : public blink::RuntimeDelegate { tonic::DartErrorHandleType GetUIIsolateLastError(); tonic::DartErrorHandleType GetLoadScriptError(); - void OnOutputSurfaceCreated(const ftl::Closure& gpu_continuation); - void OnOutputSurfaceDestroyed(const ftl::Closure& gpu_continuation); + void OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation); + void OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation); void SetViewportMetrics(const blink::ViewportMetrics& metrics); - void DispatchPlatformMessage(ftl::RefPtr message); + void DispatchPlatformMessage(fxl::RefPtr message); void DispatchPointerDataPacket(const PointerDataPacket& packet); void DispatchSemanticsAction(int id, blink::SemanticsAction action); void SetSemanticsEnabled(bool enabled); @@ -77,7 +77,7 @@ class Engine : public blink::RuntimeDelegate { void Render(std::unique_ptr layer_tree) override; void UpdateSemantics(std::vector update) override; void HandlePlatformMessage( - ftl::RefPtr message) override; + fxl::RefPtr message) override; void DidCreateMainIsolate(Dart_Isolate isolate) override; void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; @@ -90,11 +90,11 @@ class Engine : public blink::RuntimeDelegate { bool HandleLifecyclePlatformMessage(blink::PlatformMessage* message); bool HandleNavigationPlatformMessage( - ftl::RefPtr message); + fxl::RefPtr message); bool HandleLocalizationPlatformMessage( - ftl::RefPtr message); + fxl::RefPtr message); - void HandleAssetPlatformMessage(ftl::RefPtr message); + void HandleAssetPlatformMessage(fxl::RefPtr message); bool GetAssetAsBuffer(const std::string& name, std::vector* data); std::weak_ptr platform_view_; @@ -107,14 +107,14 @@ class Engine : public blink::RuntimeDelegate { std::string country_code_; bool semantics_enabled_ = false; // TODO(abarth): Unify these two behind a common interface. - ftl::RefPtr asset_store_; + fxl::RefPtr asset_store_; std::unique_ptr directory_asset_bundle_; // TODO(eseidel): This should move into an AnimatorStateMachine. bool activity_running_; bool have_surface_; - ftl::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; - FTL_DISALLOW_COPY_AND_ASSIGN(Engine); + FXL_DISALLOW_COPY_AND_ASSIGN(Engine); }; } // namespace shell diff --git a/shell/common/null_rasterizer.cc b/shell/common/null_rasterizer.cc index cba8dbda2f882..80c60638fc0f0 100644 --- a/shell/common/null_rasterizer.cc +++ b/shell/common/null_rasterizer.cc @@ -10,22 +10,22 @@ NullRasterizer::NullRasterizer() : weak_factory_(this) {} void NullRasterizer::Setup( std::unique_ptr surface_or_null, - ftl::Closure rasterizer_continuation, - ftl::AutoResetWaitableEvent* setup_completion_event) { + fxl::Closure rasterizer_continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) { surface_ = std::move(surface_or_null); rasterizer_continuation(); setup_completion_event->Signal(); } void NullRasterizer::Teardown( - ftl::AutoResetWaitableEvent* teardown_completion_event) { + fxl::AutoResetWaitableEvent* teardown_completion_event) { if (surface_) { surface_.reset(); } teardown_completion_event->Signal(); } -ftl::WeakPtr NullRasterizer::GetWeakRasterizerPtr() { +fxl::WeakPtr NullRasterizer::GetWeakRasterizerPtr() { return weak_factory_.GetWeakPtr(); } @@ -38,8 +38,8 @@ void NullRasterizer::Clear(SkColor color, const SkISize& size) { } void NullRasterizer::Draw( - ftl::RefPtr> pipeline) { - FTL_ALLOW_UNUSED_LOCAL( + fxl::RefPtr> pipeline) { + FXL_ALLOW_UNUSED_LOCAL( pipeline->Consume([](std::unique_ptr) { // Drop the layer tree on the floor. We only need the pipeline empty so // that frame requests are not deferred indefinitely due to @@ -47,7 +47,7 @@ void NullRasterizer::Draw( })); } -void NullRasterizer::AddNextFrameCallback(ftl::Closure nextFrameCallback) { +void NullRasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { // Null rasterizer. Nothing to do. } diff --git a/shell/common/null_rasterizer.h b/shell/common/null_rasterizer.h index c4a3b4d8ff36e..43e4edb6f2297 100644 --- a/shell/common/null_rasterizer.h +++ b/shell/common/null_rasterizer.h @@ -6,8 +6,8 @@ #define FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ #include "flutter/shell/common/rasterizer.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" namespace shell { @@ -16,27 +16,27 @@ class NullRasterizer : public Rasterizer { NullRasterizer(); void Setup(std::unique_ptr surface_or_null, - ftl::Closure rasterizer_continuation, - ftl::AutoResetWaitableEvent* setup_completion_event) override; + fxl::Closure rasterizer_continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) override; void Teardown( - ftl::AutoResetWaitableEvent* teardown_completion_event) override; + fxl::AutoResetWaitableEvent* teardown_completion_event) override; void Clear(SkColor color, const SkISize& size) override; - ftl::WeakPtr GetWeakRasterizerPtr() override; + fxl::WeakPtr GetWeakRasterizerPtr() override; flow::LayerTree* GetLastLayerTree() override; - void Draw(ftl::RefPtr> pipeline) override; + void Draw(fxl::RefPtr> pipeline) override; - void AddNextFrameCallback(ftl::Closure nextFrameCallback) override; + void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; private: std::unique_ptr surface_; - ftl::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; - FTL_DISALLOW_COPY_AND_ASSIGN(NullRasterizer); + FXL_DISALLOW_COPY_AND_ASSIGN(NullRasterizer); }; } // namespace shell diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index 0206cd720a554..3b5fa308f92de 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -10,7 +10,7 @@ #include "flutter/lib/ui/painting/resource_context.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/vsync_waiter_fallback.h" -#include "lib/ftl/functional/make_copyable.h" +#include "lib/fxl/functional/make_copyable.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" @@ -41,7 +41,7 @@ void PlatformView::PostAddToShellTask() { } void PlatformView::DispatchPlatformMessage( - ftl::RefPtr message) { + fxl::RefPtr message) { blink::Threads::UI()->PostTask( [ engine = engine_->GetWeakPtr(), message = std::move(message) ] { if (engine) { @@ -73,16 +73,16 @@ void PlatformView::NotifyCreated(std::unique_ptr surface) { } void PlatformView::NotifyCreated(std::unique_ptr surface, - ftl::Closure caller_continuation) { - ftl::AutoResetWaitableEvent latch; + fxl::Closure caller_continuation) { + fxl::AutoResetWaitableEvent latch; - auto ui_continuation = ftl::MakeCopyable([ + auto ui_continuation = fxl::MakeCopyable([ this, // surface = std::move(surface), // caller_continuation, // &latch ]() mutable { - auto gpu_continuation = ftl::MakeCopyable([ + auto gpu_continuation = fxl::MakeCopyable([ this, // surface = std::move(surface), // caller_continuation, // @@ -102,7 +102,7 @@ void PlatformView::NotifyCreated(std::unique_ptr surface, } void PlatformView::NotifyDestroyed() { - ftl::AutoResetWaitableEvent latch; + fxl::AutoResetWaitableEvent latch; auto engine_continuation = [this, &latch]() { rasterizer_->Teardown(&latch); @@ -128,13 +128,13 @@ VsyncWaiter* PlatformView::GetVsyncWaiter() { void PlatformView::UpdateSemantics(std::vector update) {} void PlatformView::HandlePlatformMessage( - ftl::RefPtr message) { + fxl::RefPtr message) { if (auto response = message->response()) response->CompleteEmpty(); } void PlatformView::SetupResourceContextOnIOThread() { - ftl::AutoResetWaitableEvent latch; + fxl::AutoResetWaitableEvent latch; blink::Threads::IO()->PostTask( [this, &latch]() { SetupResourceContextOnIOThreadPerform(&latch); }); @@ -143,7 +143,7 @@ void PlatformView::SetupResourceContextOnIOThread() { } void PlatformView::SetupResourceContextOnIOThreadPerform( - ftl::AutoResetWaitableEvent* latch) { + fxl::AutoResetWaitableEvent* latch) { if (blink::ResourceContext::Get() != nullptr) { // The resource context was already setup. This could happen if platforms // try to setup a context multiple times, or, if there are multiple platform @@ -156,7 +156,7 @@ void PlatformView::SetupResourceContextOnIOThreadPerform( bool current = ResourceContextMakeCurrent(); if (!current) { - FTL_DLOG(WARNING) + FXL_DLOG(WARNING) << "WARNING: Could not setup a context on the resource loader."; latch->Signal(); return; diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index 4b5bf66d5205b..33c6a4ca1ad84 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -12,9 +12,9 @@ #include "flutter/shell/common/shell.h" #include "flutter/shell/common/surface.h" #include "flutter/shell/common/vsync_waiter.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" -#include "lib/ftl/synchronization/waitable_event.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/gpu/GrContext.h" @@ -39,14 +39,14 @@ class PlatformView : public std::enable_shared_from_this { virtual void Attach() = 0; - void DispatchPlatformMessage(ftl::RefPtr message); + void DispatchPlatformMessage(fxl::RefPtr message); void DispatchSemanticsAction(int32_t id, blink::SemanticsAction action); void SetSemanticsEnabled(bool enabled); void NotifyCreated(std::unique_ptr surface); void NotifyCreated(std::unique_ptr surface, - ftl::Closure continuation); + fxl::Closure continuation); void NotifyDestroyed(); @@ -59,7 +59,7 @@ class PlatformView : public std::enable_shared_from_this { virtual void UpdateSemantics(std::vector update); virtual void HandlePlatformMessage( - ftl::RefPtr message); + fxl::RefPtr message); Rasterizer& rasterizer() { return *rasterizer_; } Engine& engine() { return *engine_; } @@ -75,7 +75,7 @@ class PlatformView : public std::enable_shared_from_this { void PostAddToShellTask(); void SetupResourceContextOnIOThreadPerform( - ftl::AutoResetWaitableEvent* event); + fxl::AutoResetWaitableEvent* event); SurfaceConfig surface_config_; std::unique_ptr rasterizer_; @@ -85,7 +85,7 @@ class PlatformView : public std::enable_shared_from_this { private: - FTL_DISALLOW_COPY_AND_ASSIGN(PlatformView); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); }; } // namespace shell diff --git a/shell/common/platform_view_service_protocol.cc b/shell/common/platform_view_service_protocol.cc index 39385d5496c74..da63869aa5390 100644 --- a/shell/common/platform_view_service_protocol.cc +++ b/shell/common/platform_view_service_protocol.cc @@ -13,7 +13,7 @@ #include "flutter/shell/common/picture_serializer.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/shell.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/src/utils/SkBase64.h" @@ -259,7 +259,7 @@ bool PlatformViewServiceProtocol::Screenshot(const char* method, intptr_t num_params, void* user_data, const char** json_object) { - ftl::AutoResetWaitableEvent latch; + fxl::AutoResetWaitableEvent latch; SkBitmap bitmap; blink::Threads::Gpu()->PostTask([&latch, &bitmap]() { ScreenshotGpuTask(&bitmap); @@ -286,7 +286,7 @@ bool PlatformViewServiceProtocol::Screenshot(const char* method, } void PlatformViewServiceProtocol::ScreenshotGpuTask(SkBitmap* bitmap) { - std::vector> rasterizers; + std::vector> rasterizers; Shell::Shared().GetRasterizers(&rasterizers); if (rasterizers.size() != 1) return; @@ -331,7 +331,7 @@ bool PlatformViewServiceProtocol::FlushUIThreadTasks(const char* method, intptr_t num_params, void* user_data, const char** json_object) { - ftl::AutoResetWaitableEvent latch; + fxl::AutoResetWaitableEvent latch; blink::Threads::UI()->PostTask([&latch]() { // This task is empty because we just need to synchronize this RPC with the // UI Thread diff --git a/shell/common/platform_view_service_protocol.h b/shell/common/platform_view_service_protocol.h index d0ad2ade489d3..7119aeb03dbd5 100644 --- a/shell/common/platform_view_service_protocol.h +++ b/shell/common/platform_view_service_protocol.h @@ -9,7 +9,7 @@ #include "dart/runtime/include/dart_tools_api.h" #include "flutter/shell/common/platform_view.h" -#include "lib/ftl/synchronization/waitable_event.h" +#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkBitmap.h" namespace shell { diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index 1873d12905c9e..6739df7098ebb 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -10,9 +10,9 @@ #include "flutter/flow/layers/layer_tree.h" #include "flutter/shell/common/surface.h" #include "flutter/synchronization/pipeline.h" -#include "lib/ftl/functional/closure.h" -#include "lib/ftl/memory/weak_ptr.h" -#include "lib/ftl/synchronization/waitable_event.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/synchronization/waitable_event.h" namespace shell { @@ -21,23 +21,23 @@ class Rasterizer { virtual ~Rasterizer(); virtual void Setup(std::unique_ptr surface_or_null, - ftl::Closure rasterizer_continuation, - ftl::AutoResetWaitableEvent* setup_completion_event) = 0; + fxl::Closure rasterizer_continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) = 0; virtual void Teardown( - ftl::AutoResetWaitableEvent* teardown_completion_event) = 0; + fxl::AutoResetWaitableEvent* teardown_completion_event) = 0; virtual void Clear(SkColor color, const SkISize& size) = 0; - virtual ftl::WeakPtr GetWeakRasterizerPtr() = 0; + virtual fxl::WeakPtr GetWeakRasterizerPtr() = 0; virtual flow::LayerTree* GetLastLayerTree() = 0; virtual void Draw( - ftl::RefPtr> pipeline) = 0; + fxl::RefPtr> pipeline) = 0; // Set a callback to be called once when the next frame is drawn. - virtual void AddNextFrameCallback(ftl::Closure nextFrameCallback) = 0; + virtual void AddNextFrameCallback(fxl::Closure nextFrameCallback) = 0; }; } // namespace shell diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 8f51d3db4240a..f4a256c182307 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -21,7 +21,7 @@ #include "flutter/shell/common/platform_view_service_protocol.h" #include "flutter/shell/common/skia_event_tracer_impl.h" #include "flutter/shell/common/switches.h" -#include "lib/ftl/files/unique_fd.h" +#include "lib/fxl/files/unique_fd.h" #include "third_party/skia/include/core/SkGraphics.h" namespace shell { @@ -29,7 +29,7 @@ namespace { static Shell* g_shell = nullptr; -bool IsInvalid(const ftl::WeakPtr& rasterizer) { +bool IsInvalid(const fxl::WeakPtr& rasterizer) { return !rasterizer; } @@ -38,7 +38,7 @@ bool IsViewInvalid(const std::weak_ptr& platform_view) { } template -bool GetSwitchValue(const ftl::CommandLine& command_line, +bool GetSwitchValue(const fxl::CommandLine& command_line, Switch sw, T* result) { std::string switch_string; @@ -67,9 +67,9 @@ void ServiceIsolateHook(bool running_precompiled) { } // namespace -Shell::Shell(ftl::CommandLine command_line) +Shell::Shell(fxl::CommandLine command_line) : command_line_(std::move(command_line)) { - FTL_DCHECK(!g_shell); + FXL_DCHECK(!g_shell); gpu_thread_.reset(new fml::Thread("gpu_thread")); ui_thread_.reset(new fml::Thread("ui_thread")); @@ -94,7 +94,7 @@ Shell::Shell(ftl::CommandLine command_line) Shell::~Shell() {} -void Shell::InitStandalone(ftl::CommandLine command_line, +void Shell::InitStandalone(fxl::CommandLine command_line, std::string icu_data_path, std::string application_library_path) { TRACE_EVENT0("flutter", "Shell::InitStandalone"); @@ -114,7 +114,7 @@ void Shell::InitStandalone(ftl::CommandLine command_line, if (command_line.HasOption(FlagForSwitch(Switch::DeviceObservatoryPort))) { if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort, &settings.observatory_port)) { - FTL_LOG(INFO) + FXL_LOG(INFO) << "Observatory port specified was malformed. Will default to " << settings.observatory_port; } @@ -130,7 +130,7 @@ void Shell::InitStandalone(ftl::CommandLine command_line, if (command_line.HasOption(FlagForSwitch(Switch::DeviceDiagnosticPort))) { if (!GetSwitchValue(command_line, Switch::DeviceDiagnosticPort, &settings.diagnostic_port)) { - FTL_LOG(INFO) + FXL_LOG(INFO) << "Diagnostic port specified was malformed. Will default to " << settings.diagnostic_port; } @@ -194,22 +194,22 @@ void Shell::InitStandalone(ftl::CommandLine command_line, Init(std::move(command_line)); } -void Shell::Init(ftl::CommandLine command_line) { +void Shell::Init(fxl::CommandLine command_line) { #if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE InitSkiaEventTracer(); #endif - FTL_DCHECK(!g_shell); + FXL_DCHECK(!g_shell); g_shell = new Shell(std::move(command_line)); blink::Threads::UI()->PostTask(Engine::Init); } Shell& Shell::Shared() { - FTL_DCHECK(g_shell); + FXL_DCHECK(g_shell); return *g_shell; } -const ftl::CommandLine& Shell::GetCommandLine() const { +const fxl::CommandLine& Shell::GetCommandLine() const { return command_line_; } @@ -218,29 +218,29 @@ TracingController& Shell::tracing_controller() { } void Shell::InitGpuThread() { - gpu_thread_checker_.reset(new ftl::ThreadChecker()); + gpu_thread_checker_.reset(new fxl::ThreadChecker()); } void Shell::InitUIThread() { - ui_thread_checker_.reset(new ftl::ThreadChecker()); + ui_thread_checker_.reset(new fxl::ThreadChecker()); } -void Shell::AddRasterizer(const ftl::WeakPtr& rasterizer) { - FTL_DCHECK(gpu_thread_checker_ && +void Shell::AddRasterizer(const fxl::WeakPtr& rasterizer) { + FXL_DCHECK(gpu_thread_checker_ && gpu_thread_checker_->IsCreationThreadCurrent()); rasterizers_.push_back(rasterizer); } void Shell::PurgeRasterizers() { - FTL_DCHECK(gpu_thread_checker_ && + FXL_DCHECK(gpu_thread_checker_ && gpu_thread_checker_->IsCreationThreadCurrent()); rasterizers_.erase( std::remove_if(rasterizers_.begin(), rasterizers_.end(), IsInvalid), rasterizers_.end()); } -void Shell::GetRasterizers(std::vector>* rasterizers) { - FTL_DCHECK(gpu_thread_checker_ && +void Shell::GetRasterizers(std::vector>* rasterizers) { + FXL_DCHECK(gpu_thread_checker_ && gpu_thread_checker_->IsCreationThreadCurrent()); *rasterizers = rasterizers_; } @@ -290,12 +290,12 @@ void Shell::RunInPlatformView(uintptr_t view_id, bool* view_existed, int64_t* dart_isolate_id, std::string* isolate_name) { - ftl::AutoResetWaitableEvent latch; - FTL_DCHECK(view_id != 0); - FTL_DCHECK(main_script); - FTL_DCHECK(packages_file); - FTL_DCHECK(asset_directory); - FTL_DCHECK(view_existed); + fxl::AutoResetWaitableEvent latch; + FXL_DCHECK(view_id != 0); + FXL_DCHECK(main_script); + FXL_DCHECK(packages_file); + FXL_DCHECK(asset_directory); + FXL_DCHECK(view_existed); blink::Threads::UI()->PostTask([this, view_id, main_script, packages_file, asset_directory, view_existed, @@ -314,8 +314,8 @@ void Shell::RunInPlatformViewUIThread(uintptr_t view_id, bool* view_existed, int64_t* dart_isolate_id, std::string* isolate_name, - ftl::AutoResetWaitableEvent* latch) { - FTL_DCHECK(ui_thread_checker_ && + fxl::AutoResetWaitableEvent* latch) { + FXL_DCHECK(ui_thread_checker_ && ui_thread_checker_->IsCreationThreadCurrent()); *view_existed = false; diff --git a/shell/common/shell.h b/shell/common/shell.h index 73ffd0e487b9e..b5b664365f65b 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -7,13 +7,13 @@ #include "flutter/fml/thread.h" #include "flutter/shell/common/tracing_controller.h" -#include "lib/ftl/command_line.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/ref_ptr.h" -#include "lib/ftl/memory/weak_ptr.h" -#include "lib/ftl/synchronization/thread_checker.h" -#include "lib/ftl/synchronization/waitable_event.h" -#include "lib/ftl/tasks/task_runner.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_ptr.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/synchronization/thread_checker.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "lib/fxl/tasks/task_runner.h" #include @@ -26,21 +26,21 @@ class Shell { public: ~Shell(); - static void InitStandalone(ftl::CommandLine command_line, + static void InitStandalone(fxl::CommandLine command_line, std::string icu_data_path = "", std::string application_library_path = ""); static Shell& Shared(); - const ftl::CommandLine& GetCommandLine() const; + const fxl::CommandLine& GetCommandLine() const; TracingController& tracing_controller(); // Maintain a list of rasterizers. // These APIs must only be accessed on the GPU thread. - void AddRasterizer(const ftl::WeakPtr& rasterizer); + void AddRasterizer(const fxl::WeakPtr& rasterizer); void PurgeRasterizers(); - void GetRasterizers(std::vector>* rasterizer); + void GetRasterizers(std::vector>* rasterizer); // List of PlatformViews. @@ -71,9 +71,9 @@ class Shell { std::string* isolate_name); private: - static void Init(ftl::CommandLine command_line); + static void Init(fxl::CommandLine command_line); - Shell(ftl::CommandLine command_line); + Shell(fxl::CommandLine command_line); void InitGpuThread(); void InitUIThread(); @@ -85,25 +85,25 @@ class Shell { bool* view_existed, int64_t* dart_isolate_id, std::string* isolate_name, - ftl::AutoResetWaitableEvent* latch); + fxl::AutoResetWaitableEvent* latch); - ftl::CommandLine command_line_; + fxl::CommandLine command_line_; std::unique_ptr gpu_thread_; std::unique_ptr ui_thread_; std::unique_ptr io_thread_; - std::unique_ptr gpu_thread_checker_; - std::unique_ptr ui_thread_checker_; + std::unique_ptr gpu_thread_checker_; + std::unique_ptr ui_thread_checker_; TracingController tracing_controller_; - std::vector> rasterizers_; + std::vector> rasterizers_; std::vector> platform_views_; std::mutex platform_views_mutex_; - FTL_DISALLOW_COPY_AND_ASSIGN(Shell); + FXL_DISALLOW_COPY_AND_ASSIGN(Shell); }; } // namespace shell diff --git a/shell/common/skia_event_tracer_impl.cc b/shell/common/skia_event_tracer_impl.cc index b8ba5d01724f1..4bb577c7fbd29 100644 --- a/shell/common/skia_event_tracer_impl.cc +++ b/shell/common/skia_event_tracer_impl.cc @@ -9,7 +9,7 @@ #include -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "third_party/skia/include/utils/SkEventTracer.h" #include "third_party/skia/src/core/SkTraceEventCommon.h" @@ -72,7 +72,7 @@ class FlutterEventTracer : public SkEventTracer { } private: - FTL_DISALLOW_COPY_AND_ASSIGN(FlutterEventTracer); + FXL_DISALLOW_COPY_AND_ASSIGN(FlutterEventTracer); }; } // namespace skia diff --git a/shell/common/surface.cc b/shell/common/surface.cc index 188b8b9b08898..a9153ebab008b 100644 --- a/shell/common/surface.cc +++ b/shell/common/surface.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "flutter/shell/common/surface.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkSurface.h" namespace shell { @@ -11,7 +11,7 @@ namespace shell { SurfaceFrame::SurfaceFrame(sk_sp surface, SubmitCallback submit_callback) : submitted_(false), surface_(surface), submit_callback_(submit_callback) { - FTL_DCHECK(submit_callback_); + FXL_DCHECK(submit_callback_); } SurfaceFrame::~SurfaceFrame() { diff --git a/shell/common/surface.h b/shell/common/surface.h index 95932b7929606..4d9b33b7338fd 100644 --- a/shell/common/surface.h +++ b/shell/common/surface.h @@ -7,8 +7,8 @@ #include -#include "lib/ftl/compiler_specific.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" namespace shell { @@ -37,7 +37,7 @@ class SurfaceFrame { bool PerformSubmit(); - FTL_DISALLOW_COPY_AND_ASSIGN(SurfaceFrame); + FXL_DISALLOW_COPY_AND_ASSIGN(SurfaceFrame); }; class Surface { diff --git a/shell/common/switches.cc b/shell/common/switches.cc index 6ea1bb3dbc986..68a4f7b0a0824 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -7,7 +7,7 @@ #include #include -#include "lib/ftl/strings/string_view.h" +#include "lib/fxl/strings/string_view.h" // Include once for the default enum definition. #include "flutter/shell/common/switches.h" @@ -16,7 +16,7 @@ struct SwitchDesc { shell::Switch sw; - const ftl::StringView flag; + const fxl::StringView flag; const char* help; }; @@ -80,13 +80,13 @@ void PrintUsage(const std::string& executable_name) { std::cerr << std::string(column_width, '-') << std::endl; } -const ftl::StringView FlagForSwitch(Switch swtch) { +const fxl::StringView FlagForSwitch(Switch swtch) { for (uint32_t i = 0; i < static_cast(Switch::Sentinel); i++) { if (gSwitchDescs[i].sw == swtch) { return gSwitchDescs[i].flag; } } - return ftl::StringView(); + return fxl::StringView(); } } // namespace shell diff --git a/shell/common/switches.h b/shell/common/switches.h index 39dc174861625..16a4632baa433 100644 --- a/shell/common/switches.h +++ b/shell/common/switches.h @@ -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/ftl/strings/string_view.h" +#include "lib/fxl/strings/string_view.h" #ifndef SHELL_COMMON_SWITCHES_H_ #define SHELL_COMMON_SWITCHES_H_ @@ -106,7 +106,7 @@ DEF_SWITCHES_END void PrintUsage(const std::string& executable_name); -const ftl::StringView FlagForSwitch(Switch sw); +const fxl::StringView FlagForSwitch(Switch sw); } // namespace shell diff --git a/shell/common/tracing_controller.cc b/shell/common/tracing_controller.cc index 85cdb0d421c96..0a78f7c1f3d5a 100644 --- a/shell/common/tracing_controller.cc +++ b/shell/common/tracing_controller.cc @@ -11,7 +11,7 @@ #include "flutter/fml/trace_event.h" #include "flutter/runtime/dart_init.h" #include "flutter/shell/common/shell.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace shell { diff --git a/shell/common/tracing_controller.h b/shell/common/tracing_controller.h index 86eed1691afbc..3f9e6f03ab14c 100644 --- a/shell/common/tracing_controller.h +++ b/shell/common/tracing_controller.h @@ -7,7 +7,7 @@ #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace shell { @@ -26,7 +26,7 @@ class TracingController { private: bool tracing_active_; - FTL_DISALLOW_COPY_AND_ASSIGN(TracingController); + FXL_DISALLOW_COPY_AND_ASSIGN(TracingController); }; } // namespace shell diff --git a/shell/common/vsync_waiter.h b/shell/common/vsync_waiter.h index ccd59d3cf2fa4..77319ed8b6966 100644 --- a/shell/common/vsync_waiter.h +++ b/shell/common/vsync_waiter.h @@ -7,14 +7,14 @@ #include -#include "lib/ftl/time/time_point.h" +#include "lib/fxl/time/time_point.h" namespace shell { class VsyncWaiter { public: - using Callback = std::function; + using Callback = std::function; virtual void AsyncWaitForVsync(Callback callback) = 0; diff --git a/shell/common/vsync_waiter_fallback.cc b/shell/common/vsync_waiter_fallback.cc index 3e9d9a737b801..d5338cb9e3416 100644 --- a/shell/common/vsync_waiter_fallback.cc +++ b/shell/common/vsync_waiter_fallback.cc @@ -4,17 +4,17 @@ #include "flutter/shell/common/vsync_waiter_fallback.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "flutter/common/threads.h" namespace shell { namespace { -ftl::TimePoint SnapToNextTick(ftl::TimePoint value, - ftl::TimePoint tick_phase, - ftl::TimeDelta tick_interval) { - ftl::TimeDelta offset = (tick_phase - value) % tick_interval; - if (offset != ftl::TimeDelta::Zero()) +fxl::TimePoint SnapToNextTick(fxl::TimePoint value, + fxl::TimePoint tick_phase, + fxl::TimeDelta tick_interval) { + fxl::TimeDelta offset = (tick_phase - value) % tick_interval; + if (offset != fxl::TimeDelta::Zero()) offset = offset + tick_interval; return value + offset; } @@ -22,24 +22,24 @@ ftl::TimePoint SnapToNextTick(ftl::TimePoint value, } // namespace VsyncWaiterFallback::VsyncWaiterFallback() - : phase_(ftl::TimePoint::Now()), weak_factory_(this) {} + : phase_(fxl::TimePoint::Now()), weak_factory_(this) {} VsyncWaiterFallback::~VsyncWaiterFallback() = default; -constexpr ftl::TimeDelta interval = ftl::TimeDelta::FromSecondsF(1.0 / 60.0); +constexpr fxl::TimeDelta interval = fxl::TimeDelta::FromSecondsF(1.0 / 60.0); void VsyncWaiterFallback::AsyncWaitForVsync(Callback callback) { - FTL_DCHECK(!callback_); + FXL_DCHECK(!callback_); callback_ = std::move(callback); - ftl::TimePoint now = ftl::TimePoint::Now(); - ftl::TimePoint next = SnapToNextTick(now, phase_, interval); + fxl::TimePoint now = fxl::TimePoint::Now(); + fxl::TimePoint next = SnapToNextTick(now, phase_, interval); blink::Threads::UI()->PostDelayedTask( [self = weak_factory_.GetWeakPtr()] { if (!self) return; - ftl::TimePoint frame_time = ftl::TimePoint::Now(); + fxl::TimePoint frame_time = fxl::TimePoint::Now(); Callback callback = std::move(self->callback_); self->callback_ = Callback(); callback(frame_time, frame_time + interval); diff --git a/shell/common/vsync_waiter_fallback.h b/shell/common/vsync_waiter_fallback.h index d9978c2ee3916..345c328553b65 100644 --- a/shell/common/vsync_waiter_fallback.h +++ b/shell/common/vsync_waiter_fallback.h @@ -6,9 +6,9 @@ #define FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ #include "flutter/shell/common/vsync_waiter.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" -#include "lib/ftl/time/time_point.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/time/time_point.h" namespace shell { @@ -20,12 +20,12 @@ class VsyncWaiterFallback : public VsyncWaiter { void AsyncWaitForVsync(Callback callback) override; private: - ftl::TimePoint phase_; + fxl::TimePoint phase_; Callback callback_; - ftl::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; - FTL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterFallback); + FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterFallback); }; } // namespace shell diff --git a/shell/gpu/gpu_rasterizer.cc b/shell/gpu/gpu_rasterizer.cc index edc16d4976b3a..80b51ae2a06bc 100644 --- a/shell/gpu/gpu_rasterizer.cc +++ b/shell/gpu/gpu_rasterizer.cc @@ -28,13 +28,13 @@ GPURasterizer::~GPURasterizer() { Shell::Shared().PurgeRasterizers(); } -ftl::WeakPtr GPURasterizer::GetWeakRasterizerPtr() { +fxl::WeakPtr GPURasterizer::GetWeakRasterizerPtr() { return weak_factory_.GetWeakPtr(); } void GPURasterizer::Setup(std::unique_ptr surface, - ftl::Closure continuation, - ftl::AutoResetWaitableEvent* setup_completion_event) { + fxl::Closure continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) { surface_ = std::move(surface); continuation(); @@ -65,7 +65,7 @@ void GPURasterizer::Clear(SkColor color, const SkISize& size) { } void GPURasterizer::Teardown( - ftl::AutoResetWaitableEvent* teardown_completion_event) { + fxl::AutoResetWaitableEvent* teardown_completion_event) { if (surface_) { surface_.reset(); } @@ -79,7 +79,7 @@ flow::LayerTree* GPURasterizer::GetLastLayerTree() { } void GPURasterizer::Draw( - ftl::RefPtr> pipeline) { + fxl::RefPtr> pipeline) { TRACE_EVENT0("flutter", "GPURasterizer::Draw"); flutter::Pipeline::Consumer consumer = @@ -142,7 +142,7 @@ void GPURasterizer::DrawToSurface(flow::LayerTree& layer_tree) { frame->Submit(); } -void GPURasterizer::AddNextFrameCallback(ftl::Closure nextFrameCallback) { +void GPURasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { nextFrameCallback_ = nextFrameCallback; } diff --git a/shell/gpu/gpu_rasterizer.h b/shell/gpu/gpu_rasterizer.h index 722e6175701d2..61942e003c59e 100644 --- a/shell/gpu/gpu_rasterizer.h +++ b/shell/gpu/gpu_rasterizer.h @@ -7,8 +7,8 @@ #include "flutter/flow/compositor_context.h" #include "flutter/shell/common/rasterizer.h" -#include "lib/ftl/memory/weak_ptr.h" -#include "lib/ftl/synchronization/waitable_event.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/synchronization/waitable_event.h" namespace shell { @@ -21,22 +21,22 @@ class GPURasterizer : public Rasterizer { ~GPURasterizer() override; void Setup(std::unique_ptr surface, - ftl::Closure continuation, - ftl::AutoResetWaitableEvent* setup_completion_event) override; + fxl::Closure continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) override; void Clear(SkColor color, const SkISize& size) override; void Teardown( - ftl::AutoResetWaitableEvent* teardown_completion_event) override; + fxl::AutoResetWaitableEvent* teardown_completion_event) override; - ftl::WeakPtr GetWeakRasterizerPtr() override; + fxl::WeakPtr GetWeakRasterizerPtr() override; flow::LayerTree* GetLastLayerTree() override; - void Draw(ftl::RefPtr> pipeline) override; + void Draw(fxl::RefPtr> pipeline) override; // Set a callback to be called once when the next frame is drawn. - void AddNextFrameCallback(ftl::Closure nextFrameCallback) override; + void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; private: std::unique_ptr surface_; @@ -45,8 +45,8 @@ class GPURasterizer : public Rasterizer { // A closure to be called when the underlaying surface presents a frame the // next time. NULL if there is no callback or the callback was set back to // NULL after being called. - ftl::Closure nextFrameCallback_; - ftl::WeakPtrFactory weak_factory_; + fxl::Closure nextFrameCallback_; + fxl::WeakPtrFactory weak_factory_; void DoDraw(std::unique_ptr layer_tree); @@ -54,7 +54,7 @@ class GPURasterizer : public Rasterizer { void NotifyNextFrameOnce(); - FTL_DISALLOW_COPY_AND_ASSIGN(GPURasterizer); + FXL_DISALLOW_COPY_AND_ASSIGN(GPURasterizer); }; } // namespace shell diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 7e357a50f8fbe..66409e8a8d01c 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -5,8 +5,8 @@ #include "gpu_surface_gl.h" #include "flutter/glue/trace_event.h" -#include "lib/ftl/arraysize.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/arraysize.h" +#include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkColorFilter.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" @@ -25,7 +25,7 @@ static const size_t kGrCacheMaxByteSize = 512 * (1 << 20); GPUSurfaceGL::GPUSurfaceGL(GPUSurfaceGLDelegate* delegate) : delegate_(delegate), weak_factory_(this) { if (!delegate_->GLContextMakeCurrent()) { - FTL_LOG(ERROR) + FXL_LOG(ERROR) << "Could not make the context current to setup the gr context."; return; } @@ -40,7 +40,7 @@ GPUSurfaceGL::GPUSurfaceGL(GPUSurfaceGLDelegate* delegate) GrContext::Create(kOpenGL_GrBackend, backend_context, options)); if (context == nullptr) { - FTL_LOG(ERROR) << "Failed to setup Skia Gr context."; + FXL_LOG(ERROR) << "Failed to setup Skia Gr context."; return; } @@ -59,7 +59,7 @@ GPUSurfaceGL::~GPUSurfaceGL() { } if (!delegate_->GLContextMakeCurrent()) { - FTL_LOG(ERROR) << "Could not make the context current to destroy the " + FXL_LOG(ERROR) << "Could not make the context current to destroy the " "GrContext resources."; return; } @@ -159,7 +159,7 @@ bool GPUSurfaceGL::CreateOrUpdateSurfaces(const SkISize& size) { offscreen_surface_ = nullptr; if (size.isEmpty()) { - FTL_LOG(ERROR) << "Cannot create surfaces of empty size."; + FXL_LOG(ERROR) << "Cannot create surfaces of empty size."; return false; } @@ -173,7 +173,7 @@ bool GPUSurfaceGL::CreateOrUpdateSurfaces(const SkISize& size) { if (onscreen_surface == nullptr) { // If the onscreen surface could not be wrapped. There is absolutely no // point in moving forward. - FTL_LOG(ERROR) << "Could not wrap onscreen surface."; + FXL_LOG(ERROR) << "Could not wrap onscreen surface."; return false; } @@ -186,7 +186,7 @@ bool GPUSurfaceGL::CreateOrUpdateSurfaces(const SkISize& size) { static bool warned_once = false; if (!warned_once) { warned_once = true; - FTL_LOG(ERROR) << "WARNING: Could not create offscreen surface. This " + FXL_LOG(ERROR) << "WARNING: Could not create offscreen surface. This " "device or emulator does not support " "color correct rendering. Fallbacks are in effect. " "Colors on this device will differ from those " @@ -208,7 +208,7 @@ std::unique_ptr GPUSurfaceGL::AcquireFrame(const SkISize& size) { } if (!delegate_->GLContextMakeCurrent()) { - FTL_LOG(ERROR) + FXL_LOG(ERROR) << "Could not make the context current to acquire the frame."; return nullptr; } diff --git a/shell/gpu/gpu_surface_gl.h b/shell/gpu/gpu_surface_gl.h index 71280eebaf217..d3b6a9bf5f2f6 100644 --- a/shell/gpu/gpu_surface_gl.h +++ b/shell/gpu/gpu_surface_gl.h @@ -7,8 +7,8 @@ #include "flutter/shell/common/surface.h" #include "flutter/synchronization/debug_thread_checker.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/gpu/GrContext.h" namespace shell { @@ -44,7 +44,7 @@ class GPUSurfaceGL : public Surface { sk_sp onscreen_surface_; sk_sp offscreen_surface_; bool valid_ = false; - ftl::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; bool CreateOrUpdateSurfaces(const SkISize& size); @@ -54,7 +54,7 @@ class GPUSurfaceGL : public Surface { bool SelectPixelConfig(GrPixelConfig* config); - FTL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceGL); + FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceGL); }; } // namespace shell diff --git a/shell/gpu/gpu_surface_software.cc b/shell/gpu/gpu_surface_software.cc index 7f7cf7a25519c..e340e605652dd 100644 --- a/shell/gpu/gpu_surface_software.cc +++ b/shell/gpu/gpu_surface_software.cc @@ -5,7 +5,7 @@ #include "flutter/shell/gpu/gpu_surface_software.h" #include -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace shell { diff --git a/shell/gpu/gpu_surface_software.h b/shell/gpu/gpu_surface_software.h index e9d682d4b0acf..557742558efb1 100644 --- a/shell/gpu/gpu_surface_software.h +++ b/shell/gpu/gpu_surface_software.h @@ -6,8 +6,8 @@ #define FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ #include "flutter/shell/common/surface.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkSurface.h" namespace shell { @@ -35,9 +35,9 @@ class GPUSurfaceSoftware : public Surface { private: GPUSurfaceSoftwareDelegate* delegate_; - ftl::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; - FTL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceSoftware); + FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceSoftware); }; } // namespace shell diff --git a/shell/gpu/gpu_surface_vulkan.cc b/shell/gpu/gpu_surface_vulkan.cc index f685a586220c4..5787469d4e44b 100644 --- a/shell/gpu/gpu_surface_vulkan.cc +++ b/shell/gpu/gpu_surface_vulkan.cc @@ -3,12 +3,12 @@ // found in the LICENSE file. #include "flutter/shell/gpu/gpu_surface_vulkan.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace shell { GPUSurfaceVulkan::GPUSurfaceVulkan( - ftl::RefPtr proc_table, + fxl::RefPtr proc_table, std::unique_ptr native_surface) : window_(std::move(proc_table), std::move(native_surface)), weak_factory_(this) {} diff --git a/shell/gpu/gpu_surface_vulkan.h b/shell/gpu/gpu_surface_vulkan.h index fd71c3b734284..d88dbdee34d07 100644 --- a/shell/gpu/gpu_surface_vulkan.h +++ b/shell/gpu/gpu_surface_vulkan.h @@ -9,14 +9,14 @@ #include "flutter/shell/common/surface.h" #include "flutter/vulkan/vulkan_native_surface.h" #include "flutter/vulkan/vulkan_window.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" namespace shell { class GPUSurfaceVulkan : public Surface { public: - GPUSurfaceVulkan(ftl::RefPtr proc_table, + GPUSurfaceVulkan(fxl::RefPtr proc_table, std::unique_ptr native_surface); ~GPUSurfaceVulkan() override; @@ -29,9 +29,9 @@ class GPUSurfaceVulkan : public Surface { private: vulkan::VulkanWindow window_; - ftl::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; - FTL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceVulkan); + FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceVulkan); }; } // namespace shell diff --git a/shell/platform/android/android_context_gl.cc b/shell/platform/android/android_context_gl.cc index a8e14c87fc7a6..ce6642a52f9a2 100644 --- a/shell/platform/android/android_context_gl.cc +++ b/shell/platform/android/android_context_gl.cc @@ -54,13 +54,13 @@ static void LogLastEGLError() { for (size_t i = 0; i < count; i++) { if (last_error == pairs[i].code) { - FTL_LOG(ERROR) << "EGL Error: " << pairs[i].name << " (" << pairs[i].code + FXL_LOG(ERROR) << "EGL Error: " << pairs[i].name << " (" << pairs[i].code << ")"; return; } } - FTL_LOG(ERROR) << "Unknown EGL Error"; + FXL_LOG(ERROR) << "Unknown EGL Error"; } static EGLResult CreateContext(EGLDisplay display, @@ -121,7 +121,7 @@ static bool TeardownSurface(EGLDisplay display, EGLSurface surface) { // For onscreen rendering. bool AndroidContextGL::CreateWindowSurface( - ftl::RefPtr window) { + fxl::RefPtr window) { // The configurations are only required when dealing with extensions or VG. // We do neither. @@ -175,7 +175,7 @@ bool AndroidContextGL::CreatePBufferSurface() { return surface_ != EGL_NO_SURFACE; } -AndroidContextGL::AndroidContextGL(ftl::RefPtr env, +AndroidContextGL::AndroidContextGL(fxl::RefPtr env, PlatformView::SurfaceConfig config, const AndroidContextGL* share_context) : environment_(env), @@ -196,7 +196,7 @@ AndroidContextGL::AndroidContextGL(ftl::RefPtr env, ChooseEGLConfiguration(environment_->Display(), config); if (!success) { - FTL_LOG(ERROR) << "Could not choose an EGL configuration."; + FXL_LOG(ERROR) << "Could not choose an EGL configuration."; LogLastEGLError(); return; } @@ -208,7 +208,7 @@ AndroidContextGL::AndroidContextGL(ftl::RefPtr env, share_context != nullptr ? share_context->context_ : EGL_NO_CONTEXT); if (!success) { - FTL_LOG(ERROR) << "Could not create an EGL context"; + FXL_LOG(ERROR) << "Could not create an EGL context"; LogLastEGLError(); return; } @@ -220,7 +220,7 @@ AndroidContextGL::AndroidContextGL(ftl::RefPtr env, srgb_support_ = strstr(exts, "EGL_KHR_gl_colorspace"); if (!this->CreatePBufferSurface()) { - FTL_LOG(ERROR) << "Could not create the EGL surface."; + FXL_LOG(ERROR) << "Could not create the EGL surface."; LogLastEGLError(); return; } @@ -231,17 +231,17 @@ AndroidContextGL::AndroidContextGL(ftl::RefPtr env, AndroidContextGL::~AndroidContextGL() { if (!TeardownContext(environment_->Display(), context_)) { - FTL_LOG(ERROR) << "Could not tear down the EGL context. Possible resource leak."; + FXL_LOG(ERROR) << "Could not tear down the EGL context. Possible resource leak."; LogLastEGLError(); } if (!TeardownSurface(environment_->Display(), surface_)) { - FTL_LOG(ERROR) << "Could not tear down the EGL surface. Possible resource leak."; + FXL_LOG(ERROR) << "Could not tear down the EGL surface. Possible resource leak."; LogLastEGLError(); } } -ftl::RefPtr AndroidContextGL::Environment() const { +fxl::RefPtr AndroidContextGL::Environment() const { return environment_; } @@ -252,7 +252,7 @@ bool AndroidContextGL::IsValid() const { bool AndroidContextGL::MakeCurrent() { if (eglMakeCurrent(environment_->Display(), surface_, surface_, context_) != EGL_TRUE) { - FTL_LOG(ERROR) << "Could not make the context current"; + FXL_LOG(ERROR) << "Could not make the context current"; LogLastEGLError(); return false; } @@ -262,7 +262,7 @@ bool AndroidContextGL::MakeCurrent() { bool AndroidContextGL::ClearCurrent() { if (eglMakeCurrent(environment_->Display(), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) != EGL_TRUE) { - FTL_LOG(ERROR) << "Could not clear the current context"; + FXL_LOG(ERROR) << "Could not clear the current context"; LogLastEGLError(); return false; } @@ -281,7 +281,7 @@ SkISize AndroidContextGL::GetSize() { if (!eglQuerySurface(environment_->Display(), surface_, EGL_WIDTH, &width) || !eglQuerySurface(environment_->Display(), surface_, EGL_HEIGHT, &height)) { - FTL_LOG(ERROR) << "Unable to query EGL surface size"; + FXL_LOG(ERROR) << "Unable to query EGL surface size"; LogLastEGLError(); return SkISize::Make(0, 0); } @@ -298,7 +298,7 @@ bool AndroidContextGL::Resize(const SkISize& size) { TeardownSurface(environment_->Display(), surface_); if (!this->CreateWindowSurface(window_)) { - FTL_LOG(ERROR) << "Unable to create EGL window surface on resize."; + FXL_LOG(ERROR) << "Unable to create EGL window surface on resize."; return false; } diff --git a/shell/platform/android/android_context_gl.h b/shell/platform/android/android_context_gl.h index 0cad635a7e145..d9672603e3b84 100644 --- a/shell/platform/android/android_context_gl.h +++ b/shell/platform/android/android_context_gl.h @@ -8,21 +8,21 @@ #include "flutter/shell/common/platform_view.h" #include "flutter/shell/platform/android/android_environment_gl.h" #include "flutter/shell/platform/android/android_native_window.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/ref_counted.h" -#include "lib/ftl/memory/ref_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" #include "third_party/skia/include/core/SkSize.h" namespace shell { -class AndroidContextGL : public ftl::RefCountedThreadSafe { +class AndroidContextGL : public fxl::RefCountedThreadSafe { public: - bool CreateWindowSurface(ftl::RefPtr window); + bool CreateWindowSurface(fxl::RefPtr window); bool CreatePBufferSurface(); - ftl::RefPtr Environment() const; + fxl::RefPtr Environment() const; bool IsValid() const; @@ -39,15 +39,15 @@ class AndroidContextGL : public ftl::RefCountedThreadSafe { bool SupportsSRGB() const; private: - ftl::RefPtr environment_; - ftl::RefPtr window_; + fxl::RefPtr environment_; + fxl::RefPtr window_; EGLConfig config_; EGLSurface surface_; EGLContext context_; bool srgb_support_; bool valid_; - AndroidContextGL(ftl::RefPtr env, + AndroidContextGL(fxl::RefPtr env, PlatformView::SurfaceConfig config, const AndroidContextGL* share_context = nullptr); @@ -55,7 +55,7 @@ class AndroidContextGL : public ftl::RefCountedThreadSafe { FRIEND_MAKE_REF_COUNTED(AndroidContextGL); FRIEND_REF_COUNTED_THREAD_SAFE(AndroidContextGL); - FTL_DISALLOW_COPY_AND_ASSIGN(AndroidContextGL); + FXL_DISALLOW_COPY_AND_ASSIGN(AndroidContextGL); }; } // namespace shell diff --git a/shell/platform/android/android_environment_gl.h b/shell/platform/android/android_environment_gl.h index 3bfdc850c450b..2bf6a0fdc4745 100644 --- a/shell/platform/android/android_environment_gl.h +++ b/shell/platform/android/android_environment_gl.h @@ -5,15 +5,15 @@ #ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_ENVIRONMENT_GL_H_ #define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_ENVIRONMENT_GL_H_ -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/ref_counted.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" #include namespace shell { class AndroidEnvironmentGL - : public ftl::RefCountedThreadSafe { + : public fxl::RefCountedThreadSafe { private: // MakeRefCounted AndroidEnvironmentGL(); @@ -32,7 +32,7 @@ class AndroidEnvironmentGL FRIEND_MAKE_REF_COUNTED(AndroidEnvironmentGL); FRIEND_REF_COUNTED_THREAD_SAFE(AndroidEnvironmentGL); - FTL_DISALLOW_COPY_AND_ASSIGN(AndroidEnvironmentGL); + FXL_DISALLOW_COPY_AND_ASSIGN(AndroidEnvironmentGL); }; } // namespace shell diff --git a/shell/platform/android/android_native_window.h b/shell/platform/android/android_native_window.h index 8b3b4adf20e9a..61dedac88f7fc 100644 --- a/shell/platform/android/android_native_window.h +++ b/shell/platform/android/android_native_window.h @@ -6,15 +6,15 @@ #define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_NATIVE_WINDOW_H_ #include -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/ref_counted.h" -#include "lib/ftl/memory/ref_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" #include "third_party/skia/include/core/SkSize.h" namespace shell { class AndroidNativeWindow - : public ftl::RefCountedThreadSafe { + : public fxl::RefCountedThreadSafe { public: using Handle = ANativeWindow*; @@ -35,7 +35,7 @@ class AndroidNativeWindow FRIEND_MAKE_REF_COUNTED(AndroidNativeWindow); FRIEND_REF_COUNTED_THREAD_SAFE(AndroidNativeWindow); - FTL_DISALLOW_COPY_AND_ASSIGN(AndroidNativeWindow); + FXL_DISALLOW_COPY_AND_ASSIGN(AndroidNativeWindow); }; } // namespace shell diff --git a/shell/platform/android/android_surface.h b/shell/platform/android/android_surface.h index 23218b94d84c4..6d66353c15964 100644 --- a/shell/platform/android/android_surface.h +++ b/shell/platform/android/android_surface.h @@ -12,7 +12,7 @@ #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/surface.h" #include "flutter/shell/platform/android/android_native_window.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkSize.h" namespace shell { @@ -33,7 +33,7 @@ class AndroidSurface { virtual bool ResourceContextMakeCurrent() = 0; - virtual bool SetNativeWindow(ftl::RefPtr window, + virtual bool SetNativeWindow(fxl::RefPtr window, PlatformView::SurfaceConfig config = {}) = 0; virtual void SetFlutterView( diff --git a/shell/platform/android/android_surface_gl.cc b/shell/platform/android/android_surface_gl.cc index 526a9dd8eeb4a..76b2e4ee28d38 100644 --- a/shell/platform/android/android_surface_gl.cc +++ b/shell/platform/android/android_surface_gl.cc @@ -7,23 +7,23 @@ #include #include "flutter/common/threads.h" -#include "lib/ftl/logging.h" -#include "lib/ftl/memory/ref_ptr.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/memory/ref_ptr.h" namespace shell { -static ftl::RefPtr GlobalResourceLoadingContext( +static fxl::RefPtr GlobalResourceLoadingContext( PlatformView::SurfaceConfig offscreen_config) { // AndroidSurfaceGL instances are only ever created on the platform thread. So // there is no need to lock here. - static ftl::RefPtr global_context; + static fxl::RefPtr global_context; if (global_context) { return global_context; } - auto environment = ftl::MakeRefCounted(); + auto environment = fxl::MakeRefCounted(); if (!environment->IsValid()) { return nullptr; @@ -33,7 +33,7 @@ static ftl::RefPtr GlobalResourceLoadingContext( // across multiple invocations. auto context = - ftl::MakeRefCounted(environment, offscreen_config); + fxl::MakeRefCounted(environment, offscreen_config); if (!context->IsValid()) { return nullptr; @@ -64,7 +64,7 @@ bool AndroidSurfaceGL::IsOffscreenContextValid() const { } void AndroidSurfaceGL::TeardownOnScreenContext() { - ftl::AutoResetWaitableEvent latch; + fxl::AutoResetWaitableEvent latch; blink::Threads::Gpu()->PostTask([this, &latch]() { if (IsValid()) { GLContextClearCurrent(); @@ -89,21 +89,21 @@ std::unique_ptr AndroidSurfaceGL::CreateGPUSurface() { } SkISize AndroidSurfaceGL::OnScreenSurfaceSize() const { - FTL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); + FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); return onscreen_context_->GetSize(); } bool AndroidSurfaceGL::OnScreenSurfaceResize(const SkISize& size) const { - FTL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); + FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); return onscreen_context_->Resize(size); } bool AndroidSurfaceGL::ResourceContextMakeCurrent() { - FTL_DCHECK(offscreen_context_ && offscreen_context_->IsValid()); + FXL_DCHECK(offscreen_context_ && offscreen_context_->IsValid()); return offscreen_context_->MakeCurrent(); } -bool AndroidSurfaceGL::SetNativeWindow(ftl::RefPtr window, +bool AndroidSurfaceGL::SetNativeWindow(fxl::RefPtr window, PlatformView::SurfaceConfig config) { // In any case, we want to get rid of our current onscreen context. onscreen_context_ = nullptr; @@ -115,7 +115,7 @@ bool AndroidSurfaceGL::SetNativeWindow(ftl::RefPtr window, } // Create the onscreen context. - onscreen_context_ = ftl::MakeRefCounted( + onscreen_context_ = fxl::MakeRefCounted( offscreen_context_->Environment(), config, offscreen_context_.get() /* sharegroup */); @@ -133,22 +133,22 @@ bool AndroidSurfaceGL::SetNativeWindow(ftl::RefPtr window, } bool AndroidSurfaceGL::GLContextMakeCurrent() { - FTL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); + FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); return onscreen_context_->MakeCurrent(); } bool AndroidSurfaceGL::GLContextClearCurrent() { - FTL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); + FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); return onscreen_context_->ClearCurrent(); } bool AndroidSurfaceGL::GLContextPresent() { - FTL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); + FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); return onscreen_context_->SwapBuffers(); } intptr_t AndroidSurfaceGL::GLContextFBO() const { - FTL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); + FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); // The default window bound framebuffer on Android. return 0; } diff --git a/shell/platform/android/android_surface_gl.h b/shell/platform/android/android_surface_gl.h index 26c57b006eaf6..5abe472948ceb 100644 --- a/shell/platform/android/android_surface_gl.h +++ b/shell/platform/android/android_surface_gl.h @@ -12,7 +12,7 @@ #include "flutter/shell/platform/android/android_context_gl.h" #include "flutter/shell/platform/android/android_environment_gl.h" #include "flutter/shell/platform/android/android_surface.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace shell { @@ -36,7 +36,7 @@ class AndroidSurfaceGL : public GPUSurfaceGLDelegate, public AndroidSurface { bool ResourceContextMakeCurrent() override; - bool SetNativeWindow(ftl::RefPtr window, + bool SetNativeWindow(fxl::RefPtr window, PlatformView::SurfaceConfig config) override; bool GLContextMakeCurrent() override; @@ -53,11 +53,11 @@ class AndroidSurfaceGL : public GPUSurfaceGLDelegate, public AndroidSurface { const fml::jni::JavaObjectWeakGlobalRef& flutter_view) override; private: - ftl::RefPtr onscreen_context_; - ftl::RefPtr offscreen_context_; + fxl::RefPtr onscreen_context_; + fxl::RefPtr offscreen_context_; sk_sp gr_context_; - FTL_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceGL); + FXL_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceGL); }; } // namespace shell diff --git a/shell/platform/android/android_surface_software.cc b/shell/platform/android/android_surface_software.cc index ff823bbbb83a3..5c07aed74ff6c 100644 --- a/shell/platform/android/android_surface_software.cc +++ b/shell/platform/android/android_surface_software.cc @@ -12,7 +12,7 @@ #include #include "flutter/fml/trace_event.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace shell { @@ -137,7 +137,7 @@ bool AndroidSurfaceSoftware::OnScreenSurfaceResize(const SkISize& size) const { } bool AndroidSurfaceSoftware::SetNativeWindow( - ftl::RefPtr window, + fxl::RefPtr window, PlatformView::SurfaceConfig config) { native_window_ = std::move(window); if (!(native_window_ && native_window_->IsValid())) diff --git a/shell/platform/android/android_surface_software.h b/shell/platform/android/android_surface_software.h index 8bc10bab9b304..82e776bcb58de 100644 --- a/shell/platform/android/android_surface_software.h +++ b/shell/platform/android/android_surface_software.h @@ -9,7 +9,7 @@ #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/shell/gpu/gpu_surface_software.h" #include "flutter/shell/platform/android/android_surface.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace shell { @@ -36,7 +36,7 @@ class AndroidSurfaceSoftware : public AndroidSurface, bool OnScreenSurfaceResize(const SkISize& size) const override; - bool SetNativeWindow(ftl::RefPtr window, + bool SetNativeWindow(fxl::RefPtr window, PlatformView::SurfaceConfig config) override; void SetFlutterView( @@ -47,10 +47,10 @@ class AndroidSurfaceSoftware : public AndroidSurface, fml::jni::JavaObjectWeakGlobalRef flutter_view_; - ftl::RefPtr native_window_; + fxl::RefPtr native_window_; SkColorType target_color_type_; - FTL_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceSoftware); + FXL_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceSoftware); }; } // namespace shell diff --git a/shell/platform/android/android_surface_vulkan.cc b/shell/platform/android/android_surface_vulkan.cc index 7d93be83140af..94d1f7e0023b4 100644 --- a/shell/platform/android/android_surface_vulkan.cc +++ b/shell/platform/android/android_surface_vulkan.cc @@ -8,12 +8,12 @@ #include "flutter/shell/gpu/gpu_surface_vulkan.h" #include "flutter/vulkan/vulkan_native_surface_android.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace shell { AndroidSurfaceVulkan::AndroidSurfaceVulkan() - : proc_table_(ftl::MakeRefCounted()) {} + : proc_table_(fxl::MakeRefCounted()) {} AndroidSurfaceVulkan::~AndroidSurfaceVulkan() = default; @@ -68,7 +68,7 @@ void AndroidSurfaceVulkan::SetFlutterView( const fml::jni::JavaObjectWeakGlobalRef& flutter_view) {} bool AndroidSurfaceVulkan::SetNativeWindow( - ftl::RefPtr window, + fxl::RefPtr window, PlatformView::SurfaceConfig config) { native_window_ = std::move(window); return native_window_ && native_window_->IsValid(); diff --git a/shell/platform/android/android_surface_vulkan.h b/shell/platform/android/android_surface_vulkan.h index 444636ca94f16..3959785097e9b 100644 --- a/shell/platform/android/android_surface_vulkan.h +++ b/shell/platform/android/android_surface_vulkan.h @@ -10,7 +10,7 @@ #include "flutter/shell/platform/android/android_native_window.h" #include "flutter/shell/platform/android/android_surface.h" #include "flutter/vulkan/vulkan_window.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace shell { @@ -32,17 +32,17 @@ class AndroidSurfaceVulkan : public AndroidSurface { bool ResourceContextMakeCurrent() override; - bool SetNativeWindow(ftl::RefPtr window, + bool SetNativeWindow(fxl::RefPtr window, PlatformView::SurfaceConfig config) override; void SetFlutterView( const fml::jni::JavaObjectWeakGlobalRef& flutter_view) override; private: - ftl::RefPtr proc_table_; - ftl::RefPtr native_window_; + fxl::RefPtr proc_table_; + fxl::RefPtr native_window_; - FTL_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceVulkan); + FXL_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceVulkan); }; } // namespace shell diff --git a/shell/platform/android/flutter_main.cc b/shell/platform/android/flutter_main.cc index 4d233c1267297..66200380d8b82 100644 --- a/shell/platform/android/flutter_main.cc +++ b/shell/platform/android/flutter_main.cc @@ -10,9 +10,9 @@ #include "flutter/fml/platform/android/jni_util.h" #include "flutter/runtime/start_up.h" #include "flutter/shell/common/shell.h" -#include "lib/ftl/arraysize.h" -#include "lib/ftl/command_line.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/arraysize.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/macros.h" namespace shell { @@ -27,7 +27,7 @@ static void Init(JNIEnv* env, args.push_back(std::move(arg)); } - auto command_line = ftl::CommandLineFromIterators(args.begin(), args.end()); + auto command_line = fxl::CommandLineFromIterators(args.begin(), args.end()); std::string icu_data_path = command_line.GetOptionValueWithDefault("icu-data-file-path", ""); Shell::InitStandalone(std::move(command_line), std::move(icu_data_path)); diff --git a/shell/platform/android/library_loader.cc b/shell/platform/android/library_loader.cc index 7532a9bd8fac2..c51d0114282f6 100644 --- a/shell/platform/android/library_loader.cc +++ b/shell/platform/android/library_loader.cc @@ -17,15 +17,15 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { // Register FlutterMain. result = shell::RegisterFlutterMain(env); - FTL_CHECK(result); + FXL_CHECK(result); // Register PlatformView result = shell::PlatformViewAndroid::Register(env); - FTL_CHECK(result); + FXL_CHECK(result); // Register VSyncWaiter. result = shell::VsyncWaiterAndroid::Register(env); - FTL_CHECK(result); + FXL_CHECK(result); return JNI_VERSION_1_4; } diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 3bc57ca87fbdd..29bd09d748b77 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -21,7 +21,7 @@ #include "flutter/shell/platform/android/android_surface_software.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "flutter/shell/platform/android/vsync_waiter_android.h" -#include "lib/ftl/functional/make_copyable.h" +#include "lib/fxl/functional/make_copyable.h" #if SHELL_ENABLE_VULKAN #include "flutter/shell/platform/android/android_surface_vulkan.h" @@ -34,9 +34,9 @@ class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { public: void Complete(std::vector data) override { - ftl::RefPtr self(this); + fxl::RefPtr self(this); blink::Threads::Platform()->PostTask( - ftl::MakeCopyable([ self, data = std::move(data) ]() mutable { + fxl::MakeCopyable([ self, data = std::move(data) ]() mutable { std::shared_ptr view = self->view_.lock(); if (!view) return; @@ -47,8 +47,8 @@ class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { } void CompleteEmpty() override { - ftl::RefPtr self(this); - blink::Threads::Platform()->PostTask(ftl::MakeCopyable([self]() mutable { + fxl::RefPtr self(this); + blink::Threads::Platform()->PostTask(fxl::MakeCopyable([self]() mutable { std::shared_ptr view = self->view_.lock(); if (!view) return; @@ -96,30 +96,30 @@ static std::unique_ptr InitializePlatformSurfaceSoftware() { static std::unique_ptr InitializePlatformSurface() { if (blink::Settings::Get().enable_software_rendering) { if (auto surface = InitializePlatformSurfaceSoftware()) { - FTL_DLOG(INFO) << "Software surface initialized."; + FXL_DLOG(INFO) << "Software surface initialized."; return surface; } } if (auto surface = InitializePlatformSurfaceVulkan()) { - FTL_DLOG(INFO) << "Vulkan surface initialized."; + FXL_DLOG(INFO) << "Vulkan surface initialized."; return surface; } - FTL_DLOG(INFO) + FXL_DLOG(INFO) << "Could not initialize Vulkan surface. Falling back to OpenGL."; if (auto surface = InitializePlatformSurfaceGL()) { - FTL_DLOG(INFO) << "GL surface initialized."; + FXL_DLOG(INFO) << "GL surface initialized."; return surface; } if (auto surface = InitializePlatformSurfaceSoftware()) { - FTL_DLOG(INFO) << "Software surface initialized."; + FXL_DLOG(INFO) << "Software surface initialized."; return surface; } - FTL_CHECK(false) << "Could not initialize either the Vulkan, OpenGL, or Software" + FXL_CHECK(false) << "Could not initialize either the Vulkan, OpenGL, or Software" "surface backends. Flutter requires a GPU to render."; return nullptr; } @@ -163,7 +163,7 @@ void PlatformViewAndroid::SurfaceCreated(JNIEnv* env, // workaround for https://code.google.com/p/android/issues/detail?id=68174 fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env); - auto native_window = ftl::MakeRefCounted( + auto native_window = fxl::MakeRefCounted( ANativeWindow_fromSurface(env, jsurface)); if (!native_window->IsValid()) { @@ -262,28 +262,28 @@ void PlatformViewAndroid::DispatchPlatformMessage(JNIEnv* env, std::vector message = std::vector(message_data, message_data + java_message_position); - ftl::RefPtr response; + fxl::RefPtr response; if (response_id) { - response = ftl::MakeRefCounted( + response = fxl::MakeRefCounted( response_id, GetWeakPtr()); } PlatformView::DispatchPlatformMessage( - ftl::MakeRefCounted( + fxl::MakeRefCounted( std::move(name), std::move(message), std::move(response))); } void PlatformViewAndroid::DispatchEmptyPlatformMessage(JNIEnv* env, std::string name, jint response_id) { - ftl::RefPtr response; + fxl::RefPtr response; if (response_id) { - response = ftl::MakeRefCounted( + response = fxl::MakeRefCounted( response_id, GetWeakPtr()); } PlatformView::DispatchPlatformMessage( - ftl::MakeRefCounted(std::move(name), + fxl::MakeRefCounted(std::move(name), std::move(response))); } @@ -292,7 +292,7 @@ void PlatformViewAndroid::DispatchPointerDataPacket(JNIEnv* env, jint position) { uint8_t* data = static_cast(env->GetDirectBufferAddress(buffer)); - blink::Threads::UI()->PostTask(ftl::MakeCopyable([ + blink::Threads::UI()->PostTask(fxl::MakeCopyable([ engine = engine_->GetWeakPtr(), packet = std::make_unique(data, position) ] { @@ -334,7 +334,7 @@ void PlatformViewAndroid::InvokePlatformMessageEmptyResponseCallback( } void PlatformViewAndroid::HandlePlatformMessage( - ftl::RefPtr message) { + fxl::RefPtr message) { JNIEnv* env = fml::jni::AttachCurrentThread(); fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); if (view.is_null()) @@ -479,7 +479,7 @@ void PlatformViewAndroid::RunFromSource(const std::string& assets_directory, const std::string& main, const std::string& packages) { JNIEnv* env = fml::jni::AttachCurrentThread(); - FTL_CHECK(env); + FXL_CHECK(env); { fml::jni::ScopedJavaLocalRef local_flutter_view = @@ -491,21 +491,21 @@ void PlatformViewAndroid::RunFromSource(const std::string& assets_directory, // Grab the class of the flutter view. jclass flutter_view_class = env->GetObjectClass(local_flutter_view.obj()); - FTL_CHECK(flutter_view_class); + FXL_CHECK(flutter_view_class); // Grab the runFromSource method id. jmethodID run_from_source_method_id = env->GetMethodID( flutter_view_class, "runFromSource", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); - FTL_CHECK(run_from_source_method_id); + FXL_CHECK(run_from_source_method_id); // Invoke runFromSource on the Android UI thread. jstring java_assets_directory = env->NewStringUTF(assets_directory.c_str()); - FTL_CHECK(java_assets_directory); + FXL_CHECK(java_assets_directory); jstring java_main = env->NewStringUTF(main.c_str()); - FTL_CHECK(java_main); + FXL_CHECK(java_main); jstring java_packages = env->NewStringUTF(packages.c_str()); - FTL_CHECK(java_packages); + FXL_CHECK(java_packages); env->CallVoidMethod(local_flutter_view.obj(), run_from_source_method_id, java_assets_directory, java_main, java_packages); } @@ -518,7 +518,7 @@ fml::jni::ScopedJavaLocalRef PlatformViewAndroid::GetBitmap( JNIEnv* env) { // Render the last frame to an array of pixels on the GPU thread. // The pixels will be returned as a global JNI reference to an int array. - ftl::AutoResetWaitableEvent latch; + fxl::AutoResetWaitableEvent latch; jobject pixels_ref = nullptr; SkISize frame_size; blink::Threads::Gpu()->PostTask([this, &latch, &pixels_ref, &frame_size]() { @@ -535,27 +535,27 @@ fml::jni::ScopedJavaLocalRef PlatformViewAndroid::GetBitmap( fml::jni::ScopedJavaGlobalRef pixels(env, pixels_ref); jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); - FTL_CHECK(bitmap_class); + FXL_CHECK(bitmap_class); jmethodID create_bitmap = env->GetStaticMethodID( bitmap_class, "createBitmap", "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); - FTL_CHECK(create_bitmap); + FXL_CHECK(create_bitmap); jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); - FTL_CHECK(bitmap_config_class); + FXL_CHECK(bitmap_config_class); jmethodID bitmap_config_value_of = env->GetStaticMethodID( bitmap_config_class, "valueOf", "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); - FTL_CHECK(bitmap_config_value_of); + FXL_CHECK(bitmap_config_value_of); jstring argb = env->NewStringUTF("ARGB_8888"); - FTL_CHECK(argb); + FXL_CHECK(argb); jobject bitmap_config = env->CallStaticObjectMethod( bitmap_config_class, bitmap_config_value_of, argb); - FTL_CHECK(bitmap_config); + FXL_CHECK(bitmap_config); jobject bitmap = env->CallStaticObjectMethod( bitmap_class, create_bitmap, pixels.obj(), frame_size.width(), @@ -571,15 +571,15 @@ void PlatformViewAndroid::GetBitmapGpuTask(jobject* pixels_out, return; JNIEnv* env = fml::jni::AttachCurrentThread(); - FTL_CHECK(env); + FXL_CHECK(env); const SkISize& frame_size = layer_tree->frame_size(); jsize pixels_size = frame_size.width() * frame_size.height(); jintArray pixels_array = env->NewIntArray(pixels_size); - FTL_CHECK(pixels_array); + FXL_CHECK(pixels_array); jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); - FTL_CHECK(pixels); + FXL_CHECK(pixels); SkImageInfo image_info = SkImageInfo::Make(frame_size.width(), frame_size.height(), diff --git a/shell/platform/android/platform_view_android.h b/shell/platform/android/platform_view_android.h index ab522b475b3b2..133bfd9c9e0e3 100644 --- a/shell/platform/android/platform_view_android.h +++ b/shell/platform/android/platform_view_android.h @@ -16,7 +16,7 @@ #include "flutter/shell/common/platform_view.h" #include "flutter/shell/platform/android/android_native_window.h" #include "flutter/shell/platform/android/android_surface.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/memory/weak_ptr.h" namespace shell { @@ -86,7 +86,7 @@ class PlatformViewAndroid : public PlatformView { void UpdateSemantics(std::vector update) override; void HandlePlatformMessage( - ftl::RefPtr message) override; + fxl::RefPtr message) override; void HandlePlatformMessageResponse(int response_id, std::vector data); @@ -108,7 +108,7 @@ class PlatformViewAndroid : public PlatformView { fml::jni::JavaObjectWeakGlobalRef flutter_view_; // We use id 0 to mean that no response is expected. int next_response_id_ = 1; - std::unordered_map> + std::unordered_map> pending_responses_; void UpdateThreadPriorities(); @@ -117,7 +117,7 @@ class PlatformViewAndroid : public PlatformView { void GetBitmapGpuTask(jobject* pixels_out, SkISize* size_out); - FTL_DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid); }; } // namespace shell diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index b191eeb2f2b2e..5c0211d0aa4b3 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -8,8 +8,8 @@ #include "flutter/fml/platform/android/jni_weak_ref.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/runtime/dart_service_isolate.h" -#include "lib/ftl/arraysize.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/arraysize.h" +#include "lib/fxl/logging.h" #define PLATFORM_VIEW (*reinterpret_cast*>(platform_view)) @@ -27,7 +27,7 @@ void FlutterViewHandlePlatformMessage(JNIEnv* env, jint responseId) { env->CallVoidMethod(obj, g_handle_platform_message_method, channel, message, responseId); - FTL_CHECK(env->ExceptionCheck() == JNI_FALSE); + FXL_CHECK(env->ExceptionCheck() == JNI_FALSE); } static jmethodID g_handle_platform_message_response_method = nullptr; @@ -37,7 +37,7 @@ void FlutterViewHandlePlatformMessageResponse(JNIEnv* env, jobject response) { env->CallVoidMethod(obj, g_handle_platform_message_response_method, responseId, response); - FTL_CHECK(env->ExceptionCheck() == JNI_FALSE); + FXL_CHECK(env->ExceptionCheck() == JNI_FALSE); } static jmethodID g_update_semantics_method = nullptr; @@ -46,13 +46,13 @@ void FlutterViewUpdateSemantics(JNIEnv* env, jobject buffer, jobjectArray strings) { env->CallVoidMethod(obj, g_update_semantics_method, buffer, strings); - FTL_CHECK(env->ExceptionCheck() == JNI_FALSE); + FXL_CHECK(env->ExceptionCheck() == JNI_FALSE); } static jmethodID g_on_first_frame_method = nullptr; void FlutterViewOnFirstFrame(JNIEnv* env, jobject obj) { env->CallVoidMethod(obj, g_on_first_frame_method); - FTL_CHECK(env->ExceptionCheck() == JNI_FALSE); + FXL_CHECK(env->ExceptionCheck() == JNI_FALSE); } // Called By Java diff --git a/shell/platform/android/platform_view_android_jni.h b/shell/platform/android/platform_view_android_jni.h index 848ffc8a01798..576dd589dd9e1 100644 --- a/shell/platform/android/platform_view_android_jni.h +++ b/shell/platform/android/platform_view_android_jni.h @@ -7,7 +7,7 @@ #include #include "flutter/shell/platform/android/platform_view_android.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace shell { diff --git a/shell/platform/android/vsync_waiter_android.cc b/shell/platform/android/vsync_waiter_android.cc index f9692d954ede5..ab18b4cc75ab9 100644 --- a/shell/platform/android/vsync_waiter_android.cc +++ b/shell/platform/android/vsync_waiter_android.cc @@ -10,8 +10,8 @@ #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" -#include "lib/ftl/arraysize.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/arraysize.h" +#include "lib/fxl/logging.h" namespace shell { @@ -23,10 +23,10 @@ VsyncWaiterAndroid::VsyncWaiterAndroid() : weak_factory_(this) {} VsyncWaiterAndroid::~VsyncWaiterAndroid() = default; void VsyncWaiterAndroid::AsyncWaitForVsync(Callback callback) { - FTL_DCHECK(!callback_); + FXL_DCHECK(!callback_); callback_ = std::move(callback); - ftl::WeakPtr* weak = - new ftl::WeakPtr(); + fxl::WeakPtr* weak = + new fxl::WeakPtr(); *weak = weak_factory_.GetWeakPtr(); blink::Threads::Platform()->PostTask([weak] { @@ -42,10 +42,10 @@ void VsyncWaiterAndroid::OnVsync(int64_t frameTimeNanos, Callback callback = std::move(callback_); callback_ = Callback(); blink::Threads::UI()->PostTask([callback, frameTimeNanos, frameTargetTimeNanos] { - callback(ftl::TimePoint::FromEpochDelta( - ftl::TimeDelta::FromNanoseconds(frameTimeNanos)), - ftl::TimePoint::FromEpochDelta( - ftl::TimeDelta::FromNanoseconds(frameTargetTimeNanos))); + callback(fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTimeNanos)), + fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos))); }); } @@ -60,8 +60,8 @@ static void OnNativeVsync(JNIEnv* env, // 442979b6ec631305275a6/tracing/tracing/extras/vsync/vsync_auditor.html#L26 TRACE_EVENT0("flutter", "VSYNC"); TRACE_EVENT_INSTANT0("flutter", "VSYNC"); - ftl::WeakPtr* weak = - reinterpret_cast*>(cookie); + fxl::WeakPtr* weak = + reinterpret_cast*>(cookie); VsyncWaiterAndroid* waiter = weak->get(); delete weak; if (waiter) { @@ -85,12 +85,12 @@ bool VsyncWaiterAndroid::Register(JNIEnv* env) { g_vsync_waiter_class = new fml::jni::ScopedJavaGlobalRef(env, clazz); - FTL_CHECK(!g_vsync_waiter_class->is_null()); + FXL_CHECK(!g_vsync_waiter_class->is_null()); g_async_wait_for_vsync_method_ = env->GetStaticMethodID( g_vsync_waiter_class->obj(), "asyncWaitForVsync", "(J)V"); - FTL_CHECK(g_async_wait_for_vsync_method_ != nullptr); + FXL_CHECK(g_async_wait_for_vsync_method_ != nullptr); return env->RegisterNatives(clazz, methods, arraysize(methods)) == 0; } diff --git a/shell/platform/android/vsync_waiter_android.h b/shell/platform/android/vsync_waiter_android.h index ef7fa35697bf4..8b272c6b18778 100644 --- a/shell/platform/android/vsync_waiter_android.h +++ b/shell/platform/android/vsync_waiter_android.h @@ -7,8 +7,8 @@ #include #include "flutter/shell/common/vsync_waiter.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" namespace shell { @@ -26,11 +26,11 @@ class VsyncWaiterAndroid : public VsyncWaiter { private: Callback callback_; - ftl::WeakPtr self_; + fxl::WeakPtr self_; - ftl::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; - FTL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterAndroid); + FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterAndroid); }; } // namespace shell diff --git a/shell/platform/darwin/common/process_info_mac.h b/shell/platform/darwin/common/process_info_mac.h index b42e93d12a162..7edc8034173e0 100644 --- a/shell/platform/darwin/common/process_info_mac.h +++ b/shell/platform/darwin/common/process_info_mac.h @@ -9,7 +9,7 @@ #include #include #include "flutter/flow/process_info.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace shell { @@ -28,7 +28,7 @@ class ProcessInfoMac : public flow::ProcessInfo { private: struct mach_task_basic_info last_sample_; - FTL_DISALLOW_COPY_AND_ASSIGN(ProcessInfoMac); + FXL_DISALLOW_COPY_AND_ASSIGN(ProcessInfoMac); }; } // namespace shell diff --git a/shell/platform/darwin/desktop/platform_view_mac.h b/shell/platform/darwin/desktop/platform_view_mac.h index fb3145a8afdda..bf0bd3a955e93 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.h +++ b/shell/platform/darwin/desktop/platform_view_mac.h @@ -8,7 +8,7 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/gpu/gpu_surface_gl.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/memory/weak_ptr.h" @class NSOpenGLView; @class NSOpenGLContext; @@ -53,7 +53,7 @@ class PlatformViewMac : public PlatformView, public GPUSurfaceGLDelegate { const std::string& main, const std::string& packages); - FTL_DISALLOW_COPY_AND_ASSIGN(PlatformViewMac); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewMac); }; } // namespace shell diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.cc b/shell/platform/darwin/desktop/vsync_waiter_mac.cc index b236eee4cab6b..a28ff62edb918 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.cc +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.cc @@ -7,7 +7,7 @@ #include #include "flutter/common/threads.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace shell { @@ -40,10 +40,10 @@ void VsyncWaiterMac::OnDisplayLink(void* context) { } void VsyncWaiterMac::OnDisplayLink() { - ftl::TimePoint frame_start_time = ftl::TimePoint::Now(); - ftl::TimePoint frame_target_time = + fxl::TimePoint frame_start_time = fxl::TimePoint::Now(); + fxl::TimePoint frame_target_time = frame_start_time + - ftl::TimeDelta::FromSecondsF( + fxl::TimeDelta::FromSecondsF( CVDisplayLinkGetActualOutputVideoRefreshPeriod(link_)); CVDisplayLinkStop(link_); @@ -58,7 +58,7 @@ void VsyncWaiterMac::OnDisplayLink() { } void VsyncWaiterMac::AsyncWaitForVsync(Callback callback) { - FTL_DCHECK(!callback_); + FXL_DCHECK(!callback_); callback_ = std::move(callback); CVDisplayLinkStart(link_); } diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.h b/shell/platform/darwin/desktop/vsync_waiter_mac.h index 1e26ea9c5a70a..d7226011c1965 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.h +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_VSYNC_WAITER_MAC_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_VSYNC_WAITER_MAC_H_ -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "flutter/shell/common/vsync_waiter.h" namespace shell { @@ -25,7 +25,7 @@ class VsyncWaiterMac : public VsyncWaiter { static void OnDisplayLink(void* context); void OnDisplayLink(); - FTL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterMac); + FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterMac); }; } // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h index 9a4cff6d16b32..2a914ec87600b 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h @@ -13,7 +13,7 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/lib/ui/semantics/semantics_node.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkMatrix44.h" #include "third_party/skia/include/core/SkRect.h" @@ -62,7 +62,7 @@ class AccessibilityBridge final { PlatformViewIOS* platform_view_; fml::scoped_nsobject> objects_; - FTL_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); + FXL_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); }; } // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h index 0f8e1bebd0536..f2e54dd2c2806 100644 --- a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h +++ b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace shell { diff --git a/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h b/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h index 1fa6b420d82be..51fc4f3e5b324 100644 --- a/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h +++ b/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h @@ -7,7 +7,7 @@ #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include @@ -32,7 +32,7 @@ class TouchMapper { BitSet free_spots_; std::map touch_map_; - FTL_DISALLOW_COPY_AND_ASSIGN(TouchMapper); + FXL_DISALLOW_COPY_AND_ASSIGN(TouchMapper); }; } // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.h b/shell/platform/darwin/ios/framework/Source/platform_message_router.h index 4245a02d9dc1b..423d462b7150d 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.h +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.h @@ -9,7 +9,7 @@ #include "flutter/lib/ui/window/platform_message.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterBinaryMessenger.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/memory/weak_ptr.h" namespace shell { @@ -18,14 +18,14 @@ class PlatformMessageRouter { PlatformMessageRouter(); ~PlatformMessageRouter(); - void HandlePlatformMessage(ftl::RefPtr message); + void HandlePlatformMessage(fxl::RefPtr message); void SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler); private: std::unordered_map message_handlers_; - FTL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageRouter); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageRouter); }; } // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h index 39b608ef00456..6a3362b215667 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h @@ -6,7 +6,7 @@ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ #include "flutter/shell/common/vsync_waiter.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #if __OBJC__ @class VSyncClient; @@ -27,7 +27,7 @@ class VsyncWaiterIOS : public VsyncWaiter { Callback callback_; VSyncClient* client_; - FTL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterIOS); + FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterIOS); }; } // namespace shell diff --git a/shell/platform/darwin/ios/ios_gl_context.h b/shell/platform/darwin/ios/ios_gl_context.h index 52506758d5499..091d9eb82e2ef 100644 --- a/shell/platform/darwin/ios/ios_gl_context.h +++ b/shell/platform/darwin/ios/ios_gl_context.h @@ -12,7 +12,7 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace shell { @@ -52,7 +52,7 @@ class IOSGLContext { sk_sp color_space_; bool valid_; - FTL_DISALLOW_COPY_AND_ASSIGN(IOSGLContext); + FXL_DISALLOW_COPY_AND_ASSIGN(IOSGLContext); }; } // namespace shell diff --git a/shell/platform/darwin/ios/ios_surface.h b/shell/platform/darwin/ios/ios_surface.h index a43cb68b483aa..c164fab15500e 100644 --- a/shell/platform/darwin/ios/ios_surface.h +++ b/shell/platform/darwin/ios/ios_surface.h @@ -7,7 +7,7 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" @class CALayer; @@ -39,7 +39,7 @@ class IOSSurface { PlatformView::SurfaceConfig surface_config_; fml::scoped_nsobject layer_; - FTL_DISALLOW_COPY_AND_ASSIGN(IOSSurface); + FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurface); }; } // namespace shell diff --git a/shell/platform/darwin/ios/ios_surface_gl.h b/shell/platform/darwin/ios/ios_surface_gl.h index 2dc3981c4c085..98f476600b8ff 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.h +++ b/shell/platform/darwin/ios/ios_surface_gl.h @@ -8,7 +8,7 @@ #include "flutter/shell/gpu/gpu_surface_gl.h" #include "flutter/shell/platform/darwin/ios/ios_gl_context.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" @class CAEAGLLayer; @@ -41,7 +41,7 @@ class IOSSurfaceGL : public IOSSurface, public GPUSurfaceGLDelegate { private: IOSGLContext context_; - FTL_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceGL); + FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceGL); }; } // namespace shell diff --git a/shell/platform/darwin/ios/ios_surface_software.h b/shell/platform/darwin/ios/ios_surface_software.h index 2a5cfc1165e4a..7e3f264b28ce6 100644 --- a/shell/platform/darwin/ios/ios_surface_software.h +++ b/shell/platform/darwin/ios/ios_surface_software.h @@ -7,7 +7,7 @@ #include "flutter/shell/gpu/gpu_surface_software.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace shell { @@ -34,7 +34,7 @@ class IOSSurfaceSoftware : public IOSSurface, private: sk_sp sk_surface_; - FTL_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceSoftware); + FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceSoftware); }; } // namespace shell diff --git a/shell/platform/darwin/ios/platform_view_ios.h b/shell/platform/darwin/ios/platform_view_ios.h index 182840f3e0c2a..0c2da60faff46 100644 --- a/shell/platform/darwin/ios/platform_view_ios.h +++ b/shell/platform/darwin/ios/platform_view_ios.h @@ -11,9 +11,9 @@ #include "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h" #include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" -#include "lib/ftl/functional/closure.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" @class CALayer; @class UIView; @@ -28,7 +28,7 @@ class PlatformViewIOS : public PlatformView { void Attach() override; - void Attach(ftl::Closure firstFrameCallback); + void Attach(fxl::Closure firstFrameCallback); void NotifyCreated(); @@ -38,7 +38,7 @@ class PlatformViewIOS : public PlatformView { return platform_message_router_; } - ftl::WeakPtr GetWeakPtr(); + fxl::WeakPtr GetWeakPtr(); void UpdateSurfaceSize(); @@ -47,7 +47,7 @@ class PlatformViewIOS : public PlatformView { bool ResourceContextMakeCurrent() override; void HandlePlatformMessage( - ftl::RefPtr message) override; + fxl::RefPtr message) override; void UpdateSemantics(std::vector update) override; @@ -59,14 +59,14 @@ class PlatformViewIOS : public PlatformView { std::unique_ptr ios_surface_; PlatformMessageRouter platform_message_router_; std::unique_ptr accessibility_bridge_; - ftl::Closure firstFrameCallback_; - ftl::WeakPtrFactory weak_factory_; + fxl::Closure firstFrameCallback_; + fxl::WeakPtrFactory weak_factory_; void SetupAndLoadFromSource(const std::string& assets_directory, const std::string& main, const std::string& packages); - FTL_DISALLOW_COPY_AND_ASSIGN(PlatformViewIOS); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewIOS); }; } // namespace shell diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index 654f84230e34f..5a380558c6959 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -8,7 +8,7 @@ #include #include "flutter/common/threads.h" #include "flutter/shell/platform/embedder/platform_view_embedder.h" -#include "lib/ftl/functional/make_copyable.h" +#include "lib/fxl/functional/make_copyable.h" #define SAFE_ACCESS(pointer, member, default_value) \ ({ \ @@ -51,7 +51,7 @@ class PlatformViewHolder { private: std::shared_ptr platform_view_; - FTL_DISALLOW_COPY_AND_ASSIGN(PlatformViewHolder); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewHolder); }; FlutterResult FlutterEngineRun(size_t version, @@ -102,9 +102,9 @@ FlutterResult FlutterEngineRun(size_t version, static std::once_flag once_shell_initialization; std::call_once(once_shell_initialization, [&]() { - ftl::CommandLine null_command_line; + fxl::CommandLine null_command_line; shell::Shell::InitStandalone( - ftl::CommandLine{}, + fxl::CommandLine{}, "", // icu data path default lookup. "" // application library not supported in JIT mode. ); @@ -214,7 +214,7 @@ FlutterResult FlutterEngineSendPointerEvent(FlutterEngine engine, reinterpret_cast(current) + current->struct_size); } - blink::Threads::UI()->PostTask(ftl::MakeCopyable([ + blink::Threads::UI()->PostTask(fxl::MakeCopyable([ weak_engine = reinterpret_cast(engine) ->view() ->engine() diff --git a/shell/platform/embedder/platform_view_embedder.cc b/shell/platform/embedder/platform_view_embedder.cc index fa97fc84e17a0..85ffaa3b7156e 100644 --- a/shell/platform/embedder/platform_view_embedder.cc +++ b/shell/platform/embedder/platform_view_embedder.cc @@ -49,7 +49,7 @@ bool PlatformViewEmbedder::ResourceContextMakeCurrent() { void PlatformViewEmbedder::RunFromSource(const std::string& assets_directory, const std::string& main, const std::string& packages) { - FTL_LOG(INFO) << "Hot reloading is unsupported on this platform."; + FXL_LOG(INFO) << "Hot reloading is unsupported on this platform."; } } // namespace shell diff --git a/shell/platform/embedder/platform_view_embedder.h b/shell/platform/embedder/platform_view_embedder.h index 0f3821a5c6f14..1cf780d536271 100644 --- a/shell/platform/embedder/platform_view_embedder.h +++ b/shell/platform/embedder/platform_view_embedder.h @@ -7,7 +7,7 @@ #include "flutter/shell/common/platform_view.h" #include "flutter/shell/gpu/gpu_surface_gl.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace shell { @@ -53,7 +53,7 @@ class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { private: DispatchTable dispatch_table_; - FTL_DISALLOW_COPY_AND_ASSIGN(PlatformViewEmbedder); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewEmbedder); }; } // namespace shell diff --git a/shell/platform/linux/main_linux.cc b/shell/platform/linux/main_linux.cc index cfd08ab243382..e559f60fe1238 100644 --- a/shell/platform/linux/main_linux.cc +++ b/shell/platform/linux/main_linux.cc @@ -11,7 +11,7 @@ #include "flutter/shell/testing/test_runner.h" #include "flutter/shell/testing/testing.h" #include "flutter/sky/engine/public/web/Sky.h" -#include "lib/ftl/command_line.h" +#include "lib/fxl/command_line.h" #include "lib/tonic/dart_microtask_queue.h" namespace { @@ -25,7 +25,7 @@ const int kErrorExitCode = 255; // then exit the given message loop. class ScriptCompletionTaskObserver : public fml::TaskObserver { public: - ScriptCompletionTaskObserver(ftl::RefPtr task_runner) + ScriptCompletionTaskObserver(fxl::RefPtr task_runner) : main_task_runner_(std::move(task_runner)), prev_live_(false), last_error_(tonic::kNoError) {} @@ -53,7 +53,7 @@ class ScriptCompletionTaskObserver : public fml::TaskObserver { tonic::DartErrorHandleType last_error() { return last_error_; } private: - ftl::RefPtr main_task_runner_; + fxl::RefPtr main_task_runner_; bool prev_live_; tonic::DartErrorHandleType last_error_; }; @@ -71,7 +71,7 @@ int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { } } -void RunNonInteractive(ftl::CommandLine initial_command_line, +void RunNonInteractive(fxl::CommandLine initial_command_line, bool run_forever) { // This is a platform thread (i.e not one created by fml::Thread), so perform // one time initialization. @@ -103,7 +103,7 @@ void RunNonInteractive(ftl::CommandLine initial_command_line, if (error == tonic::kNoError) error = task_observer.last_error(); if (error == tonic::kNoError) { - ftl::AutoResetWaitableEvent latch; + fxl::AutoResetWaitableEvent latch; blink::Threads::UI()->PostTask([&error, &latch] { error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); latch.Signal(); @@ -122,7 +122,7 @@ int main(int argc, char* argv[]) { dart::bin::SetExecutableName(argv[0]); dart::bin::SetExecutableArguments(argc - 1, argv); - auto command_line = ftl::CommandLineFromArgcArgv(argc, argv); + auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { shell::PrintUsage("flutter_tester"); diff --git a/shell/testing/platform_view_test.h b/shell/testing/platform_view_test.h index a63df9b3b9ae2..ea4d60ef5fdfa 100644 --- a/shell/testing/platform_view_test.h +++ b/shell/testing/platform_view_test.h @@ -6,8 +6,8 @@ #define SHELL_TESTING_PLATFORM_VIEW_TEST_H_ #include "flutter/shell/common/platform_view.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" namespace shell { @@ -28,7 +28,7 @@ class PlatformViewTest : public PlatformView { const std::string& packages) override; private: - FTL_DISALLOW_COPY_AND_ASSIGN(PlatformViewTest); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewTest); }; } // namespace shell diff --git a/shell/testing/test_runner.h b/shell/testing/test_runner.h index c5abcd84d2b62..8f303d7eb7683 100644 --- a/shell/testing/test_runner.h +++ b/shell/testing/test_runner.h @@ -8,8 +8,8 @@ #include #include -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" namespace shell { @@ -34,7 +34,7 @@ class TestRunner { std::shared_ptr platform_view_; - FTL_DISALLOW_COPY_AND_ASSIGN(TestRunner); + FXL_DISALLOW_COPY_AND_ASSIGN(TestRunner); }; } // namespace shell diff --git a/shell/testing/testing.cc b/shell/testing/testing.cc index cbb8bdf84fa2a..13a3ab5be3d93 100644 --- a/shell/testing/testing.cc +++ b/shell/testing/testing.cc @@ -9,7 +9,7 @@ namespace shell { -bool InitForTesting(const ftl::CommandLine& command_line) { +bool InitForTesting(const fxl::CommandLine& command_line) { TestRunner::TestDescriptor test; test.packages = command_line.GetOptionValueWithDefault( FlagForSwitch(Switch::Packages), ""); diff --git a/shell/testing/testing.h b/shell/testing/testing.h index 0c99313deca5f..99f8b4fe983de 100644 --- a/shell/testing/testing.h +++ b/shell/testing/testing.h @@ -5,11 +5,11 @@ #ifndef SHELL_TESTING_TESTING_H_ #define SHELL_TESTING_TESTING_H_ -#include "lib/ftl/command_line.h" +#include "lib/fxl/command_line.h" namespace shell { -bool InitForTesting(const ftl::CommandLine& command_line); +bool InitForTesting(const fxl::CommandLine& command_line); } // namespace shell diff --git a/sky/engine/core/rendering/InlineFlowBox.h b/sky/engine/core/rendering/InlineFlowBox.h index 0760340260115..e5ee507a06b2a 100644 --- a/sky/engine/core/rendering/InlineFlowBox.h +++ b/sky/engine/core/rendering/InlineFlowBox.h @@ -217,7 +217,7 @@ class InlineFlowBox : public InlineBox { { return m_overflow ? m_overflow->layoutOverflowRect() : enclosingLayoutRect(frameRectIncludingLineHeight(lineTop, lineBottom)); } - LayoutUnit logicalLeftLayoutOverflow() const + LayoutUnit logicalLefxlayoutOverflow() const { return m_overflow ? m_overflow->layoutOverflowRect().x() : static_cast(logicalLeft()); } diff --git a/sky/engine/core/rendering/RenderBox.h b/sky/engine/core/rendering/RenderBox.h index 91cdbe08e358b..09c8efc2ff5fa 100644 --- a/sky/engine/core/rendering/RenderBox.h +++ b/sky/engine/core/rendering/RenderBox.h @@ -207,7 +207,7 @@ class RenderBox : public RenderBoxModelObject { LayoutRect layoutOverflowRect() const { return m_overflow ? m_overflow->layoutOverflowRect() : paddingBoxRect(); } IntRect pixelSnappedLayoutOverflowRect() const { return pixelSnappedIntRect(layoutOverflowRect()); } LayoutSize maxLayoutOverflow() const { return LayoutSize(layoutOverflowRect().maxX(), layoutOverflowRect().maxY()); } - LayoutUnit logicalLeftLayoutOverflow() const { return layoutOverflowRect().x(); } + LayoutUnit logicalLefxlayoutOverflow() const { return layoutOverflowRect().x(); } LayoutUnit logicalRightLayoutOverflow() const { return layoutOverflowRect().maxX(); } virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : borderBoxRect(); } diff --git a/sky/engine/public/platform/WebBlendMode.h b/sky/engine/public/platform/WebBlendMode.h index db1670f4d8148..39e686c277905 100644 --- a/sky/engine/public/platform/WebBlendMode.h +++ b/sky/engine/public/platform/WebBlendMode.h @@ -45,7 +45,7 @@ enum WebBlendMode { WebBlendModeColorDodge, WebBlendModeColorBurn, WebBlendModeHardLight, - WebBlendModeSoftLight, + WebBlendModeSofxlight, WebBlendModeDifference, WebBlendModeExclusion, WebBlendModeHue, diff --git a/sky/engine/wtf/dtoa/bignum-dtoa.cc b/sky/engine/wtf/dtoa/bignum-dtoa.cc index 80b1020971fd2..911125723a310 100644 --- a/sky/engine/wtf/dtoa/bignum-dtoa.cc +++ b/sky/engine/wtf/dtoa/bignum-dtoa.cc @@ -409,22 +409,22 @@ namespace double_conversion { // numerator = v. numerator->AssignUInt64(Double(v).Significand()); - numerator->ShiftLeft(Double(v).Exponent()); + numerator->Shifxleft(Double(v).Exponent()); // denominator = 10^estimated_power. denominator->AssignPowerUInt16(10, estimated_power); if (need_boundary_deltas) { // Introduce a common denominator so that the deltas to the boundaries are // integers. - denominator->ShiftLeft(1); - numerator->ShiftLeft(1); + denominator->Shifxleft(1); + numerator->Shifxleft(1); // Let v = f * 2^e, then m+ - v = 1/2 * 2^e; With the common // denominator (of 2) delta_plus equals 2^e. delta_plus->AssignUInt16(1); - delta_plus->ShiftLeft(Double(v).Exponent()); + delta_plus->Shifxleft(Double(v).Exponent()); // Same for delta_minus (with adjustments below if f == 2^p-1). delta_minus->AssignUInt16(1); - delta_minus->ShiftLeft(Double(v).Exponent()); + delta_minus->Shifxleft(Double(v).Exponent()); // If the significand (without the hidden bit) is 0, then the lower // boundary is closer than just half a ulp (unit in the last place). @@ -435,9 +435,9 @@ namespace double_conversion { if ((v_bits & Double::kSignificandMask) == 0) { // The lower boundary is closer at half the distance of "normal" numbers. // Increase the common denominator and adapt all but the delta_minus. - denominator->ShiftLeft(1); // *2 - numerator->ShiftLeft(1); // *2 - delta_plus->ShiftLeft(1); // *2 + denominator->Shifxleft(1); // *2 + numerator->Shifxleft(1); // *2 + delta_plus->Shifxleft(1); // *2 } } } @@ -460,13 +460,13 @@ namespace double_conversion { numerator->AssignUInt64(significand); // denominator = 10^estimated_power * 2^-exponent (with exponent < 0) denominator->AssignPowerUInt16(10, estimated_power); - denominator->ShiftLeft(-exponent); + denominator->Shifxleft(-exponent); if (need_boundary_deltas) { // Introduce a common denominator so that the deltas to the boundaries are // integers. - denominator->ShiftLeft(1); - numerator->ShiftLeft(1); + denominator->Shifxleft(1); + numerator->Shifxleft(1); // Let v = f * 2^e, then m+ - v = 1/2 * 2^e; With the common // denominator (of 2) delta_plus equals 2^e. // Given that the denominator already includes v's exponent the distance @@ -485,9 +485,9 @@ namespace double_conversion { if ((v_bits & Double::kSignificandMask) == 0) { // The lower boundary is closer at half the distance of "normal" numbers. // Increase the denominator and adapt all but the delta_minus. - denominator->ShiftLeft(1); // *2 - numerator->ShiftLeft(1); // *2 - delta_plus->ShiftLeft(1); // *2 + denominator->Shifxleft(1); // *2 + numerator->Shifxleft(1); // *2 + delta_plus->Shifxleft(1); // *2 } } } @@ -527,13 +527,13 @@ namespace double_conversion { // denominator = 2 * 2^-exponent with exponent < 0. denominator->AssignUInt16(1); - denominator->ShiftLeft(-exponent); + denominator->Shifxleft(-exponent); if (need_boundary_deltas) { // Introduce a common denominator so that the deltas to the boundaries are // integers. - numerator->ShiftLeft(1); - denominator->ShiftLeft(1); + numerator->Shifxleft(1); + denominator->Shifxleft(1); // With this shift the boundaries have their correct value, since // delta_plus = 10^-estimated_power, and // delta_minus = 10^-estimated_power. @@ -546,9 +546,9 @@ namespace double_conversion { // The only exception where a significand == 0 has its boundaries at // "normal" distances: (v_bits & Double::kExponentMask) != kMinimalNormalizedExponent) { - numerator->ShiftLeft(1); // *2 - denominator->ShiftLeft(1); // *2 - delta_plus->ShiftLeft(1); // *2 + numerator->Shifxleft(1); // *2 + denominator->Shifxleft(1); // *2 + delta_plus->Shifxleft(1); // *2 } } } diff --git a/sky/engine/wtf/dtoa/bignum.cc b/sky/engine/wtf/dtoa/bignum.cc index eea539453e6b4..00ce351ce68ea 100644 --- a/sky/engine/wtf/dtoa/bignum.cc +++ b/sky/engine/wtf/dtoa/bignum.cc @@ -238,12 +238,12 @@ namespace double_conversion { } - void Bignum::ShiftLeft(int shift_amount) { + void Bignum::Shifxleft(int shift_amount) { if (used_digits_ == 0) return; exponent_ += shift_amount / kBigitSize; int local_shift = shift_amount % kBigitSize; EnsureCapacity(used_digits_ + 1); - BigitsShiftLeft(local_shift); + BigitsShifxleft(local_shift); } @@ -336,7 +336,7 @@ namespace double_conversion { if (remaining_exponent > 0) { MultiplyByUInt32(kFive1_to_12[remaining_exponent - 1]); } - ShiftLeft(exponent); + Shifxleft(exponent); } @@ -481,7 +481,7 @@ namespace double_conversion { } // And finally add the saved shifts. - ShiftLeft(shifts * power_exponent); + Shifxleft(shifts * power_exponent); } @@ -719,7 +719,7 @@ namespace double_conversion { } - void Bignum::BigitsShiftLeft(int shift_amount) { + void Bignum::BigitsShifxleft(int shift_amount) { ASSERT(shift_amount < kBigitSize); ASSERT(shift_amount >= 0); Chunk carry = 0; diff --git a/sky/engine/wtf/dtoa/bignum.h b/sky/engine/wtf/dtoa/bignum.h index dfa37f37f6884..c1a6d7bf9e6ee 100644 --- a/sky/engine/wtf/dtoa/bignum.h +++ b/sky/engine/wtf/dtoa/bignum.h @@ -58,7 +58,7 @@ namespace double_conversion { void SubtractBignum(const Bignum& other); void Square(); - void ShiftLeft(int shift_amount); + void Shifxleft(int shift_amount); void MultiplyByUInt32(uint32_t factor); void MultiplyByUInt64(uint64_t factor); void MultiplyByPowerOfTen(int exponent); @@ -121,7 +121,7 @@ namespace double_conversion { // Requires this to have enough capacity (no tests done). // Updates used_digits_ if necessary. // shift_amount must be < kBigitSize. - void BigitsShiftLeft(int shift_amount); + void BigitsShifxleft(int shift_amount); // BigitLength includes the "hidden" digits encoded in the exponent. int BigitLength() const { return used_digits_ + exponent_; } Chunk BigitAt(int index) const; @@ -135,7 +135,7 @@ namespace double_conversion { // The Bignum's value equals value(bigits_) * 2^(exponent_ * kBigitSize). int exponent_; - FTL_DISALLOW_COPY_AND_ASSIGN(Bignum); + FXL_DISALLOW_COPY_AND_ASSIGN(Bignum); }; } // namespace double_conversion diff --git a/sky/engine/wtf/dtoa/double-conversion.h b/sky/engine/wtf/dtoa/double-conversion.h index 27fe892603167..de66bd8b130de 100644 --- a/sky/engine/wtf/dtoa/double-conversion.h +++ b/sky/engine/wtf/dtoa/double-conversion.h @@ -355,7 +355,7 @@ namespace double_conversion { const int max_leading_padding_zeroes_in_precision_mode_; const int max_trailing_padding_zeroes_in_precision_mode_; - FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DoubleToStringConverter); + FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(DoubleToStringConverter); }; @@ -367,7 +367,7 @@ namespace double_conversion { static double StringToDouble(const char* buffer, size_t length, size_t* processed_characters_count); private: - FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter); + FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter); }; } // namespace double_conversion diff --git a/sky/engine/wtf/dtoa/strtod.cc b/sky/engine/wtf/dtoa/strtod.cc index e79209d165f16..8895d3119f76b 100644 --- a/sky/engine/wtf/dtoa/strtod.cc +++ b/sky/engine/wtf/dtoa/strtod.cc @@ -394,9 +394,9 @@ namespace double_conversion { boundary.MultiplyByPowerOfTen(-exponent); } if (upper_boundary.e() > 0) { - boundary.ShiftLeft(upper_boundary.e()); + boundary.Shifxleft(upper_boundary.e()); } else { - input.ShiftLeft(-upper_boundary.e()); + input.Shifxleft(-upper_boundary.e()); } int comparison = Bignum::Compare(input, boundary); if (comparison < 0) { diff --git a/sky/engine/wtf/dtoa/utils.h b/sky/engine/wtf/dtoa/utils.h index bbfab79f5a229..00297eb0d9712 100644 --- a/sky/engine/wtf/dtoa/utils.h +++ b/sky/engine/wtf/dtoa/utils.h @@ -30,7 +30,7 @@ #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "flutter/sky/engine/wtf/Assertions.h" #define UNIMPLEMENTED ASSERT_NOT_REACHED @@ -221,7 +221,7 @@ namespace double_conversion { bool is_finalized() const { return position_ < 0; } - FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); + FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); }; // The type-based aliasing rule allows the compiler to assume that pointers of diff --git a/synchronization/debug_thread_checker.h b/synchronization/debug_thread_checker.h index 9d49460702de3..69614eb89d217 100644 --- a/synchronization/debug_thread_checker.h +++ b/synchronization/debug_thread_checker.h @@ -8,11 +8,11 @@ #ifndef NDEBUG #include -#include "lib/ftl/synchronization/thread_checker.h" +#include "lib/fxl/synchronization/thread_checker.h" -#define FLUTTER_THREAD_CHECKER_DECLARE(x) ::ftl::ThreadChecker x; +#define FLUTTER_THREAD_CHECKER_DECLARE(x) ::fxl::ThreadChecker x; -#define FLUTTER_THREAD_CHECKER_CHECK(x) FTL_CHECK(x.IsCreationThreadCurrent()); +#define FLUTTER_THREAD_CHECKER_CHECK(x) FXL_CHECK(x.IsCreationThreadCurrent()); #else // NDEBUG diff --git a/synchronization/pipeline.h b/synchronization/pipeline.h index 961a0df963229..9897b20a4fe67 100644 --- a/synchronization/pipeline.h +++ b/synchronization/pipeline.h @@ -8,11 +8,11 @@ #include "flutter/glue/trace_event.h" #include "flutter/synchronization/pipeline.h" #include "flutter/synchronization/semaphore.h" -#include "lib/ftl/functional/closure.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/ref_counted.h" -#include "lib/ftl/synchronization/mutex.h" -#include "lib/ftl/synchronization/thread_annotations.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/synchronization/mutex.h" +#include "lib/fxl/synchronization/thread_annotations.h" #include #include @@ -26,7 +26,7 @@ enum class PipelineConsumeResult { }; template -class Pipeline : public ftl::RefCountedThreadSafe> { +class Pipeline : public fxl::RefCountedThreadSafe> { public: using Resource = R; using ResourcePtr = std::unique_ptr; @@ -82,7 +82,7 @@ class Pipeline : public ftl::RefCountedThreadSafe> { TRACE_EVENT_ASYNC_BEGIN0("flutter", "PipelineProduce", trace_id_); } - FTL_DISALLOW_COPY_AND_ASSIGN(ProducerContinuation); + FXL_DISALLOW_COPY_AND_ASSIGN(ProducerContinuation); }; explicit Pipeline(uint32_t depth) @@ -105,7 +105,7 @@ class Pipeline : public ftl::RefCountedThreadSafe> { using Consumer = std::function; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT PipelineConsumeResult Consume(Consumer consumer) { if (consumer == nullptr) { return PipelineConsumeResult::NoneAvailable; @@ -120,7 +120,7 @@ class Pipeline : public ftl::RefCountedThreadSafe> { size_t items_count = 0; { - ftl::MutexLocker lock(&queue_mutex_); + fxl::MutexLocker lock(&queue_mutex_); std::tie(resource, trace_id) = std::move(queue_.front()); queue_.pop(); items_count = queue_.size(); @@ -142,14 +142,14 @@ class Pipeline : public ftl::RefCountedThreadSafe> { private: Semaphore empty_; Semaphore available_; - ftl::Mutex queue_mutex_; + fxl::Mutex queue_mutex_; std::queue> queue_ - FTL_GUARDED_BY(queue_mutex_); + FXL_GUARDED_BY(queue_mutex_); std::atomic_size_t last_trace_id_; void ProducerCommit(ResourcePtr resource, size_t trace_id) { { - ftl::MutexLocker lock(&queue_mutex_); + fxl::MutexLocker lock(&queue_mutex_); queue_.emplace(std::move(resource), trace_id); } @@ -157,7 +157,7 @@ class Pipeline : public ftl::RefCountedThreadSafe> { available_.Signal(); } - FTL_DISALLOW_COPY_AND_ASSIGN(Pipeline); + FXL_DISALLOW_COPY_AND_ASSIGN(Pipeline); }; } // namespace flutter diff --git a/synchronization/semaphore.cc b/synchronization/semaphore.cc index a863a07285bd0..cdb4d9fb59461 100644 --- a/synchronization/semaphore.cc +++ b/synchronization/semaphore.cc @@ -3,8 +3,8 @@ // found in the LICENSE file. #include "flutter/synchronization/semaphore.h" -#include "lib/ftl/build_config.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/logging.h" #if OS_MACOSX @@ -43,7 +43,7 @@ class PlatformSemaphore { private: dispatch_semaphore_t _sem; - FTL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); }; } // namespace flutter @@ -51,7 +51,7 @@ class PlatformSemaphore { #else // OS_MACOSX #include -#include "lib/ftl/files/eintr_wrapper.h" +#include "lib/fxl/files/eintr_wrapper.h" namespace flutter { @@ -65,7 +65,7 @@ class PlatformSemaphore { int result = ::sem_destroy(&sem_); // Can only be EINVAL which should not be possible since we checked for // validity. - FTL_DCHECK(result == 0); + FXL_DCHECK(result == 0); } } @@ -93,7 +93,7 @@ class PlatformSemaphore { bool valid_; sem_t sem_; - FTL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); }; } // namespace flutter diff --git a/synchronization/semaphore.h b/synchronization/semaphore.h index 41e7355da9e0d..ca8c60309829e 100644 --- a/synchronization/semaphore.h +++ b/synchronization/semaphore.h @@ -7,9 +7,9 @@ #include -#include "lib/ftl/macros.h" -#include "lib/ftl/time/time_delta.h" -#include "lib/ftl/compiler_specific.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/time/time_delta.h" +#include "lib/fxl/compiler_specific.h" namespace flutter { @@ -23,7 +23,7 @@ class Semaphore { bool IsValid() const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool TryWait(); void Signal(); @@ -31,7 +31,7 @@ class Semaphore { private: std::unique_ptr _impl; - FTL_DISALLOW_COPY_AND_ASSIGN(Semaphore); + FXL_DISALLOW_COPY_AND_ASSIGN(Semaphore); }; } // namespace flutter diff --git a/testing/run_tests.sh b/testing/run_tests.sh index 7576b521c557d..16b7428622756 100755 --- a/testing/run_tests.sh +++ b/testing/run_tests.sh @@ -2,7 +2,7 @@ set -ex -out/host_debug_unopt/ftl_unittests +out/host_debug_unopt/fxl_unittests out/host_debug_unopt/synchronization_unittests out/host_debug_unopt/wtf_unittests diff --git a/third_party/txt/benchmarks/paint_record_benchmarks.cc b/third_party/txt/benchmarks/paint_record_benchmarks.cc index 54746e8df1f3b..ab16de6368dc3 100644 --- a/third_party/txt/benchmarks/paint_record_benchmarks.cc +++ b/third_party/txt/benchmarks/paint_record_benchmarks.cc @@ -16,8 +16,8 @@ #include "third_party/benchmark/include/benchmark/benchmark_api.h" -#include "lib/ftl/command_line.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/logging.h" #include "txt/paint_record.h" #include "txt/text_style.h" #include "utils.h" diff --git a/third_party/txt/benchmarks/paragraph_benchmarks.cc b/third_party/txt/benchmarks/paragraph_benchmarks.cc index 3e189c8e9a42c..22dbd27785603 100644 --- a/third_party/txt/benchmarks/paragraph_benchmarks.cc +++ b/third_party/txt/benchmarks/paragraph_benchmarks.cc @@ -17,8 +17,8 @@ #include "third_party/benchmark/include/benchmark/benchmark_api.h" #include -#include "lib/ftl/command_line.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/logging.h" #include "minikin/LayoutUtils.h" #include "third_party/icu/source/common/unicode/unistr.h" #include "third_party/skia/include/core/SkBitmap.h" diff --git a/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc b/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc index 2fa4882cb9e08..f8d15374bd23e 100644 --- a/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc +++ b/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc @@ -16,7 +16,7 @@ #include "third_party/benchmark/include/benchmark/benchmark_api.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "third_party/icu/source/common/unicode/unistr.h" #include "third_party/skia/include/core/SkColor.h" #include "txt/font_collection.h" diff --git a/third_party/txt/benchmarks/styled_runs_benchmarks.cc b/third_party/txt/benchmarks/styled_runs_benchmarks.cc index b2f4655863306..a0e21fc89102a 100644 --- a/third_party/txt/benchmarks/styled_runs_benchmarks.cc +++ b/third_party/txt/benchmarks/styled_runs_benchmarks.cc @@ -16,8 +16,8 @@ #include "third_party/benchmark/include/benchmark/benchmark_api.h" -#include "lib/ftl/command_line.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/logging.h" #include "txt/styled_runs.h" #include "txt/text_style.h" #include "utils.h" diff --git a/third_party/txt/benchmarks/txt_run_all_benchmarks.cc b/third_party/txt/benchmarks/txt_run_all_benchmarks.cc index a5af92546a735..ac6ae0a944990 100644 --- a/third_party/txt/benchmarks/txt_run_all_benchmarks.cc +++ b/third_party/txt/benchmarks/txt_run_all_benchmarks.cc @@ -17,23 +17,23 @@ #include "third_party/benchmark/include/benchmark/benchmark_api.h" #include "flutter/fml/icu_util.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "utils.h" // We will use a custom main to allow custom font directories for consistency. int main(int argc, char** argv) { ::benchmark::Initialize(&argc, argv); - ftl::CommandLine cmd = ftl::CommandLineFromArgcArgv(argc, argv); + fxl::CommandLine cmd = fxl::CommandLineFromArgcArgv(argc, argv); txt::SetCommandLine(cmd); std::string dir = txt::GetCommandLineForProcess().GetOptionValueWithDefault( "font-directory", ""); txt::SetFontDir(dir); if (txt::GetFontDir().length() <= 0) { - FTL_LOG(ERROR) << "Font directory must be specified with " + FXL_LOG(ERROR) << "Font directory must be specified with " "--font-directoy=\"\" to run this test."; return EXIT_FAILURE; } - FTL_DCHECK(txt::GetFontDir().length() > 0); + FXL_DCHECK(txt::GetFontDir().length() > 0); fml::icu::InitializeICU(); diff --git a/third_party/txt/benchmarks/utils.cc b/third_party/txt/benchmarks/utils.cc index 48bed676eed8e..16cfa81ebb6b5 100644 --- a/third_party/txt/benchmarks/utils.cc +++ b/third_party/txt/benchmarks/utils.cc @@ -16,7 +16,7 @@ #include -#include "lib/ftl/command_line.h" +#include "lib/fxl/command_line.h" #include "txt/directory_asset_data_provider.h" #include "txt/font_collection.h" #include "utils.h" @@ -24,7 +24,7 @@ namespace txt { static std::string gFontDir; -static ftl::CommandLine gCommandLine; +static fxl::CommandLine gCommandLine; const std::string& GetFontDir() { return gFontDir; @@ -34,11 +34,11 @@ void SetFontDir(const std::string& dir) { gFontDir = dir; } -const ftl::CommandLine& GetCommandLineForProcess() { +const fxl::CommandLine& GetCommandLineForProcess() { return gCommandLine; } -void SetCommandLine(ftl::CommandLine cmd) { +void SetCommandLine(fxl::CommandLine cmd) { gCommandLine = std::move(cmd); } diff --git a/third_party/txt/benchmarks/utils.h b/third_party/txt/benchmarks/utils.h index b164078c204cd..dcdeb12bcf583 100644 --- a/third_party/txt/benchmarks/utils.h +++ b/third_party/txt/benchmarks/utils.h @@ -16,7 +16,7 @@ #include -#include "lib/ftl/command_line.h" +#include "lib/fxl/command_line.h" namespace txt { @@ -26,9 +26,9 @@ const std::string& GetFontDir(); void SetFontDir(const std::string& dir); -const ftl::CommandLine& GetCommandLineForProcess(); +const fxl::CommandLine& GetCommandLineForProcess(); -void SetCommandLine(ftl::CommandLine cmd); +void SetCommandLine(fxl::CommandLine cmd); std::shared_ptr GetTestFontCollection(); diff --git a/third_party/txt/src/log/log.h b/third_party/txt/src/log/log.h index c3303555ece25..9dfd5e9bde1c8 100644 --- a/third_party/txt/src/log/log.h +++ b/third_party/txt/src/log/log.h @@ -18,32 +18,32 @@ #include -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #ifndef LOG_ALWAYS_FATAL_IF #define LOG_ALWAYS_FATAL_IF(cond, ...) \ - ((cond) ? (FTL_LOG(FATAL) << #cond) : (void)0) + ((cond) ? (FXL_LOG(FATAL) << #cond) : (void)0) #endif #ifndef LOG_ALWAYS_FATAL -#define LOG_ALWAYS_FATAL(...) FTL_LOG(FATAL) +#define LOG_ALWAYS_FATAL(...) FXL_LOG(FATAL) #endif #ifndef LOG_ASSERT -#define LOG_ASSERT(cond, ...) FTL_CHECK(cond) +#define LOG_ASSERT(cond, ...) FXL_CHECK(cond) #define ALOG_ASSERT LOG_ASSERT #endif #ifndef ALOGD -#define ALOGD(message, ...) FTL_DLOG(INFO) << (message) +#define ALOGD(message, ...) FXL_DLOG(INFO) << (message) #endif #ifndef ALOGW -#define ALOGW(message, ...) FTL_LOG(WARNING) << (message) +#define ALOGW(message, ...) FXL_LOG(WARNING) << (message) #endif #ifndef ALOGE -#define ALOGE(message, ...) FTL_LOG(ERROR) << (message) +#define ALOGE(message, ...) FXL_LOG(ERROR) << (message) #endif #define android_errorWriteLog(tag, subTag) \ diff --git a/third_party/txt/src/txt/asset_data_provider.cc b/third_party/txt/src/txt/asset_data_provider.cc index 4f00970c078d5..3dd59a258db43 100644 --- a/third_party/txt/src/txt/asset_data_provider.cc +++ b/third_party/txt/src/txt/asset_data_provider.cc @@ -15,7 +15,7 @@ */ #include "txt/asset_data_provider.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace txt { diff --git a/third_party/txt/src/txt/asset_data_provider.h b/third_party/txt/src/txt/asset_data_provider.h index d287618365096..86d052581ed4f 100644 --- a/third_party/txt/src/txt/asset_data_provider.h +++ b/third_party/txt/src/txt/asset_data_provider.h @@ -19,7 +19,7 @@ #include #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkTypeface.h" #include "txt/asset_font_style_set.h" @@ -43,7 +43,7 @@ class AssetDataProvider { private: std::unordered_map registered_families_; - FTL_DISALLOW_COPY_AND_ASSIGN(AssetDataProvider); + FXL_DISALLOW_COPY_AND_ASSIGN(AssetDataProvider); }; } // namespace txt diff --git a/third_party/txt/src/txt/asset_font_manager.cc b/third_party/txt/src/txt/asset_font_manager.cc index e55ba709ed946..698016b5c04e4 100644 --- a/third_party/txt/src/txt/asset_font_manager.cc +++ b/third_party/txt/src/txt/asset_font_manager.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "txt/asset_font_manager.h" namespace txt { @@ -22,7 +22,7 @@ namespace txt { AssetFontManager::AssetFontManager( std::unique_ptr data_provider) : data_provider_(std::move(data_provider)) { - FTL_DCHECK(data_provider_ != nullptr); + FXL_DCHECK(data_provider_ != nullptr); } AssetFontManager::~AssetFontManager() = default; @@ -32,11 +32,11 @@ int AssetFontManager::onCountFamilies() const { } void AssetFontManager::onGetFamilyName(int index, SkString* familyName) const { - FTL_DCHECK(false); + FXL_DCHECK(false); } SkFontStyleSet* AssetFontManager::onCreateStyleSet(int index) const { - FTL_DCHECK(false); + FXL_DCHECK(false); return nullptr; } @@ -48,7 +48,7 @@ SkFontStyleSet* AssetFontManager::onMatchFamily( SkTypeface* AssetFontManager::onMatchFamilyStyle(const char familyName[], const SkFontStyle&) const { - FTL_DCHECK(false); + FXL_DCHECK(false); return nullptr; } @@ -58,42 +58,42 @@ SkTypeface* AssetFontManager::onMatchFamilyStyleCharacter( const char* bcp47[], int bcp47Count, SkUnichar character) const { - FTL_DCHECK(false); + FXL_DCHECK(false); return nullptr; } SkTypeface* AssetFontManager::onMatchFaceStyle(const SkTypeface*, const SkFontStyle&) const { - FTL_DCHECK(false); + FXL_DCHECK(false); return nullptr; } SkTypeface* AssetFontManager::onCreateFromData(SkData*, int ttcIndex) const { - FTL_DCHECK(false); + FXL_DCHECK(false); return nullptr; } SkTypeface* AssetFontManager::onCreateFromStream(SkStreamAsset*, int ttcIndex) const { - FTL_DCHECK(false); + FXL_DCHECK(false); return nullptr; } SkTypeface* AssetFontManager::onCreateFromStream(SkStreamAsset*, const SkFontArguments&) const { - FTL_DCHECK(false); + FXL_DCHECK(false); return nullptr; } SkTypeface* AssetFontManager::onCreateFromFile(const char path[], int ttcIndex) const { - FTL_DCHECK(false); + FXL_DCHECK(false); return nullptr; } SkTypeface* AssetFontManager::onLegacyCreateTypeface(const char familyName[], SkFontStyle) const { - FTL_DCHECK(false); + FXL_DCHECK(false); return nullptr; } diff --git a/third_party/txt/src/txt/asset_font_manager.h b/third_party/txt/src/txt/asset_font_manager.h index bc91c7c9dab34..174efd5ee77db 100644 --- a/third_party/txt/src/txt/asset_font_manager.h +++ b/third_party/txt/src/txt/asset_font_manager.h @@ -18,7 +18,7 @@ #define TXT_ASSET_FONT_MANAGER_H_ #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/ports/SkFontMgr.h" #include "txt/asset_data_provider.h" @@ -77,7 +77,7 @@ class AssetFontManager : public SkFontMgr { SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle) const override; - FTL_DISALLOW_COPY_AND_ASSIGN(AssetFontManager); + FXL_DISALLOW_COPY_AND_ASSIGN(AssetFontManager); }; } // namespace txt diff --git a/third_party/txt/src/txt/asset_font_style_set.cc b/third_party/txt/src/txt/asset_font_style_set.cc index 590ca9d2c964f..a40abd637a804 100644 --- a/third_party/txt/src/txt/asset_font_style_set.cc +++ b/third_party/txt/src/txt/asset_font_style_set.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "txt/asset_font_style_set.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace txt { @@ -23,7 +23,7 @@ int AssetFontStyleSet::count() { } void AssetFontStyleSet::getStyle(int index, SkFontStyle*, SkString* style) { - FTL_DCHECK(false); + FXL_DCHECK(false); } SkTypeface* AssetFontStyleSet::createTypeface(int index) { @@ -35,7 +35,7 @@ SkTypeface* AssetFontStyleSet::createTypeface(int index) { } SkTypeface* AssetFontStyleSet::matchStyle(const SkFontStyle& pattern) { - FTL_DCHECK(false); + FXL_DCHECK(false); return nullptr; } diff --git a/third_party/txt/src/txt/asset_font_style_set.h b/third_party/txt/src/txt/asset_font_style_set.h index b3f33fb249cd9..23c610917c230 100644 --- a/third_party/txt/src/txt/asset_font_style_set.h +++ b/third_party/txt/src/txt/asset_font_style_set.h @@ -6,7 +6,7 @@ #define TXT_ASSET_FONT_STYLE_SET_H_ #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkFontStyle.h" #include "third_party/skia/include/core/SkTypeface.h" #include "third_party/skia/include/ports/SkFontMgr.h" @@ -36,7 +36,7 @@ class AssetFontStyleSet : public SkFontStyleSet { private: std::vector> typefaces_; - FTL_DISALLOW_COPY_AND_ASSIGN(AssetFontStyleSet); + FXL_DISALLOW_COPY_AND_ASSIGN(AssetFontStyleSet); }; } // namespace txt diff --git a/third_party/txt/src/txt/directory_asset_data_provider.cc b/third_party/txt/src/txt/directory_asset_data_provider.cc index 0f72e31642c41..3141fa7374c85 100644 --- a/third_party/txt/src/txt/directory_asset_data_provider.cc +++ b/third_party/txt/src/txt/directory_asset_data_provider.cc @@ -4,7 +4,7 @@ #include #include -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkTypeface.h" #include "txt/directory_asset_data_provider.h" diff --git a/third_party/txt/src/txt/directory_asset_data_provider.h b/third_party/txt/src/txt/directory_asset_data_provider.h index f299e6b9369fc..7f0a751008b05 100644 --- a/third_party/txt/src/txt/directory_asset_data_provider.h +++ b/third_party/txt/src/txt/directory_asset_data_provider.h @@ -5,7 +5,7 @@ #ifndef TXT_DIRECTORY_ASSET_DATA_PROVIDER_H_ #define TXT_DIRECTORY_ASSET_DATA_PROVIDER_H_ -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "txt/asset_data_provider.h" namespace txt { @@ -17,7 +17,7 @@ class DirectoryAssetDataProvider : public AssetDataProvider { ~DirectoryAssetDataProvider() override; private: - FTL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetDataProvider); + FXL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetDataProvider); }; } // namespace txt diff --git a/third_party/txt/src/txt/font_collection.cc b/third_party/txt/src/txt/font_collection.cc index e2a0efb65dac8..f4dbd876c15fd 100644 --- a/third_party/txt/src/txt/font_collection.cc +++ b/third_party/txt/src/txt/font_collection.cc @@ -24,7 +24,7 @@ #include #include #include "font_skia.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "txt/platform.h" #include "txt/text_style.h" diff --git a/third_party/txt/src/txt/font_collection.h b/third_party/txt/src/txt/font_collection.h index ea7fddf9af227..ecc4a52bed66f 100644 --- a/third_party/txt/src/txt/font_collection.h +++ b/third_party/txt/src/txt/font_collection.h @@ -21,7 +21,7 @@ #include #include #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "minikin/FontCollection.h" #include "minikin/FontFamily.h" #include "third_party/gtest/include/gtest/gtest_prod.h" @@ -51,7 +51,7 @@ class FontCollection { std::unordered_map> font_collections_cache_; - FTL_DISALLOW_COPY_AND_ASSIGN(FontCollection); + FXL_DISALLOW_COPY_AND_ASSIGN(FontCollection); }; } // namespace txt diff --git a/third_party/txt/src/txt/font_skia.h b/third_party/txt/src/txt/font_skia.h index 96e808d9fb8da..034a19906c755 100644 --- a/third_party/txt/src/txt/font_skia.h +++ b/third_party/txt/src/txt/font_skia.h @@ -17,7 +17,7 @@ #include #include #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace txt { @@ -44,7 +44,7 @@ class FontSkia : public minikin::MinikinFont { sk_sp typeface_; std::vector variations_; - FTL_DISALLOW_COPY_AND_ASSIGN(FontSkia); + FXL_DISALLOW_COPY_AND_ASSIGN(FontSkia); }; } // namespace txt diff --git a/third_party/txt/src/txt/paint_record.cc b/third_party/txt/src/txt/paint_record.cc index 454767e31d61f..65e5bbc27f1f2 100644 --- a/third_party/txt/src/txt/paint_record.cc +++ b/third_party/txt/src/txt/paint_record.cc @@ -15,7 +15,7 @@ */ #include "paint_record.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace txt { diff --git a/third_party/txt/src/txt/paint_record.h b/third_party/txt/src/txt/paint_record.h index b77e7fd30c1d1..f0577fa74e02f 100644 --- a/third_party/txt/src/txt/paint_record.h +++ b/third_party/txt/src/txt/paint_record.h @@ -17,8 +17,8 @@ #ifndef LIB_TXT_SRC_PAINT_RECORD_H_ #define LIB_TXT_SRC_PAINT_RECORD_H_ -#include "lib/ftl/logging.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/macros.h" #include "text_style.h" #include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/core/SkTextBlob.h" @@ -76,7 +76,7 @@ class PaintRecord { size_t line_; double run_width_ = 0.0f; - FTL_DISALLOW_COPY_AND_ASSIGN(PaintRecord); + FXL_DISALLOW_COPY_AND_ASSIGN(PaintRecord); }; } // namespace txt diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index 59c2da2c1d7dd..9b54aaceb19a7 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -26,7 +26,7 @@ #include #include "font_collection.h" #include "font_skia.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "minikin/HbFontCache.h" #include "minikin/LayoutUtils.h" #include "minikin/LineBreaker.h" @@ -148,7 +148,7 @@ bool Paragraph::AddRunsToLineBreaker( auto collection = font_collection_->GetMinikinFontCollectionForFamily( run.style.font_family); if (collection == nullptr) { - FTL_LOG(INFO) << "Could not find font collection for family \"" + FXL_LOG(INFO) << "Could not find font collection for family \"" << run.style.font_family << "\"."; return false; } @@ -841,7 +841,7 @@ std::vector Paragraph::GetRectsForRange(size_t start, std::vector rects; end = fmax(start, end); start = fmin(start, end); - FTL_DCHECK(end >= start && end >= 0 && start >= 0); + FXL_DCHECK(end >= start && end >= 0 && start >= 0); if (end == start) end = start + 1; end = fmin(end, text_.size()); diff --git a/third_party/txt/src/txt/paragraph.h b/third_party/txt/src/txt/paragraph.h index 04e1b3a2526b4..ac30484382c67 100644 --- a/third_party/txt/src/txt/paragraph.h +++ b/third_party/txt/src/txt/paragraph.h @@ -22,8 +22,8 @@ #include #include "font_collection.h" -#include "lib/ftl/compiler_specific.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" #include "minikin/LineBreaker.h" #include "paint_record.h" #include "paragraph_style.h" @@ -220,7 +220,7 @@ class Paragraph { void SetFontCollection(std::shared_ptr font_collection); - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool AddRunsToLineBreaker( std::unordered_map>& collection_map); @@ -245,7 +245,7 @@ class Paragraph { void CalculateIntrinsicWidths(); - FTL_DISALLOW_COPY_AND_ASSIGN(Paragraph); + FXL_DISALLOW_COPY_AND_ASSIGN(Paragraph); }; } // namespace txt diff --git a/third_party/txt/src/txt/paragraph_builder.cc b/third_party/txt/src/txt/paragraph_builder.cc index 26abfcb682294..62851e161683d 100644 --- a/third_party/txt/src/txt/paragraph_builder.cc +++ b/third_party/txt/src/txt/paragraph_builder.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include diff --git a/third_party/txt/src/txt/paragraph_builder.h b/third_party/txt/src/txt/paragraph_builder.h index 037522ddca205..9ad68db207eba 100644 --- a/third_party/txt/src/txt/paragraph_builder.h +++ b/third_party/txt/src/txt/paragraph_builder.h @@ -21,7 +21,7 @@ #include #include "font_collection.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "paragraph.h" #include "paragraph_style.h" #include "styled_runs.h" @@ -83,7 +83,7 @@ class ParagraphBuilder { // Paragraph::Layout to cleanly discover and handle newlines. void SplitNewlineRuns(); - FTL_DISALLOW_COPY_AND_ASSIGN(ParagraphBuilder); + FXL_DISALLOW_COPY_AND_ASSIGN(ParagraphBuilder); }; } // namespace txt diff --git a/third_party/txt/src/txt/platform.h b/third_party/txt/src/txt/platform.h index 7b993e0f02ada..6e974381ee067 100644 --- a/third_party/txt/src/txt/platform.h +++ b/third_party/txt/src/txt/platform.h @@ -6,7 +6,7 @@ #define TXT_PLATFORM_H_ #include -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace txt { diff --git a/third_party/txt/src/txt/styled_runs.cc b/third_party/txt/src/txt/styled_runs.cc index 4bc38beee2994..f324799be53ed 100644 --- a/third_party/txt/src/txt/styled_runs.cc +++ b/third_party/txt/src/txt/styled_runs.cc @@ -16,7 +16,7 @@ #include "styled_runs.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" namespace txt { diff --git a/third_party/txt/tests/font_collection_unittests.cc b/third_party/txt/tests/font_collection_unittests.cc index 2c7eb0b6633a3..0b8c4856aa00a 100644 --- a/third_party/txt/tests/font_collection_unittests.cc +++ b/third_party/txt/tests/font_collection_unittests.cc @@ -15,8 +15,8 @@ */ #include "gtest/gtest.h" -#include "lib/ftl/command_line.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/logging.h" #include "txt/font_collection.h" #include "utils.h" diff --git a/third_party/txt/tests/paragraph_unittests.cc b/third_party/txt/tests/paragraph_unittests.cc index 5b47d1b422c32..ee5c02b1a7f11 100644 --- a/third_party/txt/tests/paragraph_unittests.cc +++ b/third_party/txt/tests/paragraph_unittests.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "render_test.h" #include "third_party/icu/source/common/unicode/unistr.h" #include "third_party/skia/include/core/SkColor.h" diff --git a/third_party/txt/tests/render_test.cc b/third_party/txt/tests/render_test.cc index 1d7578cdd544a..bab6c8e582e7b 100644 --- a/third_party/txt/tests/render_test.cc +++ b/third_party/txt/tests/render_test.cc @@ -18,7 +18,7 @@ #include -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkImageEncoder.h" #include "third_party/skia/include/core/SkStream.h" #include "txt/asset_font_manager.h" @@ -68,7 +68,7 @@ bool RenderTest::Snapshot() { error = mkdir(snapshot_dir.c_str(), permissions); #endif if (error > 0) { - FTL_LOG(ERROR) << "'snapshot/' Directory not available and could not be " + FXL_LOG(ERROR) << "'snapshot/' Directory not available and could not be " "created. Please create manually to save snapshot."; return false; } diff --git a/third_party/txt/tests/render_test.h b/third_party/txt/tests/render_test.h index 73e7da9643e3e..7fb086fa30efd 100644 --- a/third_party/txt/tests/render_test.h +++ b/third_party/txt/tests/render_test.h @@ -17,7 +17,7 @@ #include #include #include "gtest/gtest.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkCanvas.h" #include "txt/font_collection.h" @@ -53,7 +53,7 @@ class RenderTest : public ::testing::Test { std::string GetNextSnapshotName(); - FTL_DISALLOW_COPY_AND_ASSIGN(RenderTest); + FXL_DISALLOW_COPY_AND_ASSIGN(RenderTest); }; } // namespace txt diff --git a/third_party/txt/tests/txt_run_all_unittests.cc b/third_party/txt/tests/txt_run_all_unittests.cc index fca56df013576..e681cb3e6e084 100644 --- a/third_party/txt/tests/txt_run_all_unittests.cc +++ b/third_party/txt/tests/txt_run_all_unittests.cc @@ -16,25 +16,25 @@ #include "flutter/fml/icu_util.h" #include "gtest/gtest.h" -#include "lib/ftl/command_line.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkGraphics.h" #include "utils.h" #include int main(int argc, char** argv) { - ftl::CommandLine cmd = ftl::CommandLineFromArgcArgv(argc, argv); + fxl::CommandLine cmd = fxl::CommandLineFromArgcArgv(argc, argv); txt::SetCommandLine(cmd); std::string dir = txt::GetCommandLineForProcess().GetOptionValueWithDefault( "font-directory", ""); txt::SetFontDir(dir); if (txt::GetFontDir().length() <= 0) { - FTL_LOG(ERROR) << "Font directory must be specified with " + FXL_LOG(ERROR) << "Font directory must be specified with " "--font-directoy=\"\" to run this test."; return EXIT_FAILURE; } - FTL_DCHECK(txt::GetFontDir().length() > 0); + FXL_DCHECK(txt::GetFontDir().length() > 0); fml::icu::InitializeICU(); SkGraphics::Init(); diff --git a/third_party/txt/tests/utils.cc b/third_party/txt/tests/utils.cc index a89aab3511eec..79e5bdc0b9bf7 100644 --- a/third_party/txt/tests/utils.cc +++ b/third_party/txt/tests/utils.cc @@ -16,13 +16,13 @@ #include -#include "lib/ftl/command_line.h" +#include "lib/fxl/command_line.h" #include "utils.h" namespace txt { static std::string gFontDir; -static ftl::CommandLine gCommandLine; +static fxl::CommandLine gCommandLine; const std::string& GetFontDir() { return gFontDir; @@ -32,11 +32,11 @@ void SetFontDir(const std::string& dir) { gFontDir = dir; } -const ftl::CommandLine& GetCommandLineForProcess() { +const fxl::CommandLine& GetCommandLineForProcess() { return gCommandLine; } -void SetCommandLine(ftl::CommandLine cmd) { +void SetCommandLine(fxl::CommandLine cmd) { gCommandLine = std::move(cmd); } diff --git a/third_party/txt/tests/utils.h b/third_party/txt/tests/utils.h index 8ff70429e9f16..5e6286a364569 100644 --- a/third_party/txt/tests/utils.h +++ b/third_party/txt/tests/utils.h @@ -16,7 +16,7 @@ #include -#include "lib/ftl/command_line.h" +#include "lib/fxl/command_line.h" namespace txt { @@ -24,8 +24,8 @@ const std::string& GetFontDir(); void SetFontDir(const std::string& dir); -const ftl::CommandLine& GetCommandLineForProcess(); +const fxl::CommandLine& GetCommandLineForProcess(); -void SetCommandLine(ftl::CommandLine cmd); +void SetCommandLine(fxl::CommandLine cmd); } // namespace txt diff --git a/vulkan/vulkan_application.cc b/vulkan/vulkan_application.cc index 2ff8776fddf56..f89c6d49b8bcf 100644 --- a/vulkan/vulkan_application.cc +++ b/vulkan/vulkan_application.cc @@ -76,29 +76,29 @@ VulkanApplication::VulkanApplication( if (VK_CALL_LOG_ERROR(vk.CreateInstance(&create_info, nullptr, &instance)) != VK_SUCCESS) { - FTL_DLOG(INFO) << "Could not create application instance."; + FXL_DLOG(INFO) << "Could not create application instance."; return; } // Now that we have an instance, setup instance proc table entries. if (!vk.SetupInstanceProcAddresses(instance)) { - FTL_DLOG(INFO) << "Could not setup instance proc addresses."; + FXL_DLOG(INFO) << "Could not setup instance proc addresses."; return; } instance_ = {instance, [this](VkInstance i) { - FTL_LOG(INFO) << "Destroying Vulkan instance"; + FXL_LOG(INFO) << "Destroying Vulkan instance"; vk.DestroyInstance(i, nullptr); }}; if (enable_instance_debugging) { auto debug_report = std::make_unique(vk, instance_); if (!debug_report->IsValid()) { - FTL_LOG(INFO) << "Vulkan debugging was enabled but could not be setup " + FXL_LOG(INFO) << "Vulkan debugging was enabled but could not be setup " "for this instance."; } else { debug_report_ = std::move(debug_report); - FTL_DLOG(INFO) << "Debug reporting is enabled."; + FXL_DLOG(INFO) << "Debug reporting is enabled."; } } @@ -131,13 +131,13 @@ std::vector VulkanApplication::GetPhysicalDevices() const { uint32_t device_count = 0; if (VK_CALL_LOG_ERROR(vk.EnumeratePhysicalDevices(instance_, &device_count, nullptr)) != VK_SUCCESS) { - FTL_DLOG(INFO) << "Could not enumerate physical device."; + FXL_DLOG(INFO) << "Could not enumerate physical device."; return {}; } if (device_count == 0) { // No available devices. - FTL_DLOG(INFO) << "No physical devices found."; + FXL_DLOG(INFO) << "No physical devices found."; return {}; } @@ -147,7 +147,7 @@ std::vector VulkanApplication::GetPhysicalDevices() const { if (VK_CALL_LOG_ERROR(vk.EnumeratePhysicalDevices( instance_, &device_count, physical_devices.data())) != VK_SUCCESS) { - FTL_DLOG(INFO) << "Could not enumerate physical device."; + FXL_DLOG(INFO) << "Could not enumerate physical device."; return {}; } @@ -162,7 +162,7 @@ VulkanApplication::AcquireFirstCompatibleLogicalDevice() const { return logical_device; } } - FTL_DLOG(INFO) << "Could not acquire compatible logical device."; + FXL_DLOG(INFO) << "Could not acquire compatible logical device."; return nullptr; } diff --git a/vulkan/vulkan_application.h b/vulkan/vulkan_application.h index c8105b8d20caa..6d284803d9ebb 100644 --- a/vulkan/vulkan_application.h +++ b/vulkan/vulkan_application.h @@ -10,7 +10,7 @@ #include #include "flutter/vulkan/vulkan_debug_report.h" #include "flutter/vulkan/vulkan_handle.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace vulkan { @@ -51,7 +51,7 @@ class VulkanApplication { std::vector GetPhysicalDevices() const; - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanApplication); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanApplication); }; } // namespace vulkan diff --git a/vulkan/vulkan_backbuffer.cc b/vulkan/vulkan_backbuffer.cc index 86450f406c907..e12a037f3dd6a 100644 --- a/vulkan/vulkan_backbuffer.cc +++ b/vulkan/vulkan_backbuffer.cc @@ -21,17 +21,17 @@ VulkanBackbuffer::VulkanBackbuffer(const VulkanProcTable& p_vk, render_command_buffer_(p_vk, device, pool), valid_(false) { if (!usage_command_buffer_.IsValid() || !render_command_buffer_.IsValid()) { - FTL_DLOG(INFO) << "Command buffers were not valid."; + FXL_DLOG(INFO) << "Command buffers were not valid."; return; } if (!CreateSemaphores()) { - FTL_DLOG(INFO) << "Could not create semaphores."; + FXL_DLOG(INFO) << "Could not create semaphores."; return; } if (!CreateFences()) { - FTL_DLOG(INFO) << "Could not create fences."; + FXL_DLOG(INFO) << "Could not create fences."; return; } @@ -39,7 +39,7 @@ VulkanBackbuffer::VulkanBackbuffer(const VulkanProcTable& p_vk, } VulkanBackbuffer::~VulkanBackbuffer() { - FTL_ALLOW_UNUSED_LOCAL(WaitFences()); + FXL_ALLOW_UNUSED_LOCAL(WaitFences()); } bool VulkanBackbuffer::IsValid() const { diff --git a/vulkan/vulkan_backbuffer.h b/vulkan/vulkan_backbuffer.h index ff752b851662a..ccf76bfc832ff 100644 --- a/vulkan/vulkan_backbuffer.h +++ b/vulkan/vulkan_backbuffer.h @@ -9,8 +9,8 @@ #include "flutter/vulkan/vulkan_command_buffer.h" #include "flutter/vulkan/vulkan_handle.h" -#include "lib/ftl/compiler_specific.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/core/SkSurface.h" @@ -26,10 +26,10 @@ class VulkanBackbuffer { bool IsValid() const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool WaitFences(); - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool ResetFences(); const VulkanHandle& GetUsageFence() const; @@ -57,7 +57,7 @@ class VulkanBackbuffer { bool CreateFences(); - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanBackbuffer); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanBackbuffer); }; } // namespace vulkan diff --git a/vulkan/vulkan_command_buffer.cc b/vulkan/vulkan_command_buffer.cc index e36b4005776e5..02a7af700a36d 100644 --- a/vulkan/vulkan_command_buffer.cc +++ b/vulkan/vulkan_command_buffer.cc @@ -25,7 +25,7 @@ VulkanCommandBuffer::VulkanCommandBuffer( if (VK_CALL_LOG_ERROR(vk.AllocateCommandBuffers(device_, &allocate_info, &buffer)) != VK_SUCCESS) { - FTL_DLOG(INFO) << "Could not allocate command buffers."; + FXL_DLOG(INFO) << "Could not allocate command buffers."; return; } diff --git a/vulkan/vulkan_command_buffer.h b/vulkan/vulkan_command_buffer.h index 2c337bf8bc8a4..fa419b4874215 100644 --- a/vulkan/vulkan_command_buffer.h +++ b/vulkan/vulkan_command_buffer.h @@ -6,8 +6,8 @@ #define FLUTTER_VULKAN_VULKAN_COMMAND_BUFFER_H_ #include "flutter/vulkan/vulkan_handle.h" -#include "lib/ftl/compiler_specific.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" namespace vulkan { @@ -25,13 +25,13 @@ class VulkanCommandBuffer { VkCommandBuffer Handle() const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool Begin() const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool End() const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool InsertPipelineBarrier( VkPipelineStageFlagBits src_stage_flags, VkPipelineStageFlagBits dest_stage_flags, @@ -50,7 +50,7 @@ class VulkanCommandBuffer { VulkanHandle handle_; bool valid_; - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanCommandBuffer); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanCommandBuffer); }; } // namespace vulkan diff --git a/vulkan/vulkan_debug_report.cc b/vulkan/vulkan_debug_report.cc index b24bc00645e86..5fca3a93e7473 100644 --- a/vulkan/vulkan_debug_report.cc +++ b/vulkan/vulkan_debug_report.cc @@ -11,11 +11,11 @@ namespace vulkan { -static const VkDebugReportFlagsEXT kVulkanErrorFlags FTL_ALLOW_UNUSED_TYPE = +static const VkDebugReportFlagsEXT kVulkanErrorFlags FXL_ALLOW_UNUSED_TYPE = VK_DEBUG_REPORT_WARNING_BIT_EXT | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT | VK_DEBUG_REPORT_ERROR_BIT_EXT; -static const VkDebugReportFlagsEXT kVulkanInfoFlags FTL_ALLOW_UNUSED_TYPE = +static const VkDebugReportFlagsEXT kVulkanInfoFlags FXL_ALLOW_UNUSED_TYPE = VK_DEBUG_REPORT_INFORMATION_BIT_EXT | VK_DEBUG_REPORT_DEBUG_BIT_EXT; std::string VulkanDebugReport::DebugExtensionName() { @@ -202,12 +202,12 @@ OnVulkanDebugReportCallback(VkDebugReportFlagsEXT flags, if (flags & kVulkanErrorFlags) { if (ValidationErrorsFatal()) { - FTL_DCHECK(false) << stream.str(); + FXL_DCHECK(false) << stream.str(); } else { - FTL_LOG(ERROR) << stream.str(); + FXL_LOG(ERROR) << stream.str(); } } else { - FTL_LOG(INFO) << stream.str(); + FXL_LOG(INFO) << stream.str(); } // Returning false tells the layer not to stop when the event occurs, so diff --git a/vulkan/vulkan_debug_report.h b/vulkan/vulkan_debug_report.h index 112a87d082e76..e675f55312c00 100644 --- a/vulkan/vulkan_debug_report.h +++ b/vulkan/vulkan_debug_report.h @@ -8,7 +8,7 @@ #include "flutter/vulkan/vulkan_handle.h" #include "flutter/vulkan/vulkan_interface.h" #include "flutter/vulkan/vulkan_proc_table.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace vulkan { @@ -31,7 +31,7 @@ class VulkanDebugReport { VulkanHandle handle_; bool valid_; - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanDebugReport); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanDebugReport); }; } // namespace vulkan diff --git a/vulkan/vulkan_device.cc b/vulkan/vulkan_device.cc index fa81fbaa6bef1..37f788a9f874b 100644 --- a/vulkan/vulkan_device.cc +++ b/vulkan/vulkan_device.cc @@ -43,7 +43,7 @@ VulkanDevice::VulkanDevice(VulkanProcTable& p_vk, graphics_queue_index_ = FindGraphicsQueueIndex(GetQueueFamilyProperties()); if (graphics_queue_index_ == kVulkanInvalidGraphicsQueueIndex) { - FTL_DLOG(INFO) << "Could not find the graphics queue index."; + FXL_DLOG(INFO) << "Could not find the graphics queue index."; return; } @@ -92,7 +92,7 @@ VulkanDevice::VulkanDevice(VulkanProcTable& p_vk, if (VK_CALL_LOG_ERROR(vk.CreateDevice(physical_device_, &create_info, nullptr, &device)) != VK_SUCCESS) { - FTL_DLOG(INFO) << "Could not create device."; + FXL_DLOG(INFO) << "Could not create device."; return; } @@ -100,7 +100,7 @@ VulkanDevice::VulkanDevice(VulkanProcTable& p_vk, [this](VkDevice device) { vk.DestroyDevice(device, nullptr); }}; if (!vk.SetupDeviceProcAddresses(device_)) { - FTL_DLOG(INFO) << "Could not setup device proc addresses."; + FXL_DLOG(INFO) << "Could not setup device proc addresses."; return; } @@ -109,7 +109,7 @@ VulkanDevice::VulkanDevice(VulkanProcTable& p_vk, vk.GetDeviceQueue(device_, graphics_queue_index_, 0, &queue); if (queue == VK_NULL_HANDLE) { - FTL_DLOG(INFO) << "Could not get the device queue handle."; + FXL_DLOG(INFO) << "Could not get the device queue handle."; return; } @@ -126,7 +126,7 @@ VulkanDevice::VulkanDevice(VulkanProcTable& p_vk, if (VK_CALL_LOG_ERROR(vk.CreateCommandPool(device_, &command_pool_create_info, nullptr, &command_pool)) != VK_SUCCESS) { - FTL_DLOG(INFO) << "Could not create the command pool."; + FXL_DLOG(INFO) << "Could not create the command pool."; return; } @@ -138,7 +138,7 @@ VulkanDevice::VulkanDevice(VulkanProcTable& p_vk, } VulkanDevice::~VulkanDevice() { - FTL_ALLOW_UNUSED_LOCAL(WaitIdle()); + FXL_ALLOW_UNUSED_LOCAL(WaitIdle()); } bool VulkanDevice::IsValid() const { diff --git a/vulkan/vulkan_device.h b/vulkan/vulkan_device.h index 5d81f2aac73ae..bbb7fb66fbcee 100644 --- a/vulkan/vulkan_device.h +++ b/vulkan/vulkan_device.h @@ -8,8 +8,8 @@ #include #include "flutter/vulkan/vulkan_handle.h" -#include "lib/ftl/compiler_specific.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" namespace vulkan { @@ -37,33 +37,33 @@ class VulkanDevice { void ReleaseDeviceOwnership(); - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool GetSurfaceCapabilities(const VulkanSurface& surface, VkSurfaceCapabilitiesKHR* capabilities) const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool GetPhysicalDeviceFeatures(VkPhysicalDeviceFeatures* features) const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool GetPhysicalDeviceFeaturesSkia( uint32_t* /* mask of GrVkFeatureFlags */ features) const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool ChooseSurfaceFormat(const VulkanSurface& surface, VkSurfaceFormatKHR* format) const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool ChoosePresentMode(const VulkanSurface& surface, VkPresentModeKHR* present_mode) const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool QueueSubmit(std::vector wait_dest_pipeline_stages, const std::vector& wait_semaphores, const std::vector& signal_semaphores, const std::vector& command_buffers, const VulkanHandle& fence) const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool WaitIdle() const; private: @@ -77,7 +77,7 @@ class VulkanDevice { std::vector GetQueueFamilyProperties() const; - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanDevice); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanDevice); }; } // namespace vulkan diff --git a/vulkan/vulkan_handle.h b/vulkan/vulkan_handle.h index 260d5e9d1b5db..327f4f3b2c12a 100644 --- a/vulkan/vulkan_handle.h +++ b/vulkan/vulkan_handle.h @@ -7,8 +7,8 @@ #include -#include "lib/ftl/logging.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/macros.h" #include "vulkan_interface.h" namespace vulkan { @@ -72,7 +72,7 @@ class VulkanHandle { disposer_ = nullptr; } - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanHandle); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanHandle); }; } // namespace vulkan diff --git a/vulkan/vulkan_image.h b/vulkan/vulkan_image.h index 386dd2ef26e08..776d34117ec12 100644 --- a/vulkan/vulkan_image.h +++ b/vulkan/vulkan_image.h @@ -6,8 +6,8 @@ #define FLUTTER_VULKAN_VULKAN_IMAGE_H_ #include "flutter/vulkan/vulkan_handle.h" -#include "lib/ftl/compiler_specific.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" namespace vulkan { @@ -22,7 +22,7 @@ class VulkanImage { bool IsValid() const; - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool InsertImageMemoryBarrier(const VulkanCommandBuffer& command_buffer, VkPipelineStageFlagBits src_pipline_bits, VkPipelineStageFlagBits dest_pipline_bits, @@ -35,7 +35,7 @@ class VulkanImage { uint32_t /* mask of VkAccessFlagBits */ access_flags_; bool valid_; - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanImage); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanImage); }; } // namespace vulkan diff --git a/vulkan/vulkan_interface.h b/vulkan/vulkan_interface.h index 92d83e7164c7d..2eb7ff5bd1a38 100644 --- a/vulkan/vulkan_interface.h +++ b/vulkan/vulkan_interface.h @@ -7,8 +7,8 @@ #include -#include "lib/ftl/build_config.h" -#include "lib/ftl/logging.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/logging.h" #define VULKAN_LINK_STATICALLY OS_FUCHSIA @@ -36,7 +36,7 @@ ({ \ __typeof__(expression) _rc = (expression); \ if (_rc != VK_SUCCESS) { \ - FTL_DLOG(INFO) << "Vulkan call '" << #expression \ + FXL_DLOG(INFO) << "Vulkan call '" << #expression \ << "' failed with error " \ << vulkan::VulkanResultToString(_rc); \ } \ diff --git a/vulkan/vulkan_native_surface.h b/vulkan/vulkan_native_surface.h index a8f0fb85528a9..bf52736281477 100644 --- a/vulkan/vulkan_native_surface.h +++ b/vulkan/vulkan_native_surface.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_VULKAN_VULKAN_NATIVE_SURFACE_H_ #define FLUTTER_VULKAN_VULKAN_NATIVE_SURFACE_H_ -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkSize.h" #include "vulkan_handle.h" #include "vulkan_proc_table.h" diff --git a/vulkan/vulkan_native_surface_android.h b/vulkan/vulkan_native_surface_android.h index 260dadea622c1..16d5e90742812 100644 --- a/vulkan/vulkan_native_surface_android.h +++ b/vulkan/vulkan_native_surface_android.h @@ -6,7 +6,7 @@ #define FLUTTER_VULKAN_VULKAN_NATIVE_SURFACE_ANDROID_H_ #include "flutter/vulkan/vulkan_native_surface.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" struct ANativeWindow; typedef struct ANativeWindow ANativeWindow; @@ -36,7 +36,7 @@ class VulkanNativeSurfaceAndroid : public VulkanNativeSurface { private: ANativeWindow* native_window_; - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanNativeSurfaceAndroid); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanNativeSurfaceAndroid); }; } // namespace vulkan diff --git a/vulkan/vulkan_native_surface_magma.h b/vulkan/vulkan_native_surface_magma.h index 8a1c0281fd2ad..b9ea61db5a802 100644 --- a/vulkan/vulkan_native_surface_magma.h +++ b/vulkan/vulkan_native_surface_magma.h @@ -6,7 +6,7 @@ #define FLUTTER_VULKAN_VULKAN_NATIVE_SURFACE_MAGMA_H_ #include "flutter/vulkan/vulkan_native_surface.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace vulkan { @@ -35,7 +35,7 @@ class VulkanNativeSurfaceMagma : public vulkan::VulkanNativeSurface { private: SkISize size_; - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanNativeSurfaceMagma); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanNativeSurfaceMagma); }; } // namespace vulkan diff --git a/vulkan/vulkan_proc_table.cc b/vulkan/vulkan_proc_table.cc index 25e398d6b9999..5828b4aabeec3 100644 --- a/vulkan/vulkan_proc_table.cc +++ b/vulkan/vulkan_proc_table.cc @@ -6,11 +6,11 @@ #include -#include "lib/ftl/logging.h" +#include "lib/fxl/logging.h" #define ACQUIRE_PROC(name, context) \ if (!(name = AcquireProc("vk" #name, context))) { \ - FTL_DLOG(INFO) << "Could not acquire proc: vk" << #name; \ + FXL_DLOG(INFO) << "Could not acquire proc: vk" << #name; \ return false; \ } @@ -56,7 +56,7 @@ bool VulkanProcTable::SetupLoaderProcAddresses() { #endif // VULKAN_LINK_STATICALLY if (!GetInstanceProcAddr) { - FTL_DLOG(WARNING) << "Could not acquire vkGetInstanceProcAddr."; + FXL_DLOG(WARNING) << "Could not acquire vkGetInstanceProcAddr."; return false; } @@ -162,7 +162,7 @@ bool VulkanProcTable::OpenLibraryHandle() { dlerror(); // clear existing errors on thread. handle_ = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL); if (handle_ == nullptr) { - FTL_DLOG(WARNING) << "Could not open the vulkan library: " << dlerror(); + FXL_DLOG(WARNING) << "Could not open the vulkan library: " << dlerror(); return false; } return true; @@ -177,9 +177,9 @@ bool VulkanProcTable::CloseLibraryHandle() { if (handle_ != nullptr) { dlerror(); // clear existing errors on thread. if (dlclose(handle_) != 0) { - FTL_DLOG(ERROR) << "Could not close the vulkan library handle. This " + FXL_DLOG(ERROR) << "Could not close the vulkan library handle. This " "indicates a leak."; - FTL_DLOG(ERROR) << dlerror(); + FXL_DLOG(ERROR) << dlerror(); } handle_ = nullptr; } diff --git a/vulkan/vulkan_proc_table.h b/vulkan/vulkan_proc_table.h index 4c5ea8fabab04..48a2d6e97bbbe 100644 --- a/vulkan/vulkan_proc_table.h +++ b/vulkan/vulkan_proc_table.h @@ -7,15 +7,15 @@ #include "flutter/vulkan/vulkan_handle.h" #include "flutter/vulkan/vulkan_interface.h" -#include "lib/ftl/macros.h" -#include "lib/ftl/memory/ref_counted.h" -#include "lib/ftl/memory/ref_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" #include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/gpu/vk/GrVkInterface.h" namespace vulkan { -class VulkanProcTable : public ftl::RefCountedThreadSafe { +class VulkanProcTable : public fxl::RefCountedThreadSafe { FRIEND_REF_COUNTED_THREAD_SAFE(VulkanProcTable); FRIEND_MAKE_REF_COUNTED(VulkanProcTable); @@ -140,7 +140,7 @@ class VulkanProcTable : public ftl::RefCountedThreadSafe { PFN_vkVoidFunction AcquireProc(const char* proc_name, const VulkanHandle& device) const; - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanProcTable); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanProcTable); }; } // namespace vulkan diff --git a/vulkan/vulkan_surface.cc b/vulkan/vulkan_surface.cc index a7af646cf0b1b..299fa0a40d7df 100644 --- a/vulkan/vulkan_surface.cc +++ b/vulkan/vulkan_surface.cc @@ -18,7 +18,7 @@ VulkanSurface::VulkanSurface( native_surface_(std::move(native_surface)), valid_(false) { if (native_surface_ == nullptr || !native_surface_->IsValid()) { - FTL_DLOG(INFO) << "Native surface was invalid."; + FXL_DLOG(INFO) << "Native surface was invalid."; return; } @@ -26,7 +26,7 @@ VulkanSurface::VulkanSurface( native_surface_->CreateSurfaceHandle(vk, application.GetInstance()); if (surface == VK_NULL_HANDLE) { - FTL_DLOG(INFO) << "Could not create the surface handle."; + FXL_DLOG(INFO) << "Could not create the surface handle."; return; } diff --git a/vulkan/vulkan_surface.h b/vulkan/vulkan_surface.h index de6ed193ac04d..358b3caa04905 100644 --- a/vulkan/vulkan_surface.h +++ b/vulkan/vulkan_surface.h @@ -6,7 +6,7 @@ #define FLUTTER_VULKAN_VULKAN_SURFACE_H_ #include "flutter/vulkan/vulkan_handle.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkSize.h" namespace vulkan { @@ -39,7 +39,7 @@ class VulkanSurface { VulkanHandle surface_; bool valid_; - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanSurface); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurface); }; } // namespace vulkan diff --git a/vulkan/vulkan_swapchain.cc b/vulkan/vulkan_swapchain.cc index 0c515d80acf8a..16d8c9f06b00f 100644 --- a/vulkan/vulkan_swapchain.cc +++ b/vulkan/vulkan_swapchain.cc @@ -30,23 +30,23 @@ VulkanSwapchain::VulkanSwapchain(const VulkanProcTable& p_vk, current_image_index_(0), valid_(false) { if (!device_.IsValid() || !surface.IsValid() || skia_context == nullptr) { - FTL_DLOG(INFO) << "Device or surface is invalid."; + FXL_DLOG(INFO) << "Device or surface is invalid."; return; } if (!device_.GetSurfaceCapabilities(surface, &capabilities_)) { - FTL_DLOG(INFO) << "Could not find surface capabilities."; + FXL_DLOG(INFO) << "Could not find surface capabilities."; return; } if (!device_.ChooseSurfaceFormat(surface, &surface_format_)) { - FTL_DLOG(INFO) << "Could not choose surface format."; + FXL_DLOG(INFO) << "Could not choose surface format."; return; } VkPresentModeKHR present_mode = VK_PRESENT_MODE_FIFO_KHR; if (!device_.ChoosePresentMode(surface, &present_mode)) { - FTL_DLOG(INFO) << "Could not choose present mode."; + FXL_DLOG(INFO) << "Could not choose present mode."; return; } @@ -58,12 +58,12 @@ VulkanSwapchain::VulkanSwapchain(const VulkanProcTable& p_vk, queue_family_index, // queue family surface.Handle(), // surface to test &supported)) != VK_SUCCESS) { - FTL_DLOG(INFO) << "Could not get physical device surface support."; + FXL_DLOG(INFO) << "Could not get physical device surface support."; return; } if (supported != VK_TRUE) { - FTL_DLOG(INFO) << "Surface was not supported by the physical device."; + FXL_DLOG(INFO) << "Surface was not supported by the physical device."; return; } @@ -105,18 +105,18 @@ VulkanSwapchain::VulkanSwapchain(const VulkanProcTable& p_vk, if (VK_CALL_LOG_ERROR(vk.CreateSwapchainKHR(device_.GetHandle(), &create_info, nullptr, &swapchain)) != VK_SUCCESS) { - FTL_DLOG(INFO) << "Could not create the swapchain."; + FXL_DLOG(INFO) << "Could not create the swapchain."; return; } swapchain_ = {swapchain, [this](VkSwapchainKHR swapchain) { - FTL_ALLOW_UNUSED_LOCAL(device_.WaitIdle()); + FXL_ALLOW_UNUSED_LOCAL(device_.WaitIdle()); vk.DestroySwapchainKHR(device_.GetHandle(), swapchain, nullptr); }}; if (!CreateSwapchainImages(skia_context)) { - FTL_DLOG(INFO) << "Could not create swapchain images."; + FXL_DLOG(INFO) << "Could not create swapchain images."; return; } @@ -259,8 +259,8 @@ bool VulkanSwapchain::CreateSwapchainImages(GrContext* skia_context) { surfaces_.emplace_back(std::move(surface)); } - FTL_DCHECK(backbuffers_.size() == images_.size()); - FTL_DCHECK(images_.size() == surfaces_.size()); + FXL_DCHECK(backbuffers_.size() == images_.size()); + FXL_DCHECK(images_.size() == surfaces_.size()); return true; } @@ -289,7 +289,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { AcquireResult error = {AcquireStatus::ErrorSurfaceLost, nullptr}; if (!IsValid()) { - FTL_DLOG(INFO) << "Swapchain was invalid."; + FXL_DLOG(INFO) << "Swapchain was invalid."; return error; } @@ -300,7 +300,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { auto backbuffer = GetNextBackbuffer(); if (backbuffer == nullptr) { - FTL_DLOG(INFO) << "Could not get the next backbuffer."; + FXL_DLOG(INFO) << "Could not get the next backbuffer."; return error; } @@ -309,7 +309,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { // Wait for use readiness. // --------------------------------------------------------------------------- if (!backbuffer->WaitFences()) { - FTL_DLOG(INFO) << "Failed waiting on fences."; + FXL_DLOG(INFO) << "Failed waiting on fences."; return error; } @@ -318,7 +318,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { // Put semaphores in unsignaled state. // --------------------------------------------------------------------------- if (!backbuffer->ResetFences()) { - FTL_DLOG(INFO) << "Could not reset fences."; + FXL_DLOG(INFO) << "Could not reset fences."; return error; } @@ -344,20 +344,20 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { case VK_ERROR_SURFACE_LOST_KHR: return {AcquireStatus::ErrorSurfaceLost, nullptr}; default: - FTL_LOG(INFO) << "Unexpected result from AcquireNextImageKHR: " + FXL_LOG(INFO) << "Unexpected result from AcquireNextImageKHR: " << acquire_result; return {AcquireStatus::ErrorSurfaceLost, nullptr}; } // Simple sanity checking of image index. if (next_image_index >= images_.size()) { - FTL_DLOG(INFO) << "Image index returned was out-of-bounds."; + FXL_DLOG(INFO) << "Image index returned was out-of-bounds."; return error; } auto& image = images_[next_image_index]; if (!image->IsValid()) { - FTL_DLOG(INFO) << "Image at index was invalid."; + FXL_DLOG(INFO) << "Image at index was invalid."; return error; } @@ -366,7 +366,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { // Start recording to the command buffer. // --------------------------------------------------------------------------- if (!backbuffer->GetUsageCommandBuffer().Begin()) { - FTL_DLOG(INFO) << "Could not begin recording to the command buffer."; + FXL_DLOG(INFO) << "Could not begin recording to the command buffer."; return error; } @@ -386,7 +386,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // dest_access_flags destination_image_layout // dest_layout )) { - FTL_DLOG(INFO) << "Could not insert image memory barrier."; + FXL_DLOG(INFO) << "Could not insert image memory barrier."; return error; } else { current_pipeline_stage_ = destination_pipeline_stage; @@ -397,7 +397,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { // End recording to the command buffer. // --------------------------------------------------------------------------- if (!backbuffer->GetUsageCommandBuffer().End()) { - FTL_DLOG(INFO) << "Could not end recording to the command buffer."; + FXL_DLOG(INFO) << "Could not end recording to the command buffer."; return error; } @@ -417,7 +417,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { command_buffers, // command_buffers backbuffer->GetUsageFence() // fence )) { - FTL_DLOG(INFO) << "Could not submit to the device queue."; + FXL_DLOG(INFO) << "Could not submit to the device queue."; return error; } @@ -428,7 +428,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { sk_sp surface = surfaces_[next_image_index]; if (surface == nullptr) { - FTL_DLOG(INFO) << "Could not access surface at the image index."; + FXL_DLOG(INFO) << "Could not access surface at the image index."; return error; } @@ -436,7 +436,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { if (!surface->getRenderTargetHandle( reinterpret_cast(&image_info), SkSurface::kFlushRead_BackendHandleAccess)) { - FTL_DLOG(INFO) << "Could not get render target handle."; + FXL_DLOG(INFO) << "Could not get render target handle."; return error; } @@ -448,7 +448,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { bool VulkanSwapchain::Submit() { if (!IsValid()) { - FTL_DLOG(INFO) << "Swapchain was invalid."; + FXL_DLOG(INFO) << "Swapchain was invalid."; return false; } @@ -464,7 +464,7 @@ bool VulkanSwapchain::Submit() { if (!surface->getRenderTargetHandle( reinterpret_cast(&image_info), SkSurface::kFlushRead_BackendHandleAccess)) { - FTL_DLOG(INFO) << "Could not get render target handle."; + FXL_DLOG(INFO) << "Could not get render target handle."; return false; } @@ -473,7 +473,7 @@ bool VulkanSwapchain::Submit() { // Start recording to the command buffer. // --------------------------------------------------------------------------- if (!backbuffer->GetRenderCommandBuffer().Begin()) { - FTL_DLOG(INFO) << "Could not start recording to the command buffer."; + FXL_DLOG(INFO) << "Could not start recording to the command buffer."; return false; } @@ -492,7 +492,7 @@ bool VulkanSwapchain::Submit() { VK_ACCESS_MEMORY_READ_BIT, // dest_access_flags destination_image_layout // dest_layout )) { - FTL_DLOG(INFO) << "Could not insert memory barrier."; + FXL_DLOG(INFO) << "Could not insert memory barrier."; return false; } else { current_pipeline_stage_ = destination_pipeline_stage; @@ -503,7 +503,7 @@ bool VulkanSwapchain::Submit() { // End recording to the command buffer. // --------------------------------------------------------------------------- if (!backbuffer->GetRenderCommandBuffer().End()) { - FTL_DLOG(INFO) << "Could not end recording to the command buffer."; + FXL_DLOG(INFO) << "Could not end recording to the command buffer."; return false; } @@ -525,7 +525,7 @@ bool VulkanSwapchain::Submit() { command_buffers, // command_buffers backbuffer->GetRenderFence() // fence )) { - FTL_DLOG(INFO) << "Could not submit to the device queue."; + FXL_DLOG(INFO) << "Could not submit to the device queue."; return false; } @@ -549,7 +549,7 @@ bool VulkanSwapchain::Submit() { if (VK_CALL_LOG_ERROR(vk.QueuePresentKHR(device_.GetQueueHandle(), &present_info)) != VK_SUCCESS) { - FTL_DLOG(INFO) << "Could not submit the present operation."; + FXL_DLOG(INFO) << "Could not submit the present operation."; return false; } diff --git a/vulkan/vulkan_swapchain.h b/vulkan/vulkan_swapchain.h index 6cc2922ebdfd0..43cfe8a9c88ce 100644 --- a/vulkan/vulkan_swapchain.h +++ b/vulkan/vulkan_swapchain.h @@ -10,8 +10,8 @@ #include #include "flutter/vulkan/vulkan_handle.h" -#include "lib/ftl/compiler_specific.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/core/SkSurface.h" @@ -56,7 +56,7 @@ class VulkanSwapchain { /// Submit a previously acquired. There must not be consecutive calls to /// |Submit| without and interleaving |AcquireFrame|. - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool Submit(); SkISize GetSize() const; @@ -85,7 +85,7 @@ class VulkanSwapchain { VulkanBackbuffer* GetNextBackbuffer(); - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanSwapchain); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSwapchain); }; } // namespace vulkan diff --git a/vulkan/vulkan_utilities.h b/vulkan/vulkan_utilities.h index 067f73a115ec5..19002e31629ad 100644 --- a/vulkan/vulkan_utilities.h +++ b/vulkan/vulkan_utilities.h @@ -10,7 +10,7 @@ #include "flutter/vulkan/vulkan_handle.h" #include "flutter/vulkan/vulkan_proc_table.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/macros.h" namespace vulkan { diff --git a/vulkan/vulkan_window.cc b/vulkan/vulkan_window.cc index 7032e4f3e842c..00c57ac002762 100644 --- a/vulkan/vulkan_window.cc +++ b/vulkan/vulkan_window.cc @@ -17,16 +17,16 @@ namespace vulkan { -VulkanWindow::VulkanWindow(ftl::RefPtr proc_table, +VulkanWindow::VulkanWindow(fxl::RefPtr proc_table, std::unique_ptr native_surface) : valid_(false), vk(std::move(proc_table)) { if (!vk || !vk->HasAcquiredMandatoryProcAddresses()) { - FTL_DLOG(INFO) << "Proc table has not acquired mandatory proc addresses."; + FXL_DLOG(INFO) << "Proc table has not acquired mandatory proc addresses."; return; } if (native_surface == nullptr || !native_surface->IsValid()) { - FTL_DLOG(INFO) << "Native surface is invalid."; + FXL_DLOG(INFO) << "Native surface is invalid."; return; } @@ -43,7 +43,7 @@ VulkanWindow::VulkanWindow(ftl::RefPtr proc_table, if (!application_->IsValid() || !vk->AreInstanceProcsSetup()) { // Make certain the application instance was created and it setup the // instance proc table entries. - FTL_DLOG(INFO) << "Instance proc addresses have not been setup."; + FXL_DLOG(INFO) << "Instance proc addresses have not been setup."; return; } @@ -55,7 +55,7 @@ VulkanWindow::VulkanWindow(ftl::RefPtr proc_table, !vk->AreDeviceProcsSetup()) { // Make certain the device was created and it setup the device proc table // entries. - FTL_DLOG(INFO) << "Device proc addresses have not been setup."; + FXL_DLOG(INFO) << "Device proc addresses have not been setup."; return; } @@ -65,21 +65,21 @@ VulkanWindow::VulkanWindow(ftl::RefPtr proc_table, std::move(native_surface)); if (!surface_->IsValid()) { - FTL_DLOG(INFO) << "Vulkan surface is invalid."; + FXL_DLOG(INFO) << "Vulkan surface is invalid."; return; } // Create the Skia GrContext. if (!CreateSkiaGrContext()) { - FTL_DLOG(INFO) << "Could not create Skia context."; + FXL_DLOG(INFO) << "Could not create Skia context."; return; } // Create the swapchain. if (!RecreateSwapchain()) { - FTL_DLOG(INFO) << "Could not setup the swapchain initially."; + FXL_DLOG(INFO) << "Could not setup the swapchain initially."; return; } @@ -153,7 +153,7 @@ sk_sp VulkanWindow::CreateSkiaBackendContext() { sk_sp VulkanWindow::AcquireSurface() { if (!IsValid()) { - FTL_DLOG(INFO) << "Surface is invalid."; + FXL_DLOG(INFO) << "Surface is invalid."; return nullptr; } @@ -167,10 +167,10 @@ sk_sp VulkanWindow::AcquireSurface() { // size. if (surface_size != SkISize::Make(0, 0) && surface_size != swapchain_->GetSize()) { - FTL_DLOG(INFO) << "Swapchain and surface sizes are out of sync. Recreating " + FXL_DLOG(INFO) << "Swapchain and surface sizes are out of sync. Recreating " "swapchain."; if (!RecreateSwapchain()) { - FTL_DLOG(INFO) << "Could not recreate swapchain."; + FXL_DLOG(INFO) << "Could not recreate swapchain."; valid_ = false; return nullptr; } @@ -189,7 +189,7 @@ sk_sp VulkanWindow::AcquireSurface() { if (acquire_result == VulkanSwapchain::AcquireStatus::ErrorSurfaceLost) { // Surface is lost. This is an unrecoverable error. - FTL_DLOG(INFO) << "Swapchain reported surface was lost."; + FXL_DLOG(INFO) << "Swapchain reported surface was lost."; return nullptr; } @@ -201,7 +201,7 @@ sk_sp VulkanWindow::AcquireSurface() { continue; } else { // Could not recreate the swapchain at the new configuration. - FTL_DLOG(INFO) << "Swapchain reported surface was out of date but " + FXL_DLOG(INFO) << "Swapchain reported surface was out of date but " "could not recreate the swapchain at the new " "configuration."; valid_ = false; @@ -212,13 +212,13 @@ sk_sp VulkanWindow::AcquireSurface() { break; } - FTL_DCHECK(false) << "Unhandled VulkanSwapchain::AcquireResult"; + FXL_DCHECK(false) << "Unhandled VulkanSwapchain::AcquireResult"; return nullptr; } bool VulkanWindow::SwapBuffers() { if (!IsValid()) { - FTL_DLOG(INFO) << "Window was invalid."; + FXL_DLOG(INFO) << "Window was invalid."; return false; } diff --git a/vulkan/vulkan_window.h b/vulkan/vulkan_window.h index a0c8052366228..891589e5a413f 100644 --- a/vulkan/vulkan_window.h +++ b/vulkan/vulkan_window.h @@ -11,8 +11,8 @@ #include #include "flutter/vulkan/vulkan_proc_table.h" -#include "lib/ftl/compiler_specific.h" -#include "lib/ftl/macros.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/core/SkSurface.h" @@ -31,7 +31,7 @@ class VulkanBackbuffer; class VulkanWindow { public: - VulkanWindow(ftl::RefPtr proc_table, + VulkanWindow(fxl::RefPtr proc_table, std::unique_ptr native_surface); ~VulkanWindow(); @@ -46,7 +46,7 @@ class VulkanWindow { private: bool valid_; - ftl::RefPtr vk; + fxl::RefPtr vk; // Note: The order of objects here is important because the // GrVkBackendContext assumes ownership of the device and instance handles. sk_sp skia_vk_backend_context_; @@ -60,10 +60,10 @@ class VulkanWindow { sk_sp CreateSkiaBackendContext(); - FTL_WARN_UNUSED_RESULT + FXL_WARN_UNUSED_RESULT bool RecreateSwapchain(); - FTL_DISALLOW_COPY_AND_ASSIGN(VulkanWindow); + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanWindow); }; } // namespace vulkan