From 4dd267959f0bf0652ceb97ca4d64adb4b02933f9 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 9 Apr 2019 17:10:46 -0700 Subject: [PATCH] Rename the shell namespace to flutter. (flutter/engine#8520) --- .../ci/licenses_golden/licenses_flutter | 4 +- engine/src/flutter/lib/ui/io_manager.h | 2 + engine/src/flutter/shell/common/BUILD.gn | 4 +- engine/src/flutter/shell/common/animator.cc | 4 +- engine/src/flutter/shell/common/animator.h | 4 +- engine/src/flutter/shell/common/engine.cc | 6 +- engine/src/flutter/shell/common/engine.h | 6 +- .../shell/common/isolate_configuration.cc | 10 +- .../shell/common/isolate_configuration.h | 4 +- .../flutter/shell/common/persistent_cache.cc | 4 +- .../flutter/shell/common/persistent_cache.h | 4 +- .../src/flutter/shell/common/platform_view.cc | 4 +- .../src/flutter/shell/common/platform_view.h | 4 +- engine/src/flutter/shell/common/rasterizer.cc | 4 +- engine/src/flutter/shell/common/rasterizer.h | 4 +- .../flutter/shell/common/run_configuration.cc | 4 +- .../flutter/shell/common/run_configuration.h | 4 +- engine/src/flutter/shell/common/shell.cc | 50 +++---- engine/src/flutter/shell/common/shell.h | 48 +++---- .../flutter/shell/common/shell_benchmarks.cc | 4 +- .../{io_manager.cc => shell_io_manager.cc} | 25 ++-- .../{io_manager.h => shell_io_manager.h} | 24 ++-- engine/src/flutter/shell/common/shell_test.cc | 4 +- engine/src/flutter/shell/common/shell_test.h | 4 +- .../flutter/shell/common/shell_unittests.cc | 4 +- .../shell/common/skia_event_tracer_impl.cc | 11 +- .../shell/common/skia_event_tracer_impl.h | 4 + engine/src/flutter/shell/common/surface.cc | 4 +- engine/src/flutter/shell/common/surface.h | 4 +- engine/src/flutter/shell/common/switches.cc | 12 +- engine/src/flutter/shell/common/switches.h | 4 +- .../src/flutter/shell/common/thread_host.cc | 4 +- engine/src/flutter/shell/common/thread_host.h | 4 +- .../src/flutter/shell/common/vsync_waiter.cc | 4 +- .../src/flutter/shell/common/vsync_waiter.h | 4 +- .../shell/common/vsync_waiter_fallback.cc | 6 +- .../shell/common/vsync_waiter_fallback.h | 6 +- .../src/flutter/shell/gpu/gpu_surface_gl.cc | 16 +-- engine/src/flutter/shell/gpu/gpu_surface_gl.h | 16 +-- .../shell/gpu/gpu_surface_gl_delegate.cc | 8 +- .../shell/gpu/gpu_surface_gl_delegate.h | 4 +- .../flutter/shell/gpu/gpu_surface_software.cc | 14 +- .../flutter/shell/gpu/gpu_surface_software.h | 14 +- .../flutter/shell/gpu/gpu_surface_vulkan.cc | 12 +- .../flutter/shell/gpu/gpu_surface_vulkan.h | 12 +- .../platform/android/android_context_gl.cc | 4 +- .../platform/android/android_context_gl.h | 4 +- .../android/android_environment_gl.cc | 4 +- .../platform/android/android_environment_gl.h | 4 +- .../android/android_external_texture_gl.cc | 4 +- .../android/android_external_texture_gl.h | 4 +- .../platform/android/android_native_window.cc | 4 +- .../platform/android/android_native_window.h | 4 +- .../platform/android/android_shell_holder.cc | 8 +- .../platform/android/android_shell_holder.h | 4 +- .../shell/platform/android/android_surface.cc | 4 +- .../shell/platform/android/android_surface.h | 4 +- .../platform/android/android_surface_gl.cc | 4 +- .../platform/android/android_surface_gl.h | 26 ++-- .../android/android_surface_software.cc | 4 +- .../android/android_surface_software.h | 22 ++-- .../android/android_surface_vulkan.cc | 16 +-- .../platform/android/android_surface_vulkan.h | 18 +-- .../shell/platform/android/flutter_main.cc | 4 +- .../shell/platform/android/flutter_main.h | 4 +- .../android/io/flutter/view/FlutterMain.java | 2 +- .../shell/platform/android/library_loader.cc | 6 +- .../platform_message_response_android.cc | 4 +- .../platform_message_response_android.h | 4 +- .../platform/android/platform_view_android.cc | 22 ++-- .../platform/android/platform_view_android.h | 20 +-- .../android/platform_view_android_jni.cc | 54 ++++---- .../android/platform_view_android_jni.h | 4 +- .../platform/android/vsync_waiter_android.cc | 6 +- .../platform/android/vsync_waiter_android.h | 6 +- .../common/cpp/incoming_message_dispatcher.cc | 4 +- .../common/cpp/incoming_message_dispatcher.h | 4 +- .../platform/common/cpp/text_input_model.cc | 4 +- .../platform/common/cpp/text_input_model.h | 4 +- .../darwin/common/buffer_conversions.h | 4 +- .../darwin/common/buffer_conversions.mm | 4 +- .../platform/darwin/common/command_line.h | 4 +- .../platform/darwin/common/command_line.mm | 4 +- .../framework/Source/FlutterDartProject.mm | 14 +- .../Source/FlutterDartProject_Internal.h | 8 +- .../ios/framework/Source/FlutterEngine.mm | 73 +++++------ .../framework/Source/FlutterEngine_Internal.h | 10 +- .../ios/framework/Source/FlutterOverlayView.h | 6 +- .../framework/Source/FlutterOverlayView.mm | 10 +- .../framework/Source/FlutterPlatformPlugin.h | 4 +- .../framework/Source/FlutterPlatformPlugin.mm | 6 +- .../framework/Source/FlutterPlatformViews.mm | 4 +- .../Source/FlutterPlatformViews_Internal.h | 4 +- .../Source/FlutterPlatformViews_Internal.mm | 5 +- .../framework/Source/FlutterStandardCodec.mm | 2 +- .../Source/FlutterStandardCodec_Internal.h | 4 +- .../darwin/ios/framework/Source/FlutterView.h | 9 +- .../ios/framework/Source/FlutterView.mm | 15 ++- .../framework/Source/FlutterViewController.mm | 10 +- .../Source/FlutterViewController_Internal.h | 2 +- .../framework/Source/accessibility_bridge.h | 12 +- .../framework/Source/accessibility_bridge.mm | 16 +-- .../Source/accessibility_text_entry.mm | 2 +- .../Source/platform_message_response_darwin.h | 4 +- .../platform_message_response_darwin.mm | 6 +- .../Source/platform_message_router.h | 4 +- .../Source/platform_message_router.mm | 4 +- .../ios/framework/Source/vsync_waiter_ios.h | 6 +- .../ios/framework/Source/vsync_waiter_ios.mm | 10 +- .../darwin/ios/ios_external_texture_gl.h | 4 +- .../darwin/ios/ios_external_texture_gl.mm | 4 +- .../platform/darwin/ios/ios_gl_context.h | 4 +- .../platform/darwin/ios/ios_gl_context.mm | 4 +- .../darwin/ios/ios_gl_render_target.h | 4 +- .../darwin/ios/ios_gl_render_target.mm | 4 +- .../shell/platform/darwin/ios/ios_surface.h | 4 +- .../shell/platform/darwin/ios/ios_surface.mm | 4 +- .../platform/darwin/ios/ios_surface_gl.h | 6 +- .../platform/darwin/ios/ios_surface_gl.mm | 4 +- .../darwin/ios/ios_surface_software.h | 18 +-- .../darwin/ios/ios_surface_software.mm | 4 +- .../platform/darwin/ios/platform_view_ios.h | 20 +-- .../platform/darwin/ios/platform_view_ios.mm | 20 +-- .../shell/platform/embedder/embedder.cc | 122 +++++++++--------- .../platform/embedder/embedder_engine.cc | 6 +- .../shell/platform/embedder/embedder_engine.h | 4 +- .../embedder/embedder_external_texture_gl.cc | 4 +- .../embedder/embedder_external_texture_gl.h | 4 +- .../platform/embedder/embedder_surface.cc | 4 +- .../platform/embedder/embedder_surface.h | 4 +- .../platform/embedder/embedder_surface_gl.cc | 28 ++-- .../platform/embedder/embedder_surface_gl.h | 24 ++-- .../embedder/embedder_surface_software.cc | 14 +- .../embedder/embedder_surface_software.h | 14 +- .../platform/embedder/embedder_task_runner.cc | 4 +- .../platform/embedder/embedder_task_runner.h | 4 +- .../platform/embedder/embedder_thread_host.cc | 4 +- .../platform/embedder/embedder_thread_host.h | 4 +- .../embedder/platform_view_embedder.cc | 10 +- .../embedder/platform_view_embedder.h | 14 +- .../embedder/tests/embedder_a11y_unittests.cc | 4 +- .../embedder/tests/embedder_config_builder.cc | 4 +- .../embedder/tests/embedder_config_builder.h | 4 +- .../embedder/tests/embedder_context.cc | 4 +- .../embedder/tests/embedder_context.h | 4 +- .../platform/embedder/tests/embedder_test.cc | 4 +- .../platform/embedder/tests/embedder_test.h | 4 +- .../embedder/tests/embedder_unittests.cc | 4 +- .../embedder/vsync_waiter_embedder.cc | 6 +- .../platform/embedder/vsync_waiter_embedder.h | 6 +- .../shell/platform/glfw/flutter_glfw.cc | 12 +- .../shell/platform/glfw/key_event_handler.cc | 4 +- .../shell/platform/glfw/key_event_handler.h | 8 +- .../platform/glfw/keyboard_hook_handler.h | 4 +- .../shell/platform/glfw/text_input_plugin.cc | 4 +- .../shell/platform/glfw/text_input_plugin.h | 8 +- .../src/flutter/shell/testing/tester_main.cc | 18 +-- 157 files changed, 723 insertions(+), 713 deletions(-) rename engine/src/flutter/shell/common/{io_manager.cc => shell_io_manager.cc} (82%) rename engine/src/flutter/shell/common/{io_manager.h => shell_io_manager.h} (76%) diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index 0ad1cf51ce..c9288e4943 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -413,8 +413,6 @@ FILE: ../../../flutter/shell/common/animator.h FILE: ../../../flutter/shell/common/engine.cc FILE: ../../../flutter/shell/common/engine.h FILE: ../../../flutter/shell/common/fixtures/main.dart -FILE: ../../../flutter/shell/common/io_manager.cc -FILE: ../../../flutter/shell/common/io_manager.h FILE: ../../../flutter/shell/common/isolate_configuration.cc FILE: ../../../flutter/shell/common/isolate_configuration.h FILE: ../../../flutter/shell/common/persistent_cache.cc @@ -428,6 +426,8 @@ FILE: ../../../flutter/shell/common/run_configuration.h FILE: ../../../flutter/shell/common/shell.cc FILE: ../../../flutter/shell/common/shell.h FILE: ../../../flutter/shell/common/shell_benchmarks.cc +FILE: ../../../flutter/shell/common/shell_io_manager.cc +FILE: ../../../flutter/shell/common/shell_io_manager.h FILE: ../../../flutter/shell/common/shell_test.cc FILE: ../../../flutter/shell/common/shell_test.h FILE: ../../../flutter/shell/common/shell_unittests.cc diff --git a/engine/src/flutter/lib/ui/io_manager.h b/engine/src/flutter/lib/ui/io_manager.h index 1b2a2370cb..060f3e4ec8 100644 --- a/engine/src/flutter/lib/ui/io_manager.h +++ b/engine/src/flutter/lib/ui/io_manager.h @@ -15,6 +15,8 @@ namespace flutter { // i.e. the shell's IOManager. class IOManager { public: + virtual ~IOManager() = default; + virtual fml::WeakPtr GetResourceContext() const = 0; virtual fml::RefPtr GetSkiaUnrefQueue() const = 0; diff --git a/engine/src/flutter/shell/common/BUILD.gn b/engine/src/flutter/shell/common/BUILD.gn index c8366f7bed..fcfcd156d2 100644 --- a/engine/src/flutter/shell/common/BUILD.gn +++ b/engine/src/flutter/shell/common/BUILD.gn @@ -64,8 +64,6 @@ source_set("common") { "animator.h", "engine.cc", "engine.h", - "io_manager.cc", - "io_manager.h", "isolate_configuration.cc", "isolate_configuration.h", "persistent_cache.cc", @@ -78,6 +76,8 @@ source_set("common") { "run_configuration.h", "shell.cc", "shell.h", + "shell_io_manager.cc", + "shell_io_manager.h", "skia_event_tracer_impl.cc", "skia_event_tracer_impl.h", "surface.cc", diff --git a/engine/src/flutter/shell/common/animator.cc b/engine/src/flutter/shell/common/animator.cc index 785f28413a..298aaff6ce 100644 --- a/engine/src/flutter/shell/common/animator.cc +++ b/engine/src/flutter/shell/common/animator.cc @@ -7,7 +7,7 @@ #include "flutter/fml/trace_event.h" #include "third_party/dart/runtime/include/dart_tools_api.h" -namespace shell { +namespace flutter { namespace { @@ -233,4 +233,4 @@ void Animator::AwaitVSync() { delegate_.OnAnimatorNotifyIdle(dart_frame_deadline_); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/animator.h b/engine/src/flutter/shell/common/animator.h index 4795d12678..c58c99d118 100644 --- a/engine/src/flutter/shell/common/animator.h +++ b/engine/src/flutter/shell/common/animator.h @@ -16,7 +16,7 @@ #include "flutter/synchronization/pipeline.h" #include "flutter/synchronization/semaphore.h" -namespace shell { +namespace flutter { class Animator final { public: @@ -90,6 +90,6 @@ class Animator final { FML_DISALLOW_COPY_AND_ASSIGN(Animator); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_COMMON_ANIMATOR_H_ diff --git a/engine/src/flutter/shell/common/engine.cc b/engine/src/flutter/shell/common/engine.cc index dea021a5f0..706ded7098 100644 --- a/engine/src/flutter/shell/common/engine.cc +++ b/engine/src/flutter/shell/common/engine.cc @@ -27,7 +27,7 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" -namespace shell { +namespace flutter { static constexpr char kAssetChannel[] = "flutter/assets"; static constexpr char kLifecycleChannel[] = "flutter/lifecycle"; @@ -150,7 +150,7 @@ Engine::RunStatus Engine::Run(RunConfiguration configuration) { : Engine::RunStatus::Failure; } -shell::Engine::RunStatus Engine::PrepareAndLaunchIsolate( +Engine::RunStatus Engine::PrepareAndLaunchIsolate( RunConfiguration configuration) { TRACE_EVENT0("flutter", "Engine::PrepareAndLaunchIsolate"); @@ -458,4 +458,4 @@ void Engine::HandleAssetPlatformMessage( response->CompleteEmpty(); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/engine.h b/engine/src/flutter/shell/common/engine.h index 68eee4ad99..ce4917e6b9 100644 --- a/engine/src/flutter/shell/common/engine.h +++ b/engine/src/flutter/shell/common/engine.h @@ -22,12 +22,12 @@ #include "flutter/runtime/runtime_controller.h" #include "flutter/runtime/runtime_delegate.h" #include "flutter/shell/common/animator.h" -#include "flutter/shell/common/io_manager.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/run_configuration.h" +#include "flutter/shell/common/shell_io_manager.h" #include "third_party/skia/include/core/SkPicture.h" -namespace shell { +namespace flutter { class Engine final : public flutter::RuntimeDelegate { public: @@ -175,6 +175,6 @@ class Engine final : public flutter::RuntimeDelegate { FML_DISALLOW_COPY_AND_ASSIGN(Engine); }; -} // namespace shell +} // namespace flutter #endif // SHELL_COMMON_ENGINE_H_ diff --git a/engine/src/flutter/shell/common/isolate_configuration.cc b/engine/src/flutter/shell/common/isolate_configuration.cc index 93ec0afac1..a11a060b3b 100644 --- a/engine/src/flutter/shell/common/isolate_configuration.cc +++ b/engine/src/flutter/shell/common/isolate_configuration.cc @@ -7,7 +7,7 @@ #include "flutter/fml/make_copyable.h" #include "flutter/runtime/dart_vm.h" -namespace shell { +namespace flutter { IsolateConfiguration::IsolateConfiguration() = default; @@ -27,7 +27,7 @@ class AppSnapshotIsolateConfiguration final : public IsolateConfiguration { public: AppSnapshotIsolateConfiguration() = default; - // |shell::IsolateConfiguration| + // |IsolateConfiguration| bool DoPrepareIsolate(flutter::DartIsolate& isolate) override { return isolate.PrepareForRunningFromPrecompiledCode(); } @@ -41,7 +41,7 @@ class KernelIsolateConfiguration : public IsolateConfiguration { KernelIsolateConfiguration(std::unique_ptr kernel) : kernel_(std::move(kernel)) {} - // |shell::IsolateConfiguration| + // |IsolateConfiguration| bool DoPrepareIsolate(flutter::DartIsolate& isolate) override { if (flutter::DartVM::IsRunningPrecompiledCode()) { return false; @@ -62,7 +62,7 @@ class KernelListIsolateConfiguration final : public IsolateConfiguration { kernel_pieces) : kernel_pieces_(std::move(kernel_pieces)) {} - // |shell::IsolateConfiguration| + // |IsolateConfiguration| bool DoPrepareIsolate(flutter::DartIsolate& isolate) override { if (flutter::DartVM::IsRunningPrecompiledCode()) { return false; @@ -219,4 +219,4 @@ std::unique_ptr IsolateConfiguration::CreateForKernelList( std::move(kernel_pieces)); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/isolate_configuration.h b/engine/src/flutter/shell/common/isolate_configuration.h index 8de0a8192b..950a749101 100644 --- a/engine/src/flutter/shell/common/isolate_configuration.h +++ b/engine/src/flutter/shell/common/isolate_configuration.h @@ -17,7 +17,7 @@ #include "flutter/fml/memory/weak_ptr.h" #include "flutter/runtime/dart_isolate.h" -namespace shell { +namespace flutter { class IsolateConfiguration { public: @@ -51,6 +51,6 @@ class IsolateConfiguration { FML_DISALLOW_COPY_AND_ASSIGN(IsolateConfiguration); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ diff --git a/engine/src/flutter/shell/common/persistent_cache.cc b/engine/src/flutter/shell/common/persistent_cache.cc index fe9f6e4824..c9fcb42028 100644 --- a/engine/src/flutter/shell/common/persistent_cache.cc +++ b/engine/src/flutter/shell/common/persistent_cache.cc @@ -15,7 +15,7 @@ #include "flutter/fml/paths.h" #include "flutter/fml/trace_event.h" -namespace shell { +namespace flutter { std::string PersistentCache::cache_base_path_; @@ -205,4 +205,4 @@ fml::RefPtr PersistentCache::GetWorkerTaskRunner() const { return worker; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/persistent_cache.h b/engine/src/flutter/shell/common/persistent_cache.h index 7b3310e849..f26e819e81 100644 --- a/engine/src/flutter/shell/common/persistent_cache.h +++ b/engine/src/flutter/shell/common/persistent_cache.h @@ -15,7 +15,7 @@ #include "flutter/fml/unique_fd.h" #include "third_party/skia/include/gpu/GrContextOptions.h" -namespace shell { +namespace flutter { class PersistentCache : public GrContextOptions::PersistentCache { public: @@ -72,6 +72,6 @@ class PersistentCache : public GrContextOptions::PersistentCache { FML_DISALLOW_COPY_AND_ASSIGN(PersistentCache); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_COMMON_PERSISTENT_CACHE_H_ diff --git a/engine/src/flutter/shell/common/platform_view.cc b/engine/src/flutter/shell/common/platform_view.cc index f10d29941d..43063f742e 100644 --- a/engine/src/flutter/shell/common/platform_view.cc +++ b/engine/src/flutter/shell/common/platform_view.cc @@ -14,7 +14,7 @@ #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" -namespace shell { +namespace flutter { PlatformView::PlatformView(Delegate& delegate, flutter::TaskRunners task_runners) @@ -133,4 +133,4 @@ void PlatformView::SetNextFrameCallback(fml::closure closure) { delegate_.OnPlatformViewSetNextFrameCallback(std::move(closure)); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/platform_view.h b/engine/src/flutter/shell/common/platform_view.h index 07e92dd537..32e40a981a 100644 --- a/engine/src/flutter/shell/common/platform_view.h +++ b/engine/src/flutter/shell/common/platform_view.h @@ -21,7 +21,7 @@ #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace shell { +namespace flutter { class Shell; @@ -132,6 +132,6 @@ class PlatformView { FML_DISALLOW_COPY_AND_ASSIGN(PlatformView); }; -} // namespace shell +} // namespace flutter #endif // COMMON_PLATFORM_VIEW_H_ diff --git a/engine/src/flutter/shell/common/rasterizer.cc b/engine/src/flutter/shell/common/rasterizer.cc index 6759ef9740..24241f62e2 100644 --- a/engine/src/flutter/shell/common/rasterizer.cc +++ b/engine/src/flutter/shell/common/rasterizer.cc @@ -16,7 +16,7 @@ #include "third_party/skia/include/core/SkSurfaceCharacterization.h" #include "third_party/skia/include/utils/SkBase64.h" -namespace shell { +namespace flutter { // The rasterizer will tell Skia to purge cached resources that have not been // used within this interval. @@ -389,4 +389,4 @@ Rasterizer::Screenshot::Screenshot(const Screenshot& other) = default; Rasterizer::Screenshot::~Screenshot() = default; -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/rasterizer.h b/engine/src/flutter/shell/common/rasterizer.h index 0319afe744..80faecfc5a 100644 --- a/engine/src/flutter/shell/common/rasterizer.h +++ b/engine/src/flutter/shell/common/rasterizer.h @@ -17,7 +17,7 @@ #include "flutter/shell/common/surface.h" #include "flutter/synchronization/pipeline.h" -namespace shell { +namespace flutter { class Rasterizer final : public flutter::SnapshotDelegate { public: @@ -96,6 +96,6 @@ class Rasterizer final : public flutter::SnapshotDelegate { FML_DISALLOW_COPY_AND_ASSIGN(Rasterizer); }; -} // namespace shell +} // namespace flutter #endif // SHELL_COMMON_RASTERIZER_H_ diff --git a/engine/src/flutter/shell/common/run_configuration.cc b/engine/src/flutter/shell/common/run_configuration.cc index d6cf5d7580..4d7f5c0fb2 100644 --- a/engine/src/flutter/shell/common/run_configuration.cc +++ b/engine/src/flutter/shell/common/run_configuration.cc @@ -10,7 +10,7 @@ #include "flutter/fml/file.h" #include "flutter/runtime/dart_vm.h" -namespace shell { +namespace flutter { RunConfiguration RunConfiguration::InferFromSettings( const flutter::Settings& settings, @@ -86,4 +86,4 @@ RunConfiguration::TakeIsolateConfiguration() { return std::move(isolate_configuration_); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/run_configuration.h b/engine/src/flutter/shell/common/run_configuration.h index 9158813bff..f5494c10d7 100644 --- a/engine/src/flutter/shell/common/run_configuration.h +++ b/engine/src/flutter/shell/common/run_configuration.h @@ -16,7 +16,7 @@ #include "flutter/fml/unique_fd.h" #include "flutter/shell/common/isolate_configuration.h" -namespace shell { +namespace flutter { class RunConfiguration { public: @@ -58,6 +58,6 @@ class RunConfiguration { FML_DISALLOW_COPY_AND_ASSIGN(RunConfiguration); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_COMMON_RUN_CONFIGURATION_H_ diff --git a/engine/src/flutter/shell/common/shell.cc b/engine/src/flutter/shell/common/shell.cc index 84a879e4ba..893a269601 100644 --- a/engine/src/flutter/shell/common/shell.cc +++ b/engine/src/flutter/shell/common/shell.cc @@ -31,7 +31,7 @@ #include "third_party/skia/include/core/SkGraphics.h" #include "third_party/tonic/common/log.h" -namespace shell { +namespace flutter { constexpr char kSkiaChannel[] = "flutter/skia"; @@ -69,7 +69,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( // first be booted and the necessary references obtained to initialize the // other subsystems. fml::AutoResetWaitableEvent io_latch; - std::unique_ptr io_manager; + std::unique_ptr io_manager; auto io_task_runner = shell->GetTaskRunners().GetIOTaskRunner(); fml::TaskRunner::RunNowOrPostTask( io_task_runner, @@ -79,7 +79,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( io_task_runner // ]() { TRACE_EVENT0("flutter", "ShellSetupIOSubsystem"); - io_manager = std::make_unique( + io_manager = std::make_unique( platform_view->CreateResourceContext(), io_task_runner); io_latch.Signal(); }); @@ -378,7 +378,7 @@ bool Shell::IsSetup() const { bool Shell::Setup(std::unique_ptr platform_view, std::unique_ptr engine, std::unique_ptr rasterizer, - std::unique_ptr io_manager) { + std::unique_ptr io_manager) { if (is_setup_) { return false; } @@ -432,7 +432,7 @@ flutter::DartVM* Shell::GetDartVM() { return &vm_; } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewCreated(std::unique_ptr surface) { TRACE_EVENT0("flutter", "Shell::OnPlatformViewCreated"); FML_DCHECK(is_setup_); @@ -516,7 +516,7 @@ void Shell::OnPlatformViewCreated(std::unique_ptr surface) { } } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewDestroyed() { TRACE_EVENT0("flutter", "Shell::OnPlatformViewDestroyed"); FML_DCHECK(is_setup_); @@ -590,7 +590,7 @@ void Shell::OnPlatformViewDestroyed() { } } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewSetViewportMetrics( const flutter::ViewportMetrics& metrics) { FML_DCHECK(is_setup_); @@ -604,7 +604,7 @@ void Shell::OnPlatformViewSetViewportMetrics( }); } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewDispatchPlatformMessage( fml::RefPtr message) { FML_DCHECK(is_setup_); @@ -618,7 +618,7 @@ void Shell::OnPlatformViewDispatchPlatformMessage( }); } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewDispatchPointerDataPacket( std::unique_ptr packet) { TRACE_EVENT0("flutter", "Shell::OnPlatformViewDispatchPointerDataPacket"); @@ -635,7 +635,7 @@ void Shell::OnPlatformViewDispatchPointerDataPacket( next_pointer_flow_id_++; } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewDispatchSemanticsAction( int32_t id, flutter::SemanticsAction action, @@ -651,7 +651,7 @@ void Shell::OnPlatformViewDispatchSemanticsAction( }); } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewSetSemanticsEnabled(bool enabled) { FML_DCHECK(is_setup_); FML_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); @@ -664,7 +664,7 @@ void Shell::OnPlatformViewSetSemanticsEnabled(bool enabled) { }); } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewSetAccessibilityFeatures(int32_t flags) { FML_DCHECK(is_setup_); FML_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); @@ -677,7 +677,7 @@ void Shell::OnPlatformViewSetAccessibilityFeatures(int32_t flags) { }); } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewRegisterTexture( std::shared_ptr texture) { FML_DCHECK(is_setup_); @@ -693,7 +693,7 @@ void Shell::OnPlatformViewRegisterTexture( }); } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewUnregisterTexture(int64_t texture_id) { FML_DCHECK(is_setup_); FML_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); @@ -708,7 +708,7 @@ void Shell::OnPlatformViewUnregisterTexture(int64_t texture_id) { }); } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewMarkTextureFrameAvailable(int64_t texture_id) { FML_DCHECK(is_setup_); FML_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); @@ -739,7 +739,7 @@ void Shell::OnPlatformViewMarkTextureFrameAvailable(int64_t texture_id) { }); } -// |shell::PlatformView::Delegate| +// |PlatformView::Delegate| void Shell::OnPlatformViewSetNextFrameCallback(fml::closure closure) { FML_DCHECK(is_setup_); FML_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); @@ -752,7 +752,7 @@ void Shell::OnPlatformViewSetNextFrameCallback(fml::closure closure) { }); } -// |shell::Animator::Delegate| +// |Animator::Delegate| void Shell::OnAnimatorBeginFrame(fml::TimePoint frame_time) { FML_DCHECK(is_setup_); FML_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); @@ -762,7 +762,7 @@ void Shell::OnAnimatorBeginFrame(fml::TimePoint frame_time) { } } -// |shell::Animator::Delegate| +// |Animator::Delegate| void Shell::OnAnimatorNotifyIdle(int64_t deadline) { FML_DCHECK(is_setup_); FML_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); @@ -772,7 +772,7 @@ void Shell::OnAnimatorNotifyIdle(int64_t deadline) { } } -// |shell::Animator::Delegate| +// |Animator::Delegate| void Shell::OnAnimatorDraw( fml::RefPtr> pipeline) { FML_DCHECK(is_setup_); @@ -786,7 +786,7 @@ void Shell::OnAnimatorDraw( }); } -// |shell::Animator::Delegate| +// |Animator::Delegate| void Shell::OnAnimatorDrawLastLayerTree() { FML_DCHECK(is_setup_); @@ -798,7 +798,7 @@ void Shell::OnAnimatorDrawLastLayerTree() { }); } -// |shell::Engine::Delegate| +// |Engine::Delegate| void Shell::OnEngineUpdateSemantics( flutter::SemanticsNodeUpdates update, flutter::CustomAccessibilityActionUpdates actions) { @@ -814,7 +814,7 @@ void Shell::OnEngineUpdateSemantics( }); } -// |shell::Engine::Delegate| +// |Engine::Delegate| void Shell::OnEngineHandlePlatformMessage( fml::RefPtr message) { FML_DCHECK(is_setup_); @@ -858,7 +858,7 @@ void Shell::HandleEngineSkiaMessage( }); } -// |shell::Engine::Delegate| +// |Engine::Delegate| void Shell::OnPreEngineRestart() { FML_DCHECK(is_setup_); FML_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); @@ -877,7 +877,7 @@ void Shell::OnPreEngineRestart() { latch.Wait(); } -// |shell::Engine::Delegate| +// |Engine::Delegate| void Shell::UpdateIsolateDescription(const std::string isolate_name, int64_t isolate_port) { Handler::Description description(isolate_port, isolate_name); @@ -1136,4 +1136,4 @@ Rasterizer::Screenshot Shell::Screenshot( return screenshot; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/shell.h b/engine/src/flutter/shell/common/shell.h index 01f166846d..63006e0795 100644 --- a/engine/src/flutter/shell/common/shell.h +++ b/engine/src/flutter/shell/common/shell.h @@ -27,12 +27,12 @@ #include "flutter/runtime/service_protocol.h" #include "flutter/shell/common/animator.h" #include "flutter/shell/common/engine.h" -#include "flutter/shell/common/io_manager.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell_io_manager.h" #include "flutter/shell/common/surface.h" -namespace shell { +namespace flutter { class Shell final : public PlatformView::Delegate, public Animator::Delegate, @@ -91,7 +91,7 @@ class Shell final : public PlatformView::Delegate, std::unique_ptr platform_view_; // on platform task runner std::unique_ptr engine_; // on UI task runner std::unique_ptr rasterizer_; // on GPU task runner - std::unique_ptr io_manager_; // on IO task runner + std::unique_ptr io_manager_; // on IO task runner std::unordered_map, @@ -119,79 +119,79 @@ class Shell final : public PlatformView::Delegate, bool Setup(std::unique_ptr platform_view, std::unique_ptr engine, std::unique_ptr rasterizer, - std::unique_ptr io_manager); + std::unique_ptr io_manager); - // |shell::PlatformView::Delegate| + // |PlatformView::Delegate| void OnPlatformViewCreated(std::unique_ptr surface) override; - // |shell::PlatformView::Delegate| + // |PlatformView::Delegate| void OnPlatformViewDestroyed() override; - // |shell::PlatformView::Delegate| + // |PlatformView::Delegate| void OnPlatformViewSetViewportMetrics( const flutter::ViewportMetrics& metrics) override; - // |shell::PlatformView::Delegate| + // |PlatformView::Delegate| void OnPlatformViewDispatchPlatformMessage( fml::RefPtr message) override; - // |shell::PlatformView::Delegate| + // |PlatformView::Delegate| void OnPlatformViewDispatchPointerDataPacket( std::unique_ptr packet) override; - // |shell::PlatformView::Delegate| + // |PlatformView::Delegate| void OnPlatformViewDispatchSemanticsAction( int32_t id, flutter::SemanticsAction action, std::vector args) override; - // |shell::PlatformView::Delegate| + // |PlatformView::Delegate| void OnPlatformViewSetSemanticsEnabled(bool enabled) override; // |shell:PlatformView::Delegate| void OnPlatformViewSetAccessibilityFeatures(int32_t flags) override; - // |shell::PlatformView::Delegate| + // |PlatformView::Delegate| void OnPlatformViewRegisterTexture( std::shared_ptr texture) override; - // |shell::PlatformView::Delegate| + // |PlatformView::Delegate| void OnPlatformViewUnregisterTexture(int64_t texture_id) override; - // |shell::PlatformView::Delegate| + // |PlatformView::Delegate| void OnPlatformViewMarkTextureFrameAvailable(int64_t texture_id) override; - // |shell::PlatformView::Delegate| + // |PlatformView::Delegate| void OnPlatformViewSetNextFrameCallback(fml::closure closure) override; - // |shell::Animator::Delegate| + // |Animator::Delegate| void OnAnimatorBeginFrame(fml::TimePoint frame_time) override; - // |shell::Animator::Delegate| + // |Animator::Delegate| void OnAnimatorNotifyIdle(int64_t deadline) override; - // |shell::Animator::Delegate| + // |Animator::Delegate| void OnAnimatorDraw( fml::RefPtr> pipeline) override; - // |shell::Animator::Delegate| + // |Animator::Delegate| void OnAnimatorDrawLastLayerTree() override; - // |shell::Engine::Delegate| + // |Engine::Delegate| void OnEngineUpdateSemantics( flutter::SemanticsNodeUpdates update, flutter::CustomAccessibilityActionUpdates actions) override; - // |shell::Engine::Delegate| + // |Engine::Delegate| void OnEngineHandlePlatformMessage( fml::RefPtr message) override; void HandleEngineSkiaMessage(fml::RefPtr message); - // |shell::Engine::Delegate| + // |Engine::Delegate| void OnPreEngineRestart() override; - // |shell::Engine::Delegate| + // |Engine::Delegate| void UpdateIsolateDescription(const std::string isolate_name, int64_t isolate_port) override; @@ -242,6 +242,6 @@ class Shell final : public PlatformView::Delegate, FML_DISALLOW_COPY_AND_ASSIGN(Shell); }; -} // namespace shell +} // namespace flutter #endif // SHELL_COMMON_SHELL_H_ diff --git a/engine/src/flutter/shell/common/shell_benchmarks.cc b/engine/src/flutter/shell/common/shell_benchmarks.cc index 645344e37d..80b255162e 100644 --- a/engine/src/flutter/shell/common/shell_benchmarks.cc +++ b/engine/src/flutter/shell/common/shell_benchmarks.cc @@ -7,7 +7,7 @@ #include "flutter/shell/common/shell.h" #include "flutter/shell/common/thread_host.h" -namespace shell { +namespace flutter { static void StartupAndShutdownShell(benchmark::State& state, bool measure_startup, @@ -77,4 +77,4 @@ static void BM_ShellInitializationAndShutdown(benchmark::State& state) { BENCHMARK(BM_ShellInitializationAndShutdown); -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/io_manager.cc b/engine/src/flutter/shell/common/shell_io_manager.cc similarity index 82% rename from engine/src/flutter/shell/common/io_manager.cc rename to engine/src/flutter/shell/common/shell_io_manager.cc index a0172e1084..2ca9cb25a1 100644 --- a/engine/src/flutter/shell/common/io_manager.cc +++ b/engine/src/flutter/shell/common/shell_io_manager.cc @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/common/shell_io_manager.h" #include "flutter/fml/message_loop.h" #include "flutter/shell/common/persistent_cache.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" -namespace shell { +namespace flutter { -sk_sp IOManager::CreateCompatibleResourceLoadingContext( +sk_sp ShellIOManager::CreateCompatibleResourceLoadingContext( GrBackend backend, sk_sp gl_interface) { if (backend != GrBackend::kOpenGL_GrBackend) { @@ -42,8 +42,9 @@ sk_sp IOManager::CreateCompatibleResourceLoadingContext( return nullptr; } -IOManager::IOManager(sk_sp resource_context, - fml::RefPtr unref_queue_task_runner) +ShellIOManager::ShellIOManager( + sk_sp resource_context, + fml::RefPtr unref_queue_task_runner) : resource_context_(std::move(resource_context)), resource_context_weak_factory_( resource_context_ ? std::make_unique>( @@ -62,19 +63,19 @@ IOManager::IOManager(sk_sp resource_context, } } -IOManager::~IOManager() { +ShellIOManager::~ShellIOManager() { // Last chance to drain the IO queue as the platform side reference to the // underlying OpenGL context may be going away. unref_queue_->Drain(); } -fml::WeakPtr IOManager::GetResourceContext() const { +fml::WeakPtr ShellIOManager::GetResourceContext() const { return resource_context_weak_factory_ ? resource_context_weak_factory_->GetWeakPtr() : fml::WeakPtr(); } -void IOManager::NotifyResourceContextAvailable( +void ShellIOManager::NotifyResourceContextAvailable( sk_sp resource_context) { // The resource context needs to survive as long as we have Dart objects // referencing. We shouldn't ever need to replace it if we have one - unless @@ -84,7 +85,7 @@ void IOManager::NotifyResourceContextAvailable( } } -void IOManager::UpdateResourceContext(sk_sp resource_context) { +void ShellIOManager::UpdateResourceContext(sk_sp resource_context) { resource_context_ = std::move(resource_context); resource_context_weak_factory_ = resource_context_ ? std::make_unique>( @@ -92,11 +93,11 @@ void IOManager::UpdateResourceContext(sk_sp resource_context) { : nullptr; } -fml::RefPtr IOManager::GetSkiaUnrefQueue() const { +fml::RefPtr ShellIOManager::GetSkiaUnrefQueue() const { return unref_queue_; } -fml::WeakPtr IOManager::GetWeakPtr() { +fml::WeakPtr ShellIOManager::GetWeakPtr() { return weak_factory_.GetWeakPtr(); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/io_manager.h b/engine/src/flutter/shell/common/shell_io_manager.h similarity index 76% rename from engine/src/flutter/shell/common/io_manager.h rename to engine/src/flutter/shell/common/shell_io_manager.h index ed6bbd0311..49a93899c5 100644 --- a/engine/src/flutter/shell/common/io_manager.h +++ b/engine/src/flutter/shell/common/shell_io_manager.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_SHELL_COMMON_IO_MANAGER_H_ -#define FLUTTER_SHELL_COMMON_IO_MANAGER_H_ +#ifndef FLUTTER_SHELL_COMMON_SHELL_IO_MANAGER_H_ +#define FLUTTER_SHELL_COMMON_SHELL_IO_MANAGER_H_ #include @@ -13,9 +13,9 @@ #include "flutter/lib/ui/io_manager.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace shell { +namespace flutter { -class IOManager : public flutter::IOManager { +class ShellIOManager final : public IOManager { public: // Convenience methods for platforms to create a GrContext used to supply to // the IOManager. The platforms may create the context themselves if they so @@ -24,10 +24,10 @@ class IOManager : public flutter::IOManager { GrBackend backend, sk_sp gl_interface); - IOManager(sk_sp resource_context, - fml::RefPtr unref_queue_task_runner); + ShellIOManager(sk_sp resource_context, + fml::RefPtr unref_queue_task_runner); - virtual ~IOManager(); + ~ShellIOManager() override; fml::WeakPtr GetResourceContext() const override; @@ -44,7 +44,7 @@ class IOManager : public flutter::IOManager { fml::RefPtr GetSkiaUnrefQueue() const override; - fml::WeakPtr GetWeakPtr(); + fml::WeakPtr GetWeakPtr(); private: // Resource context management. @@ -55,11 +55,11 @@ class IOManager : public flutter::IOManager { // Unref queue management. fml::RefPtr unref_queue_; - fml::WeakPtrFactory weak_factory_; + fml::WeakPtrFactory weak_factory_; - FML_DISALLOW_COPY_AND_ASSIGN(IOManager); + FML_DISALLOW_COPY_AND_ASSIGN(ShellIOManager); }; -} // namespace shell +} // namespace flutter -#endif // FLUTTER_SHELL_COMMON_IO_MANAGER_H_ +#endif // FLUTTER_SHELL_COMMON_SHELL_IO_MANAGER_H_ diff --git a/engine/src/flutter/shell/common/shell_test.cc b/engine/src/flutter/shell/common/shell_test.cc index a32a524428..94e6d85908 100644 --- a/engine/src/flutter/shell/common/shell_test.cc +++ b/engine/src/flutter/shell/common/shell_test.cc @@ -10,7 +10,7 @@ #include "flutter/runtime/dart_vm.h" #include "flutter/testing/testing.h" -namespace shell { +namespace flutter { namespace testing { ShellTest::ShellTest() @@ -130,4 +130,4 @@ void ShellTest::AddNativeCallback(std::string name, } } // namespace testing -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/shell_test.h b/engine/src/flutter/shell/common/shell_test.h index 38c28d1756..a813049bc2 100644 --- a/engine/src/flutter/shell/common/shell_test.h +++ b/engine/src/flutter/shell/common/shell_test.h @@ -14,7 +14,7 @@ #include "flutter/testing/test_dart_native_resolver.h" #include "flutter/testing/thread_test.h" -namespace shell { +namespace flutter { namespace testing { class ShellTest : public ::testing::ThreadTest { @@ -45,6 +45,6 @@ class ShellTest : public ::testing::ThreadTest { }; } // namespace testing -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_COMMON_SHELL_TEST_H_ diff --git a/engine/src/flutter/shell/common/shell_unittests.cc b/engine/src/flutter/shell/common/shell_unittests.cc index 333a8f3354..5be39eea10 100644 --- a/engine/src/flutter/shell/common/shell_unittests.cc +++ b/engine/src/flutter/shell/common/shell_unittests.cc @@ -20,7 +20,7 @@ #include "flutter/testing/testing.h" #include "gtest/gtest.h" -namespace shell { +namespace flutter { namespace testing { class TestPlatformView : public PlatformView, @@ -244,4 +244,4 @@ TEST_F(ShellTest, FixturesAreFunctional) { } } // namespace testing -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/skia_event_tracer_impl.cc b/engine/src/flutter/shell/common/skia_event_tracer_impl.cc index b04bfb36bc..a44a39b214 100644 --- a/engine/src/flutter/shell/common/skia_event_tracer_impl.cc +++ b/engine/src/flutter/shell/common/skia_event_tracer_impl.cc @@ -13,7 +13,7 @@ #include "third_party/skia/include/utils/SkEventTracer.h" #include "third_party/skia/include/utils/SkTraceEventPhase.h" -namespace skia { +namespace flutter { class FlutterEventTracer : public SkEventTracer { public: @@ -120,14 +120,15 @@ bool enableSkiaTracingCallback(const char* method, return true; } -} // namespace skia - void InitSkiaEventTracer(bool enabled) { - skia::FlutterEventTracer* tracer = new skia::FlutterEventTracer(enabled); + // TODO(chinmaygarde): Leaked https://github.com/flutter/flutter/issues/30808. + auto tracer = new FlutterEventTracer(enabled); Dart_RegisterRootServiceRequestCallback("_flutter.enableSkiaTracing", - skia::enableSkiaTracingCallback, + enableSkiaTracingCallback, static_cast(tracer)); // Initialize the binding to Skia's tracing events. Skia will // take ownership of and clean up the memory allocated here. SkEventTracer::SetInstance(tracer); } + +} // namespace flutter diff --git a/engine/src/flutter/shell/common/skia_event_tracer_impl.h b/engine/src/flutter/shell/common/skia_event_tracer_impl.h index 12e2fc41de..02f4e25d17 100644 --- a/engine/src/flutter/shell/common/skia_event_tracer_impl.h +++ b/engine/src/flutter/shell/common/skia_event_tracer_impl.h @@ -5,6 +5,10 @@ #ifndef FLUTTER_SHELL_COMMON_SKIA_EVENT_TRACER_IMPL_H_ #define FLUTTER_SHELL_COMMON_SKIA_EVENT_TRACER_IMPL_H_ +namespace flutter { + void InitSkiaEventTracer(bool enabled); +} // namespace flutter + #endif // FLUTTER_SHELL_COMMON_SKIA_EVENT_TRACER_IMPL_H_ diff --git a/engine/src/flutter/shell/common/surface.cc b/engine/src/flutter/shell/common/surface.cc index b1134acc1b..ce33431100 100644 --- a/engine/src/flutter/shell/common/surface.cc +++ b/engine/src/flutter/shell/common/surface.cc @@ -7,7 +7,7 @@ #include "flutter/fml/logging.h" #include "third_party/skia/include/core/SkSurface.h" -namespace shell { +namespace flutter { SurfaceFrame::SurfaceFrame(sk_sp surface, SubmitCallback submit_callback) @@ -64,4 +64,4 @@ bool Surface::MakeRenderContextCurrent() { return true; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/surface.h b/engine/src/flutter/shell/common/surface.h index dc37c803d9..f3c5db8bb4 100644 --- a/engine/src/flutter/shell/common/surface.h +++ b/engine/src/flutter/shell/common/surface.h @@ -12,7 +12,7 @@ #include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkCanvas.h" -namespace shell { +namespace flutter { /// Represents a Frame that has been fully configured for the underlying client /// rendering API. A frame may only be submitted once. @@ -63,6 +63,6 @@ class Surface { FML_DISALLOW_COPY_AND_ASSIGN(Surface); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_COMMON_SURFACE_H_ diff --git a/engine/src/flutter/shell/common/switches.cc b/engine/src/flutter/shell/common/switches.cc index 68c1c90f11..f3685c76de 100644 --- a/engine/src/flutter/shell/common/switches.cc +++ b/engine/src/flutter/shell/common/switches.cc @@ -20,7 +20,7 @@ #undef SHELL_COMMON_SWITCHES_H_ struct SwitchDesc { - shell::Switch sw; + flutter::Switch sw; const fml::StringView flag; const char* help; }; @@ -32,14 +32,14 @@ struct SwitchDesc { // clang-format off #define DEF_SWITCHES_START static const struct SwitchDesc gSwitchDescs[] = { #define DEF_SWITCH(p_swtch, p_flag, p_help) \ - { shell::Switch:: p_swtch, p_flag, p_help }, + { flutter::Switch:: p_swtch, p_flag, p_help }, #define DEF_SWITCHES_END }; // clang-format on // Include again for struct definition. #include "flutter/shell/common/switches.h" -namespace shell { +namespace flutter { void PrintUsage(const std::string& executable_name) { std::cerr << std::endl << " " << executable_name << std::endl << std::endl; @@ -105,11 +105,11 @@ const fml::StringView FlagForSwitch(Switch swtch) { template static bool GetSwitchValue(const fml::CommandLine& command_line, - shell::Switch sw, + Switch sw, T* result) { std::string switch_string; - if (!command_line.GetOptionValue(shell::FlagForSwitch(sw), &switch_string)) { + if (!command_line.GetOptionValue(FlagForSwitch(sw), &switch_string)) { return false; } @@ -283,4 +283,4 @@ flutter::Settings SettingsFromCommandLine( return settings; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/switches.h b/engine/src/flutter/shell/common/switches.h index 2939b92dac..be7d887ad2 100644 --- a/engine/src/flutter/shell/common/switches.h +++ b/engine/src/flutter/shell/common/switches.h @@ -9,7 +9,7 @@ #ifndef SHELL_COMMON_SWITCHES_H_ #define SHELL_COMMON_SWITCHES_H_ -namespace shell { +namespace flutter { // clang-format off #ifndef DEF_SWITCHES_START @@ -150,6 +150,6 @@ const fml::StringView FlagForSwitch(Switch swtch); flutter::Settings SettingsFromCommandLine(const fml::CommandLine& command_line); -} // namespace shell +} // namespace flutter #endif // SHELL_COMMON_SWITCHES_H_ diff --git a/engine/src/flutter/shell/common/thread_host.cc b/engine/src/flutter/shell/common/thread_host.cc index d8a2a73006..0ab677a76b 100644 --- a/engine/src/flutter/shell/common/thread_host.cc +++ b/engine/src/flutter/shell/common/thread_host.cc @@ -4,7 +4,7 @@ #include "flutter/shell/common/thread_host.h" -namespace shell { +namespace flutter { ThreadHost::ThreadHost() = default; @@ -37,4 +37,4 @@ void ThreadHost::Reset() { io_thread.reset(); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/thread_host.h b/engine/src/flutter/shell/common/thread_host.h index 9e09603095..93f42a9086 100644 --- a/engine/src/flutter/shell/common/thread_host.h +++ b/engine/src/flutter/shell/common/thread_host.h @@ -10,7 +10,7 @@ #include "flutter/fml/macros.h" #include "flutter/fml/thread.h" -namespace shell { +namespace flutter { struct ThreadHost { enum Type { @@ -38,6 +38,6 @@ struct ThreadHost { void Reset(); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_COMMON_THREAD_HOST_H_ diff --git a/engine/src/flutter/shell/common/vsync_waiter.cc b/engine/src/flutter/shell/common/vsync_waiter.cc index 49f45e9d6d..1e01dfd570 100644 --- a/engine/src/flutter/shell/common/vsync_waiter.cc +++ b/engine/src/flutter/shell/common/vsync_waiter.cc @@ -7,7 +7,7 @@ #include "flutter/fml/task_runner.h" #include "flutter/fml/trace_event.h" -namespace shell { +namespace flutter { #if defined(OS_FUCHSIA) // In general, traces on Fuchsia are recorded across the whole system. @@ -94,4 +94,4 @@ float VsyncWaiter::GetDisplayRefreshRate() const { return kUnknownRefreshRateFPS; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/vsync_waiter.h b/engine/src/flutter/shell/common/vsync_waiter.h index 50fb6b2756..08c5be14e9 100644 --- a/engine/src/flutter/shell/common/vsync_waiter.h +++ b/engine/src/flutter/shell/common/vsync_waiter.h @@ -13,7 +13,7 @@ #include "flutter/fml/synchronization/thread_annotations.h" #include "flutter/fml/time/time_point.h" -namespace shell { +namespace flutter { class VsyncWaiter : public std::enable_shared_from_this { public: @@ -56,6 +56,6 @@ class VsyncWaiter : public std::enable_shared_from_this { FML_DISALLOW_COPY_AND_ASSIGN(VsyncWaiter); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_COMMON_VSYNC_WAITER_H_ diff --git a/engine/src/flutter/shell/common/vsync_waiter_fallback.cc b/engine/src/flutter/shell/common/vsync_waiter_fallback.cc index d8cbc6cdd4..5805da0dc4 100644 --- a/engine/src/flutter/shell/common/vsync_waiter_fallback.cc +++ b/engine/src/flutter/shell/common/vsync_waiter_fallback.cc @@ -6,7 +6,7 @@ #include "flutter/fml/logging.h" -namespace shell { +namespace flutter { namespace { static fml::TimePoint SnapToNextTick(fml::TimePoint value, @@ -25,7 +25,7 @@ VsyncWaiterFallback::VsyncWaiterFallback(flutter::TaskRunners task_runners) VsyncWaiterFallback::~VsyncWaiterFallback() = default; -// |shell::VsyncWaiter| +// |VsyncWaiter| void VsyncWaiterFallback::AwaitVSync() { constexpr fml::TimeDelta kSingleFrameInterval = fml::TimeDelta::FromSecondsF(1.0 / 60.0); @@ -36,4 +36,4 @@ void VsyncWaiterFallback::AwaitVSync() { FireCallback(next, next + kSingleFrameInterval); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/common/vsync_waiter_fallback.h b/engine/src/flutter/shell/common/vsync_waiter_fallback.h index 17ee2043e9..c17ee74048 100644 --- a/engine/src/flutter/shell/common/vsync_waiter_fallback.h +++ b/engine/src/flutter/shell/common/vsync_waiter_fallback.h @@ -10,7 +10,7 @@ #include "flutter/fml/time/time_point.h" #include "flutter/shell/common/vsync_waiter.h" -namespace shell { +namespace flutter { class VsyncWaiterFallback final : public VsyncWaiter { public: @@ -21,12 +21,12 @@ class VsyncWaiterFallback final : public VsyncWaiter { private: fml::TimePoint phase_; - // |shell::VsyncWaiter| + // |VsyncWaiter| void AwaitVSync() override; FML_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterFallback); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ diff --git a/engine/src/flutter/shell/gpu/gpu_surface_gl.cc b/engine/src/flutter/shell/gpu/gpu_surface_gl.cc index b6248fda4c..98011dfc72 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_gl.cc +++ b/engine/src/flutter/shell/gpu/gpu_surface_gl.cc @@ -21,7 +21,7 @@ #define GPU_GL_RGBA4 0x8056 #define GPU_GL_RGB565 0x8D62 -namespace shell { +namespace flutter { // Default maximum number of budgeted resources in the cache. static const int kGrCacheMaxCount = 8192; @@ -104,7 +104,7 @@ GPUSurfaceGL::~GPUSurfaceGL() { delegate_->GLContextClearCurrent(); } -// |shell::Surface| +// |Surface| bool GPUSurfaceGL::IsValid() { return valid_; } @@ -216,12 +216,12 @@ bool GPUSurfaceGL::CreateOrUpdateSurfaces(const SkISize& size) { return true; } -// |shell::Surface| +// |Surface| SkMatrix GPUSurfaceGL::GetRootTransformation() const { return delegate_->GLContextSurfaceTransformation(); } -// |shell::Surface| +// |Surface| std::unique_ptr GPUSurfaceGL::AcquireFrame(const SkISize& size) { if (delegate_ == nullptr) { return nullptr; @@ -314,19 +314,19 @@ sk_sp GPUSurfaceGL::AcquireRenderSurface( return offscreen_surface_ != nullptr ? offscreen_surface_ : onscreen_surface_; } -// |shell::Surface| +// |Surface| GrContext* GPUSurfaceGL::GetContext() { return context_.get(); } -// |shell::Surface| +// |Surface| flow::ExternalViewEmbedder* GPUSurfaceGL::GetExternalViewEmbedder() { return delegate_->GetExternalViewEmbedder(); } -// |shell::Surface| +// |Surface| bool GPUSurfaceGL::MakeRenderContextCurrent() { return delegate_->GLContextMakeCurrent(); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/gpu/gpu_surface_gl.h b/engine/src/flutter/shell/gpu/gpu_surface_gl.h index d9f85acedd..2c8e9afc6f 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_gl.h +++ b/engine/src/flutter/shell/gpu/gpu_surface_gl.h @@ -15,7 +15,7 @@ #include "flutter/shell/gpu/gpu_surface_gl_delegate.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace shell { +namespace flutter { class GPUSurfaceGL : public Surface { public: @@ -26,22 +26,22 @@ class GPUSurfaceGL : public Surface { ~GPUSurfaceGL() override; - // |shell::Surface| + // |Surface| bool IsValid() override; - // |shell::Surface| + // |Surface| std::unique_ptr AcquireFrame(const SkISize& size) override; - // |shell::Surface| + // |Surface| SkMatrix GetRootTransformation() const override; - // |shell::Surface| + // |Surface| GrContext* GetContext() override; - // |shell::Surface| + // |Surface| flow::ExternalViewEmbedder* GetExternalViewEmbedder() override; - // |shell::Surface| + // |Surface| bool MakeRenderContextCurrent() override; private: @@ -64,6 +64,6 @@ class GPUSurfaceGL : public Surface { FML_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceGL); }; -} // namespace shell +} // namespace flutter #endif // SHELL_GPU_GPU_SURFACE_GL_H_ diff --git a/engine/src/flutter/shell/gpu/gpu_surface_gl_delegate.cc b/engine/src/flutter/shell/gpu/gpu_surface_gl_delegate.cc index 1447a3de72..92f30039aa 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_gl_delegate.cc +++ b/engine/src/flutter/shell/gpu/gpu_surface_gl_delegate.cc @@ -6,7 +6,7 @@ #include "third_party/skia/include/gpu/gl/GrGLAssembleInterface.h" -namespace shell { +namespace flutter { bool GPUSurfaceGLDelegate::GLContextFBOResetAfterPresent() const { return false; @@ -66,9 +66,7 @@ static sk_sp CreateGLInterface( GPUSurfaceGLDelegate::GLProcResolver resolver; }; - ProcResolverContext context = { - proc_resolver - }; + ProcResolverContext context = {proc_resolver}; GrGLGetProc gl_get_proc = [](void* context, const char gl_proc_name[]) -> GrGLFuncPtr { @@ -101,4 +99,4 @@ GPUSurfaceGLDelegate::GetDefaultPlatformGLInterface() { return CreateGLInterface(nullptr); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/gpu/gpu_surface_gl_delegate.h b/engine/src/flutter/shell/gpu/gpu_surface_gl_delegate.h index b290ae63e5..0a8b9d5eca 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_gl_delegate.h +++ b/engine/src/flutter/shell/gpu/gpu_surface_gl_delegate.h @@ -10,7 +10,7 @@ #include "third_party/skia/include/core/SkMatrix.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" -namespace shell { +namespace flutter { class GPUSurfaceGLDelegate { public: @@ -64,6 +64,6 @@ class GPUSurfaceGLDelegate { virtual GLProcResolver GetGLProcResolver() const; }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_GPU_GPU_SURFACE_GL_DELEGATE_H_ diff --git a/engine/src/flutter/shell/gpu/gpu_surface_software.cc b/engine/src/flutter/shell/gpu/gpu_surface_software.cc index cea507c67b..78fba54919 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_software.cc +++ b/engine/src/flutter/shell/gpu/gpu_surface_software.cc @@ -7,7 +7,7 @@ #include #include "flutter/fml/logging.h" -namespace shell { +namespace flutter { flow::ExternalViewEmbedder* GPUSurfaceSoftwareDelegate::GetExternalViewEmbedder() { @@ -19,12 +19,12 @@ GPUSurfaceSoftware::GPUSurfaceSoftware(GPUSurfaceSoftwareDelegate* delegate) GPUSurfaceSoftware::~GPUSurfaceSoftware() = default; -// |shell::Surface| +// |Surface| bool GPUSurfaceSoftware::IsValid() { return delegate_ != nullptr; } -// |shell::Surface| +// |Surface| std::unique_ptr GPUSurfaceSoftware::AcquireFrame( const SkISize& logical_size) { if (!IsValid()) { @@ -65,7 +65,7 @@ std::unique_ptr GPUSurfaceSoftware::AcquireFrame( return std::make_unique(backing_store, on_submit); } -// |shell::Surface| +// |Surface| SkMatrix GPUSurfaceSoftware::GetRootTransformation() const { // This backend does not currently support root surface transformations. Just // return identity. @@ -74,15 +74,15 @@ SkMatrix GPUSurfaceSoftware::GetRootTransformation() const { return matrix; } -// |shell::Surface| +// |Surface| GrContext* GPUSurfaceSoftware::GetContext() { // There is no GrContext associated with a software surface. return nullptr; } -// |shell::Surface| +// |Surface| flow::ExternalViewEmbedder* GPUSurfaceSoftware::GetExternalViewEmbedder() { return delegate_->GetExternalViewEmbedder(); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/gpu/gpu_surface_software.h b/engine/src/flutter/shell/gpu/gpu_surface_software.h index eb64920a33..f544fd111d 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_software.h +++ b/engine/src/flutter/shell/gpu/gpu_surface_software.h @@ -11,7 +11,7 @@ #include "flutter/shell/common/surface.h" #include "third_party/skia/include/core/SkSurface.h" -namespace shell { +namespace flutter { class GPUSurfaceSoftwareDelegate { public: @@ -28,19 +28,19 @@ class GPUSurfaceSoftware : public Surface { ~GPUSurfaceSoftware() override; - // |shell::Surface| + // |Surface| bool IsValid() override; - // |shell::Surface| + // |Surface| std::unique_ptr AcquireFrame(const SkISize& size) override; - // |shell::Surface| + // |Surface| SkMatrix GetRootTransformation() const override; - // |shell::Surface| + // |Surface| GrContext* GetContext() override; - // |shell::Surface| + // |Surface| flow::ExternalViewEmbedder* GetExternalViewEmbedder() override; private: @@ -50,6 +50,6 @@ class GPUSurfaceSoftware : public Surface { FML_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceSoftware); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ diff --git a/engine/src/flutter/shell/gpu/gpu_surface_vulkan.cc b/engine/src/flutter/shell/gpu/gpu_surface_vulkan.cc index 3c42bf0876..fbc9696b15 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_vulkan.cc +++ b/engine/src/flutter/shell/gpu/gpu_surface_vulkan.cc @@ -5,7 +5,7 @@ #include "flutter/shell/gpu/gpu_surface_vulkan.h" #include "flutter/fml/logging.h" -namespace shell { +namespace flutter { GPUSurfaceVulkan::GPUSurfaceVulkan( fml::RefPtr proc_table, @@ -15,12 +15,12 @@ GPUSurfaceVulkan::GPUSurfaceVulkan( GPUSurfaceVulkan::~GPUSurfaceVulkan() = default; -// |shell::Surface| +// |Surface| bool GPUSurfaceVulkan::IsValid() { return window_.IsValid(); } -// |shell::Surface| +// |Surface| std::unique_ptr GPUSurfaceVulkan::AcquireFrame( const SkISize& size) { auto surface = window_.AcquireSurface(); @@ -44,7 +44,7 @@ std::unique_ptr GPUSurfaceVulkan::AcquireFrame( std::move(callback)); } -// |shell::Surface| +// |Surface| SkMatrix GPUSurfaceVulkan::GetRootTransformation() const { // This backend does not support delegating to the underlying platform to // query for root surface transformations. Just return identity. @@ -53,9 +53,9 @@ SkMatrix GPUSurfaceVulkan::GetRootTransformation() const { return matrix; } -// |shell::Surface| +// |Surface| GrContext* GPUSurfaceVulkan::GetContext() { return window_.GetSkiaGrContext(); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/gpu/gpu_surface_vulkan.h b/engine/src/flutter/shell/gpu/gpu_surface_vulkan.h index ece0cbb81b..7c410dd526 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_vulkan.h +++ b/engine/src/flutter/shell/gpu/gpu_surface_vulkan.h @@ -13,7 +13,7 @@ #include "flutter/vulkan/vulkan_native_surface.h" #include "flutter/vulkan/vulkan_window.h" -namespace shell { +namespace flutter { class GPUSurfaceVulkan : public Surface { public: @@ -22,16 +22,16 @@ class GPUSurfaceVulkan : public Surface { ~GPUSurfaceVulkan() override; - // |shell::Surface| + // |Surface| bool IsValid() override; - // |shell::Surface| + // |Surface| std::unique_ptr AcquireFrame(const SkISize& size) override; - // |shell::Surface| + // |Surface| SkMatrix GetRootTransformation() const override; - // |shell::Surface| + // |Surface| GrContext* GetContext() override; private: @@ -41,6 +41,6 @@ class GPUSurfaceVulkan : public Surface { FML_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceVulkan); }; -} // namespace shell +} // namespace flutter #endif // SHELL_GPU_GPU_SURFACE_VULKAN_H_ diff --git a/engine/src/flutter/shell/platform/android/android_context_gl.cc b/engine/src/flutter/shell/platform/android/android_context_gl.cc index 8ac43b4031..d3fd715a38 100644 --- a/engine/src/flutter/shell/platform/android/android_context_gl.cc +++ b/engine/src/flutter/shell/platform/android/android_context_gl.cc @@ -10,7 +10,7 @@ #include "flutter/fml/trace_event.h" -namespace shell { +namespace flutter { template using EGLResult = std::pair; @@ -272,4 +272,4 @@ bool AndroidContextGL::Resize(const SkISize& size) { return true; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/android_context_gl.h b/engine/src/flutter/shell/platform/android/android_context_gl.h index e29dc7ac4f..50e15aba2e 100644 --- a/engine/src/flutter/shell/platform/android/android_context_gl.h +++ b/engine/src/flutter/shell/platform/android/android_context_gl.h @@ -13,7 +13,7 @@ #include "flutter/shell/platform/android/android_native_window.h" #include "third_party/skia/include/core/SkSize.h" -namespace shell { +namespace flutter { class AndroidContextGL : public fml::RefCountedThreadSafe { public: @@ -53,6 +53,6 @@ class AndroidContextGL : public fml::RefCountedThreadSafe { FML_DISALLOW_COPY_AND_ASSIGN(AndroidContextGL); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_GL_H_ diff --git a/engine/src/flutter/shell/platform/android/android_environment_gl.cc b/engine/src/flutter/shell/platform/android/android_environment_gl.cc index 3d9f919bb0..a3259f1dcc 100644 --- a/engine/src/flutter/shell/platform/android/android_environment_gl.cc +++ b/engine/src/flutter/shell/platform/android/android_environment_gl.cc @@ -4,7 +4,7 @@ #include "flutter/shell/platform/android/android_environment_gl.h" -namespace shell { +namespace flutter { AndroidEnvironmentGL::AndroidEnvironmentGL() : display_(EGL_NO_DISPLAY), valid_(false) { @@ -38,4 +38,4 @@ EGLDisplay AndroidEnvironmentGL::Display() const { return display_; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/android_environment_gl.h b/engine/src/flutter/shell/platform/android/android_environment_gl.h index 710064e75d..23031a775d 100644 --- a/engine/src/flutter/shell/platform/android/android_environment_gl.h +++ b/engine/src/flutter/shell/platform/android/android_environment_gl.h @@ -10,7 +10,7 @@ #include -namespace shell { +namespace flutter { class AndroidEnvironmentGL : public fml::RefCountedThreadSafe { @@ -35,6 +35,6 @@ class AndroidEnvironmentGL FML_DISALLOW_COPY_AND_ASSIGN(AndroidEnvironmentGL); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_ENVIRONMENT_GL_H_ diff --git a/engine/src/flutter/shell/platform/android/android_external_texture_gl.cc b/engine/src/flutter/shell/platform/android/android_external_texture_gl.cc index 0d21841338..bd38598b66 100644 --- a/engine/src/flutter/shell/platform/android/android_external_texture_gl.cc +++ b/engine/src/flutter/shell/platform/android/android_external_texture_gl.cc @@ -9,7 +9,7 @@ #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" -namespace shell { +namespace flutter { AndroidExternalTextureGL::AndroidExternalTextureGL( int64_t id, @@ -120,4 +120,4 @@ void AndroidExternalTextureGL::Detach() { } } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/android_external_texture_gl.h b/engine/src/flutter/shell/platform/android/android_external_texture_gl.h index 09a56766e2..7db744caae 100644 --- a/engine/src/flutter/shell/platform/android/android_external_texture_gl.h +++ b/engine/src/flutter/shell/platform/android/android_external_texture_gl.h @@ -9,7 +9,7 @@ #include "flutter/flow/texture.h" #include "flutter/fml/platform/android/jni_weak_ref.h" -namespace shell { +namespace flutter { class AndroidExternalTextureGL : public flow::Texture { public: @@ -51,6 +51,6 @@ class AndroidExternalTextureGL : public flow::Texture { FML_DISALLOW_COPY_AND_ASSIGN(AndroidExternalTextureGL); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_ANDROID_EXTERNAL_TEXTURE_GL_H_ diff --git a/engine/src/flutter/shell/platform/android/android_native_window.cc b/engine/src/flutter/shell/platform/android/android_native_window.cc index af8b179d1b..fac43fa89d 100644 --- a/engine/src/flutter/shell/platform/android/android_native_window.cc +++ b/engine/src/flutter/shell/platform/android/android_native_window.cc @@ -4,7 +4,7 @@ #include "flutter/shell/platform/android/android_native_window.h" -namespace shell { +namespace flutter { AndroidNativeWindow::AndroidNativeWindow(Handle window) : window_(window) {} @@ -29,4 +29,4 @@ SkISize AndroidNativeWindow::GetSize() const { ANativeWindow_getHeight(window_)); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/android_native_window.h b/engine/src/flutter/shell/platform/android/android_native_window.h index 04938c5963..7e9626d63d 100644 --- a/engine/src/flutter/shell/platform/android/android_native_window.h +++ b/engine/src/flutter/shell/platform/android/android_native_window.h @@ -11,7 +11,7 @@ #include "flutter/fml/memory/ref_ptr.h" #include "third_party/skia/include/core/SkSize.h" -namespace shell { +namespace flutter { class AndroidNativeWindow : public fml::RefCountedThreadSafe { @@ -38,6 +38,6 @@ class AndroidNativeWindow FML_DISALLOW_COPY_AND_ASSIGN(AndroidNativeWindow); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_NATIVE_WINDOW_H_ diff --git a/engine/src/flutter/shell/platform/android/android_shell_holder.cc b/engine/src/flutter/shell/platform/android/android_shell_holder.cc index ca1dfd0ea7..931d09b933 100644 --- a/engine/src/flutter/shell/platform/android/android_shell_holder.cc +++ b/engine/src/flutter/shell/platform/android/android_shell_holder.cc @@ -19,7 +19,7 @@ #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/platform/android/platform_view_android.h" -namespace shell { +namespace flutter { AndroidShellHolder::AndroidShellHolder( flutter::Settings settings, @@ -162,8 +162,8 @@ void AndroidShellHolder::Launch(RunConfiguration config) { config = std::move(config) // ]() mutable { FML_LOG(INFO) << "Attempting to launch engine configuration..."; - if (!engine || engine->Run(std::move(config)) == - shell::Engine::RunStatus::Failure) { + if (!engine || + engine->Run(std::move(config)) == Engine::RunStatus::Failure) { FML_LOG(ERROR) << "Could not launch engine in configuration."; } else { FML_LOG(INFO) << "Isolate for engine configuration successfully " @@ -220,4 +220,4 @@ fml::WeakPtr AndroidShellHolder::GetPlatformView() { return platform_view_; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/android_shell_holder.h b/engine/src/flutter/shell/platform/android/android_shell_holder.h index 5e33dbc972..6d123970fc 100644 --- a/engine/src/flutter/shell/platform/android/android_shell_holder.h +++ b/engine/src/flutter/shell/platform/android/android_shell_holder.h @@ -16,7 +16,7 @@ #include "flutter/shell/common/thread_host.h" #include "flutter/shell/platform/android/platform_view_android.h" -namespace shell { +namespace flutter { class AndroidShellHolder { public: @@ -59,6 +59,6 @@ class AndroidShellHolder { FML_DISALLOW_COPY_AND_ASSIGN(AndroidShellHolder); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ diff --git a/engine/src/flutter/shell/platform/android/android_surface.cc b/engine/src/flutter/shell/platform/android/android_surface.cc index cb1ee518ab..958570a822 100644 --- a/engine/src/flutter/shell/platform/android/android_surface.cc +++ b/engine/src/flutter/shell/platform/android/android_surface.cc @@ -12,7 +12,7 @@ #include "flutter/shell/platform/android/android_surface_vulkan.h" #endif // SHELL_ENABLE_VULKAN -namespace shell { +namespace flutter { std::unique_ptr AndroidSurface::Create( bool use_software_rendering) { @@ -32,4 +32,4 @@ std::unique_ptr AndroidSurface::Create( AndroidSurface::~AndroidSurface() = default; -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/android_surface.h b/engine/src/flutter/shell/platform/android/android_surface.h index 0ecc9ffc76..43f4cf33d0 100644 --- a/engine/src/flutter/shell/platform/android/android_surface.h +++ b/engine/src/flutter/shell/platform/android/android_surface.h @@ -15,7 +15,7 @@ #include "flutter/shell/platform/android/android_native_window.h" #include "third_party/skia/include/core/SkSize.h" -namespace shell { +namespace flutter { class AndroidSurface { public: @@ -38,6 +38,6 @@ class AndroidSurface { virtual bool SetNativeWindow(fml::RefPtr window) = 0; }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_H_ diff --git a/engine/src/flutter/shell/platform/android/android_surface_gl.cc b/engine/src/flutter/shell/platform/android/android_surface_gl.cc index 83586b4030..ff0e45fcef 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_gl.cc +++ b/engine/src/flutter/shell/platform/android/android_surface_gl.cc @@ -9,7 +9,7 @@ #include "flutter/fml/logging.h" #include "flutter/fml/memory/ref_ptr.h" -namespace shell { +namespace flutter { static fml::RefPtr CreateResourceLoadingContext() { auto environment = fml::MakeRefCounted(); @@ -125,4 +125,4 @@ intptr_t AndroidSurfaceGL::GLContextFBO() const { return 0; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/android_surface_gl.h b/engine/src/flutter/shell/platform/android/android_surface_gl.h index 5c6f4aa65e..7592ad5f8d 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_gl.h +++ b/engine/src/flutter/shell/platform/android/android_surface_gl.h @@ -14,7 +14,7 @@ #include "flutter/shell/platform/android/android_environment_gl.h" #include "flutter/shell/platform/android/android_surface.h" -namespace shell { +namespace flutter { class AndroidSurfaceGL final : public GPUSurfaceGLDelegate, public AndroidSurface { @@ -25,37 +25,37 @@ class AndroidSurfaceGL final : public GPUSurfaceGLDelegate, bool IsOffscreenContextValid() const; - // |shell::AndroidSurface| + // |AndroidSurface| bool IsValid() const override; - // |shell::AndroidSurface| + // |AndroidSurface| std::unique_ptr CreateGPUSurface() override; - // |shell::AndroidSurface| + // |AndroidSurface| void TeardownOnScreenContext() override; - // |shell::AndroidSurface| + // |AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; - // |shell::AndroidSurface| + // |AndroidSurface| bool ResourceContextMakeCurrent() override; - // |shell::AndroidSurface| + // |AndroidSurface| bool ResourceContextClearCurrent() override; - // |shell::AndroidSurface| + // |AndroidSurface| bool SetNativeWindow(fml::RefPtr window) override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| bool GLContextClearCurrent() override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| bool GLContextPresent() override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| intptr_t GLContextFBO() const override; private: @@ -65,6 +65,6 @@ class AndroidSurfaceGL final : public GPUSurfaceGLDelegate, FML_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceGL); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_GL_H_ diff --git a/engine/src/flutter/shell/platform/android/android_surface_software.cc b/engine/src/flutter/shell/platform/android/android_surface_software.cc index c412e70f96..633b6091f0 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_software.cc +++ b/engine/src/flutter/shell/platform/android/android_surface_software.cc @@ -13,7 +13,7 @@ #include "flutter/fml/trace_event.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" -namespace shell { +namespace flutter { namespace { @@ -153,4 +153,4 @@ bool AndroidSurfaceSoftware::SetNativeWindow( return true; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/android_surface_software.h b/engine/src/flutter/shell/platform/android/android_surface_software.h index c7410642cb..cf7fcb3e20 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_software.h +++ b/engine/src/flutter/shell/platform/android/android_surface_software.h @@ -11,7 +11,7 @@ #include "flutter/shell/gpu/gpu_surface_software.h" #include "flutter/shell/platform/android/android_surface.h" -namespace shell { +namespace flutter { class AndroidSurfaceSoftware final : public AndroidSurface, public GPUSurfaceSoftwareDelegate { @@ -20,31 +20,31 @@ class AndroidSurfaceSoftware final : public AndroidSurface, ~AndroidSurfaceSoftware() override; - // |shell::AndroidSurface| + // |AndroidSurface| bool IsValid() const override; - // |shell::AndroidSurface| + // |AndroidSurface| bool ResourceContextMakeCurrent() override; - // |shell::AndroidSurface| + // |AndroidSurface| bool ResourceContextClearCurrent() override; - // |shell::AndroidSurface| + // |AndroidSurface| std::unique_ptr CreateGPUSurface() override; - // |shell::AndroidSurface| + // |AndroidSurface| void TeardownOnScreenContext() override; - // |shell::AndroidSurface| + // |AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; - // |shell::AndroidSurface| + // |AndroidSurface| bool SetNativeWindow(fml::RefPtr window) override; - // |shell::GPUSurfaceSoftwareDelegate| + // |GPUSurfaceSoftwareDelegate| sk_sp AcquireBackingStore(const SkISize& size) override; - // |shell::GPUSurfaceSoftwareDelegate| + // |GPUSurfaceSoftwareDelegate| bool PresentBackingStore(sk_sp backing_store) override; private: @@ -56,6 +56,6 @@ class AndroidSurfaceSoftware final : public AndroidSurface, FML_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceSoftware); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_SOFTWARE_H_ diff --git a/engine/src/flutter/shell/platform/android/android_surface_vulkan.cc b/engine/src/flutter/shell/platform/android/android_surface_vulkan.cc index 7753a42081..66cde9731d 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_vulkan.cc +++ b/engine/src/flutter/shell/platform/android/android_surface_vulkan.cc @@ -10,7 +10,7 @@ #include "flutter/shell/gpu/gpu_surface_vulkan.h" #include "flutter/vulkan/vulkan_native_surface_android.h" -namespace shell { +namespace flutter { AndroidSurfaceVulkan::AndroidSurfaceVulkan() : proc_table_(fml::MakeRefCounted()) {} @@ -21,12 +21,12 @@ bool AndroidSurfaceVulkan::IsValid() const { return proc_table_->HasAcquiredMandatoryProcAddresses(); } -// |shell::AndroidSurface| +// |AndroidSurface| void AndroidSurfaceVulkan::TeardownOnScreenContext() { // Nothing to do. } -// |shell::AndroidSurface| +// |AndroidSurface| std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { if (!IsValid()) { return nullptr; @@ -54,28 +54,28 @@ std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { return gpu_surface; } -// |shell::AndroidSurface| +// |AndroidSurface| bool AndroidSurfaceVulkan::OnScreenSurfaceResize(const SkISize& size) const { return true; } -// |shell::AndroidSurface| +// |AndroidSurface| bool AndroidSurfaceVulkan::ResourceContextMakeCurrent() { FML_DLOG(ERROR) << "The vulkan backend does not support resource contexts."; return false; } -// |shell::AndroidSurface| +// |AndroidSurface| bool AndroidSurfaceVulkan::ResourceContextClearCurrent() { FML_DLOG(ERROR) << "The vulkan backend does not support resource contexts."; return false; } -// |shell::AndroidSurface| +// |AndroidSurface| bool AndroidSurfaceVulkan::SetNativeWindow( fml::RefPtr window) { native_window_ = std::move(window); return native_window_ && native_window_->IsValid(); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/android_surface_vulkan.h b/engine/src/flutter/shell/platform/android/android_surface_vulkan.h index ef6eec003a..5c025b8e05 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_vulkan.h +++ b/engine/src/flutter/shell/platform/android/android_surface_vulkan.h @@ -12,7 +12,7 @@ #include "flutter/shell/platform/android/android_surface.h" #include "flutter/vulkan/vulkan_window.h" -namespace shell { +namespace flutter { class AndroidSurfaceVulkan : public AndroidSurface { public: @@ -20,25 +20,25 @@ class AndroidSurfaceVulkan : public AndroidSurface { ~AndroidSurfaceVulkan() override; - // |shell::AndroidSurface| + // |AndroidSurface| bool IsValid() const override; - // |shell::AndroidSurface| + // |AndroidSurface| std::unique_ptr CreateGPUSurface() override; - // |shell::AndroidSurface| + // |AndroidSurface| void TeardownOnScreenContext() override; - // |shell::AndroidSurface| + // |AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; - // |shell::AndroidSurface| + // |AndroidSurface| bool ResourceContextMakeCurrent() override; - // |shell::AndroidSurface| + // |AndroidSurface| bool ResourceContextClearCurrent() override; - // |shell::AndroidSurface| + // |AndroidSurface| bool SetNativeWindow(fml::RefPtr window) override; private: @@ -48,6 +48,6 @@ class AndroidSurfaceVulkan : public AndroidSurface { FML_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceVulkan); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_VULKAN_H_ diff --git a/engine/src/flutter/shell/platform/android/flutter_main.cc b/engine/src/flutter/shell/platform/android/flutter_main.cc index d1bdd20c01..16b1fbcff7 100644 --- a/engine/src/flutter/shell/platform/android/flutter_main.cc +++ b/engine/src/flutter/shell/platform/android/flutter_main.cc @@ -23,7 +23,7 @@ #include "flutter/shell/common/switches.h" #include "third_party/dart/runtime/include/dart_tools_api.h" -namespace shell { +namespace flutter { extern "C" { #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG @@ -148,4 +148,4 @@ bool FlutterMain::Register(JNIEnv* env) { return env->RegisterNatives(clazz, methods, arraysize(methods)) == 0; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/flutter_main.h b/engine/src/flutter/shell/platform/android/flutter_main.h index f40438dfae..5f6b3eb075 100644 --- a/engine/src/flutter/shell/platform/android/flutter_main.h +++ b/engine/src/flutter/shell/platform/android/flutter_main.h @@ -10,7 +10,7 @@ #include "flutter/common/settings.h" #include "flutter/fml/macros.h" -namespace shell { +namespace flutter { class FlutterMain { public: @@ -38,6 +38,6 @@ class FlutterMain { FML_DISALLOW_COPY_AND_ASSIGN(FlutterMain); }; -} // namespace shell +} // namespace flutter #endif // SHELL_PLATFORM_ANDROID_FLUTTER_MAIN_H_ diff --git a/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterMain.java b/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterMain.java index 504e7b3227..14b9320618 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterMain.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterMain.java @@ -28,7 +28,7 @@ import java.util.*; public class FlutterMain { private static final String TAG = "FlutterMain"; - // Must match values in sky::shell::switches + // Must match values in sky::switches private static final String AOT_SHARED_LIBRARY_PATH = "aot-shared-library-path"; private static final String AOT_SNAPSHOT_PATH_KEY = "aot-snapshot-path"; private static final String AOT_VM_SNAPSHOT_DATA_KEY = "vm-snapshot-data"; diff --git a/engine/src/flutter/shell/platform/android/library_loader.cc b/engine/src/flutter/shell/platform/android/library_loader.cc index c625414470..71725a3174 100644 --- a/engine/src/flutter/shell/platform/android/library_loader.cc +++ b/engine/src/flutter/shell/platform/android/library_loader.cc @@ -16,15 +16,15 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { bool result = false; // Register FlutterMain. - result = shell::FlutterMain::Register(env); + result = flutter::FlutterMain::Register(env); FML_CHECK(result); // Register PlatformView - result = shell::PlatformViewAndroid::Register(env); + result = flutter::PlatformViewAndroid::Register(env); FML_CHECK(result); // Register VSyncWaiter. - result = shell::VsyncWaiterAndroid::Register(env); + result = flutter::VsyncWaiterAndroid::Register(env); FML_CHECK(result); return JNI_VERSION_1_4; diff --git a/engine/src/flutter/shell/platform/android/platform_message_response_android.cc b/engine/src/flutter/shell/platform/android/platform_message_response_android.cc index b204d6db60..f79f2b8c15 100644 --- a/engine/src/flutter/shell/platform/android/platform_message_response_android.cc +++ b/engine/src/flutter/shell/platform/android/platform_message_response_android.cc @@ -7,7 +7,7 @@ #include "flutter/fml/make_copyable.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" -namespace shell { +namespace flutter { PlatformMessageResponseAndroid::PlatformMessageResponseAndroid( int response_id, @@ -72,4 +72,4 @@ void PlatformMessageResponseAndroid::CompleteEmpty() { response, nullptr); })); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/platform_message_response_android.h b/engine/src/flutter/shell/platform/android/platform_message_response_android.h index 83e58bf47d..a93b4c802e 100644 --- a/engine/src/flutter/shell/platform/android/platform_message_response_android.h +++ b/engine/src/flutter/shell/platform/android/platform_message_response_android.h @@ -10,7 +10,7 @@ #include "flutter/fml/task_runner.h" #include "flutter/lib/ui/window/platform_message_response.h" -namespace shell { +namespace flutter { class PlatformMessageResponseAndroid : public flutter::PlatformMessageResponse { public: @@ -36,6 +36,6 @@ class PlatformMessageResponseAndroid : public flutter::PlatformMessageResponse { FML_DISALLOW_COPY_AND_ASSIGN(PlatformMessageResponseAndroid); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ diff --git a/engine/src/flutter/shell/platform/android/platform_view_android.cc b/engine/src/flutter/shell/platform/android/platform_view_android.cc index 11fb3c91b4..449a7e4571 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.cc +++ b/engine/src/flutter/shell/platform/android/platform_view_android.cc @@ -8,7 +8,7 @@ #include #include "flutter/fml/synchronization/waitable_event.h" -#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/common/shell_io_manager.h" #include "flutter/shell/gpu/gpu_surface_gl_delegate.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" #include "flutter/shell/platform/android/android_surface_gl.h" @@ -16,7 +16,7 @@ #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "flutter/shell/platform/android/vsync_waiter_android.h" -namespace shell { +namespace flutter { PlatformViewAndroid::PlatformViewAndroid( PlatformView::Delegate& delegate, @@ -157,7 +157,7 @@ void PlatformViewAndroid::InvokePlatformMessageEmptyResponseCallback( message_response->CompleteEmpty(); } -// |shell::PlatformView| +// |PlatformView| void PlatformViewAndroid::HandlePlatformMessage( fml::RefPtr message) { JNIEnv* env = fml::jni::AttachCurrentThread(); @@ -191,7 +191,7 @@ void PlatformViewAndroid::HandlePlatformMessage( } } -// |shell::PlatformView| +// |PlatformView| void PlatformViewAndroid::OnPreEngineRestart() const { JNIEnv* env = fml::jni::AttachCurrentThread(); fml::jni::ScopedJavaLocalRef view = java_object_.get(env); @@ -223,7 +223,7 @@ void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, std::move(args_vector)); } -// |shell::PlatformView| +// |PlatformView| void PlatformViewAndroid::UpdateSemantics( flutter::SemanticsNodeUpdates update, flutter::CustomAccessibilityActionUpdates actions) { @@ -376,12 +376,12 @@ void PlatformViewAndroid::RegisterExternalTexture( std::make_shared(texture_id, surface_texture)); } -// |shell::PlatformView| +// |PlatformView| std::unique_ptr PlatformViewAndroid::CreateVSyncWaiter() { return std::make_unique(task_runners_); } -// |shell::PlatformView| +// |PlatformView| std::unique_ptr PlatformViewAndroid::CreateRenderingSurface() { if (!android_surface_) { return nullptr; @@ -389,7 +389,7 @@ std::unique_ptr PlatformViewAndroid::CreateRenderingSurface() { return android_surface_->CreateGPUSurface(); } -// |shell::PlatformView| +// |PlatformView| sk_sp PlatformViewAndroid::CreateResourceContext() const { if (!android_surface_) { return nullptr; @@ -399,7 +399,7 @@ sk_sp PlatformViewAndroid::CreateResourceContext() const { // TODO(chinmaygarde): Currently, this code depends on the fact that only // the OpenGL surface will be able to make a resource context current. If // this changes, this assumption breaks. Handle the same. - resource_context = IOManager::CreateCompatibleResourceLoadingContext( + resource_context = ShellIOManager::CreateCompatibleResourceLoadingContext( GrBackend::kOpenGL_GrBackend, GPUSurfaceGLDelegate::GetDefaultPlatformGLInterface()); } else { @@ -409,7 +409,7 @@ sk_sp PlatformViewAndroid::CreateResourceContext() const { return resource_context; } -// |shell::PlatformView| +// |PlatformView| void PlatformViewAndroid::ReleaseResourceContext() const { if (android_surface_) { android_surface_->ResourceContextClearCurrent(); @@ -442,4 +442,4 @@ void PlatformViewAndroid::FireFirstFrameCallback() { FlutterViewOnFirstFrame(fml::jni::AttachCurrentThread(), view.obj()); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/platform_view_android.h b/engine/src/flutter/shell/platform/android/platform_view_android.h index 34cd55dad8..74c0bbe6c2 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.h +++ b/engine/src/flutter/shell/platform/android/platform_view_android.h @@ -18,7 +18,7 @@ #include "flutter/shell/platform/android/android_native_window.h" #include "flutter/shell/platform/android/android_surface.h" -namespace shell { +namespace flutter { class PlatformViewAndroid final : public PlatformView { public: @@ -42,7 +42,7 @@ class PlatformViewAndroid final : public PlatformView { void NotifyChanged(const SkISize& size); - // |shell::PlatformView| + // |PlatformView| void NotifyDestroyed() override; void DispatchPlatformMessage(JNIEnv* env, @@ -81,28 +81,28 @@ class PlatformViewAndroid final : public PlatformView { std::unordered_map> pending_responses_; - // |shell::PlatformView| + // |PlatformView| void UpdateSemantics( flutter::SemanticsNodeUpdates update, flutter::CustomAccessibilityActionUpdates actions) override; - // |shell::PlatformView| + // |PlatformView| void HandlePlatformMessage( fml::RefPtr message) override; - // |shell::PlatformView| + // |PlatformView| void OnPreEngineRestart() const override; - // |shell::PlatformView| + // |PlatformView| std::unique_ptr CreateVSyncWaiter() override; - // |shell::PlatformView| + // |PlatformView| std::unique_ptr CreateRenderingSurface() override; - // |shell::PlatformView| + // |PlatformView| sk_sp CreateResourceContext() const override; - // |shell::PlatformView| + // |PlatformView| void ReleaseResourceContext() const override; void InstallFirstFrameCallback(); @@ -112,6 +112,6 @@ class PlatformViewAndroid final : public PlatformView { FML_DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid); }; -} // namespace shell +} // namespace flutter #endif // SHELL_PLATFORM_ANDROID_PLATFORM_VIEW_ANDROID_H_ diff --git a/engine/src/flutter/shell/platform/android/platform_view_android_jni.cc b/engine/src/flutter/shell/platform/android/platform_view_android_jni.cc index 2e972c7ecd..38db3453ce 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android_jni.cc +++ b/engine/src/flutter/shell/platform/android/platform_view_android_jni.cc @@ -25,9 +25,9 @@ #include "flutter/shell/platform/android/flutter_main.h" #define ANDROID_SHELL_HOLDER \ - (reinterpret_cast(shell_holder)) + (reinterpret_cast(shell_holder)) -namespace shell { +namespace flutter { namespace { @@ -540,114 +540,112 @@ bool RegisterApi(JNIEnv* env) { { .name = "nativeAttach", .signature = "(Lio/flutter/embedding/engine/FlutterJNI;Z)J", - .fnPtr = reinterpret_cast(&shell::AttachJNI), + .fnPtr = reinterpret_cast(&AttachJNI), }, { .name = "nativeDestroy", .signature = "(J)V", - .fnPtr = reinterpret_cast(&shell::DestroyJNI), + .fnPtr = reinterpret_cast(&DestroyJNI), }, { .name = "nativeRunBundleAndSnapshotFromLibrary", .signature = "(J[Ljava/lang/String;Ljava/lang/String;" "Ljava/lang/String;Landroid/content/res/AssetManager;)V", - .fnPtr = - reinterpret_cast(&shell::RunBundleAndSnapshotFromLibrary), + .fnPtr = reinterpret_cast(&RunBundleAndSnapshotFromLibrary), }, { .name = "nativeGetObservatoryUri", .signature = "()Ljava/lang/String;", - .fnPtr = reinterpret_cast(&shell::GetObservatoryUri), + .fnPtr = reinterpret_cast(&GetObservatoryUri), }, { .name = "nativeDispatchEmptyPlatformMessage", .signature = "(JLjava/lang/String;I)V", - .fnPtr = - reinterpret_cast(&shell::DispatchEmptyPlatformMessage), + .fnPtr = reinterpret_cast(&DispatchEmptyPlatformMessage), }, { .name = "nativeDispatchPlatformMessage", .signature = "(JLjava/lang/String;Ljava/nio/ByteBuffer;II)V", - .fnPtr = reinterpret_cast(&shell::DispatchPlatformMessage), + .fnPtr = reinterpret_cast(&DispatchPlatformMessage), }, { .name = "nativeInvokePlatformMessageResponseCallback", .signature = "(JILjava/nio/ByteBuffer;I)V", - .fnPtr = reinterpret_cast( - &shell::InvokePlatformMessageResponseCallback), + .fnPtr = + reinterpret_cast(&InvokePlatformMessageResponseCallback), }, { .name = "nativeInvokePlatformMessageEmptyResponseCallback", .signature = "(JI)V", .fnPtr = reinterpret_cast( - &shell::InvokePlatformMessageEmptyResponseCallback), + &InvokePlatformMessageEmptyResponseCallback), }, // Start of methods from FlutterView { .name = "nativeGetBitmap", .signature = "(J)Landroid/graphics/Bitmap;", - .fnPtr = reinterpret_cast(&shell::GetBitmap), + .fnPtr = reinterpret_cast(&GetBitmap), }, { .name = "nativeSurfaceCreated", .signature = "(JLandroid/view/Surface;)V", - .fnPtr = reinterpret_cast(&shell::SurfaceCreated), + .fnPtr = reinterpret_cast(&SurfaceCreated), }, { .name = "nativeSurfaceChanged", .signature = "(JII)V", - .fnPtr = reinterpret_cast(&shell::SurfaceChanged), + .fnPtr = reinterpret_cast(&SurfaceChanged), }, { .name = "nativeSurfaceDestroyed", .signature = "(J)V", - .fnPtr = reinterpret_cast(&shell::SurfaceDestroyed), + .fnPtr = reinterpret_cast(&SurfaceDestroyed), }, { .name = "nativeSetViewportMetrics", .signature = "(JFIIIIIIIIII)V", - .fnPtr = reinterpret_cast(&shell::SetViewportMetrics), + .fnPtr = reinterpret_cast(&SetViewportMetrics), }, { .name = "nativeDispatchPointerDataPacket", .signature = "(JLjava/nio/ByteBuffer;I)V", - .fnPtr = reinterpret_cast(&shell::DispatchPointerDataPacket), + .fnPtr = reinterpret_cast(&DispatchPointerDataPacket), }, { .name = "nativeDispatchSemanticsAction", .signature = "(JIILjava/nio/ByteBuffer;I)V", - .fnPtr = reinterpret_cast(&shell::DispatchSemanticsAction), + .fnPtr = reinterpret_cast(&DispatchSemanticsAction), }, { .name = "nativeSetSemanticsEnabled", .signature = "(JZ)V", - .fnPtr = reinterpret_cast(&shell::SetSemanticsEnabled), + .fnPtr = reinterpret_cast(&SetSemanticsEnabled), }, { .name = "nativeSetAccessibilityFeatures", .signature = "(JI)V", - .fnPtr = reinterpret_cast(&shell::SetAccessibilityFeatures), + .fnPtr = reinterpret_cast(&SetAccessibilityFeatures), }, { .name = "nativeGetIsSoftwareRenderingEnabled", .signature = "()Z", - .fnPtr = reinterpret_cast(&shell::GetIsSoftwareRendering), + .fnPtr = reinterpret_cast(&GetIsSoftwareRendering), }, { .name = "nativeRegisterTexture", .signature = "(JJLandroid/graphics/SurfaceTexture;)V", - .fnPtr = reinterpret_cast(&shell::RegisterTexture), + .fnPtr = reinterpret_cast(&RegisterTexture), }, { .name = "nativeMarkTextureFrameAvailable", .signature = "(JJ)V", - .fnPtr = reinterpret_cast(&shell::MarkTextureFrameAvailable), + .fnPtr = reinterpret_cast(&MarkTextureFrameAvailable), }, { .name = "nativeUnregisterTexture", .signature = "(JJ)V", - .fnPtr = reinterpret_cast(&shell::UnregisterTexture), + .fnPtr = reinterpret_cast(&UnregisterTexture), }, }; @@ -751,7 +749,7 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { { .name = "nativeLookupCallbackInformation", .signature = "(J)Lio/flutter/view/FlutterCallbackInformation;", - .fnPtr = reinterpret_cast(&shell::LookupCallbackInformation), + .fnPtr = reinterpret_cast(&LookupCallbackInformation), }, }; @@ -797,4 +795,4 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { return RegisterApi(env); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/platform_view_android_jni.h b/engine/src/flutter/shell/platform/android/platform_view_android_jni.h index 3423c745fd..07c70b2a45 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android_jni.h +++ b/engine/src/flutter/shell/platform/android/platform_view_android_jni.h @@ -9,7 +9,7 @@ #include "flutter/fml/macros.h" #include "flutter/shell/platform/android/platform_view_android.h" -namespace shell { +namespace flutter { void FlutterViewHandlePlatformMessage(JNIEnv* env, jobject obj, @@ -46,6 +46,6 @@ void SurfaceTextureGetTransformMatrix(JNIEnv* env, void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj); -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_VIEW_ANDROID_JNI_H_ diff --git a/engine/src/flutter/shell/platform/android/vsync_waiter_android.cc b/engine/src/flutter/shell/platform/android/vsync_waiter_android.cc index 9a9d79f672..513cc6ff74 100644 --- a/engine/src/flutter/shell/platform/android/vsync_waiter_android.cc +++ b/engine/src/flutter/shell/platform/android/vsync_waiter_android.cc @@ -14,7 +14,7 @@ #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" -namespace shell { +namespace flutter { static fml::jni::ScopedJavaGlobalRef* g_vsync_waiter_class = nullptr; static jmethodID g_async_wait_for_vsync_method_ = nullptr; @@ -24,7 +24,7 @@ VsyncWaiterAndroid::VsyncWaiterAndroid(flutter::TaskRunners task_runners) VsyncWaiterAndroid::~VsyncWaiterAndroid() = default; -// |shell::VsyncWaiter| +// |VsyncWaiter| void VsyncWaiterAndroid::AwaitVSync() { auto* weak_this = new std::weak_ptr(shared_from_this()); jlong java_baton = reinterpret_cast(weak_this); @@ -105,4 +105,4 @@ bool VsyncWaiterAndroid::Register(JNIEnv* env) { return env->RegisterNatives(clazz, methods, arraysize(methods)) == 0; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/android/vsync_waiter_android.h b/engine/src/flutter/shell/platform/android/vsync_waiter_android.h index a3089cd074..be086581bd 100644 --- a/engine/src/flutter/shell/platform/android/vsync_waiter_android.h +++ b/engine/src/flutter/shell/platform/android/vsync_waiter_android.h @@ -12,7 +12,7 @@ #include "flutter/fml/macros.h" #include "flutter/shell/common/vsync_waiter.h" -namespace shell { +namespace flutter { class VsyncWaiterAndroid final : public VsyncWaiter { public: @@ -25,7 +25,7 @@ class VsyncWaiterAndroid final : public VsyncWaiter { float GetDisplayRefreshRate() const override; private: - // |shell::VsyncWaiter| + // |VsyncWaiter| void AwaitVSync() override; static void OnNativeVsync(JNIEnv* env, @@ -41,6 +41,6 @@ class VsyncWaiterAndroid final : public VsyncWaiter { FML_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterAndroid); }; -} // namespace shell +} // namespace flutter #endif // SHELL_PLATFORM_ANDROID_ASYNC_WAITER_ANDROID_H_ diff --git a/engine/src/flutter/shell/platform/common/cpp/incoming_message_dispatcher.cc b/engine/src/flutter/shell/platform/common/cpp/incoming_message_dispatcher.cc index f766f77381..31eed6b559 100644 --- a/engine/src/flutter/shell/platform/common/cpp/incoming_message_dispatcher.cc +++ b/engine/src/flutter/shell/platform/common/cpp/incoming_message_dispatcher.cc @@ -4,7 +4,7 @@ #include "flutter/shell/platform/common/cpp/incoming_message_dispatcher.h" -namespace shell { +namespace flutter { IncomingMessageDispatcher::IncomingMessageDispatcher( FlutterDesktopMessengerRef messenger) @@ -54,4 +54,4 @@ void IncomingMessageDispatcher::EnableInputBlockingForChannel( input_blocking_channels_.insert(channel); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/common/cpp/incoming_message_dispatcher.h b/engine/src/flutter/shell/platform/common/cpp/incoming_message_dispatcher.h index fced7db7a8..3eb874bc73 100644 --- a/engine/src/flutter/shell/platform/common/cpp/incoming_message_dispatcher.h +++ b/engine/src/flutter/shell/platform/common/cpp/incoming_message_dispatcher.h @@ -13,7 +13,7 @@ #include "flutter/shell/platform/common/cpp/public/flutter_messenger.h" -namespace shell { +namespace flutter { // Manages per-channel registration of callbacks for handling messages from the // Flutter engine, and dispatching incoming messages to those handlers. @@ -73,6 +73,6 @@ class IncomingMessageDispatcher { std::set input_blocking_channels_; }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_CPP_INCOMING_MESSAGE_DISPATCHER_H_ diff --git a/engine/src/flutter/shell/platform/common/cpp/text_input_model.cc b/engine/src/flutter/shell/platform/common/cpp/text_input_model.cc index 2f1c9b3741..41231a6d61 100644 --- a/engine/src/flutter/shell/platform/common/cpp/text_input_model.cc +++ b/engine/src/flutter/shell/platform/common/cpp/text_input_model.cc @@ -26,7 +26,7 @@ static constexpr char kTextInputAction[] = "inputAction"; static constexpr char kTextInputType[] = "inputType"; static constexpr char kTextInputTypeName[] = "name"; -namespace shell { +namespace flutter { TextInputModel::TextInputModel(int client_id, const rapidjson::Value& config) : text_(""), @@ -178,4 +178,4 @@ std::unique_ptr TextInputModel::GetState() const { return args; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/common/cpp/text_input_model.h b/engine/src/flutter/shell/platform/common/cpp/text_input_model.h index 3ae567c50c..54afd05521 100644 --- a/engine/src/flutter/shell/platform/common/cpp/text_input_model.h +++ b/engine/src/flutter/shell/platform/common/cpp/text_input_model.h @@ -9,7 +9,7 @@ #include "rapidjson/document.h" -namespace shell { +namespace flutter { // Handles underlying text input state, using a simple ASCII model. // // Ignores special states like "insert mode" for now. @@ -96,6 +96,6 @@ class TextInputModel { std::string::iterator selection_extent_; }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_CPP_TEXT_INPUT_MODEL_H_ diff --git a/engine/src/flutter/shell/platform/darwin/common/buffer_conversions.h b/engine/src/flutter/shell/platform/darwin/common/buffer_conversions.h index a5b166d2e3..60559b2dfe 100644 --- a/engine/src/flutter/shell/platform/darwin/common/buffer_conversions.h +++ b/engine/src/flutter/shell/platform/darwin/common/buffer_conversions.h @@ -11,7 +11,7 @@ #include "flutter/fml/mapping.h" -namespace shell { +namespace flutter { std::vector GetVectorFromNSData(NSData* data); @@ -21,6 +21,6 @@ std::unique_ptr GetMappingFromNSData(NSData* data); NSData* GetNSDataFromMapping(std::unique_ptr mapping); -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_BUFFER_CONVERSIONS_H_ diff --git a/engine/src/flutter/shell/platform/darwin/common/buffer_conversions.mm b/engine/src/flutter/shell/platform/darwin/common/buffer_conversions.mm index 237910b2cf..943ff57c2b 100644 --- a/engine/src/flutter/shell/platform/darwin/common/buffer_conversions.mm +++ b/engine/src/flutter/shell/platform/darwin/common/buffer_conversions.mm @@ -4,7 +4,7 @@ #include "flutter/shell/platform/darwin/common/buffer_conversions.h" -namespace shell { +namespace flutter { std::vector GetVectorFromNSData(NSData* data) { const uint8_t* bytes = reinterpret_cast(data.bytes); @@ -23,4 +23,4 @@ NSData* GetNSDataFromMapping(std::unique_ptr mapping) { return [NSData dataWithBytes:mapping->GetMapping() length:mapping->GetSize()]; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/common/command_line.h b/engine/src/flutter/shell/platform/darwin/common/command_line.h index fab7ff0aa2..e3c6eecb52 100644 --- a/engine/src/flutter/shell/platform/darwin/common/command_line.h +++ b/engine/src/flutter/shell/platform/darwin/common/command_line.h @@ -8,10 +8,10 @@ #include "flutter/fml/command_line.h" #include "flutter/fml/macros.h" -namespace shell { +namespace flutter { fml::CommandLine CommandLineFromNSProcessInfo(); -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ diff --git a/engine/src/flutter/shell/platform/darwin/common/command_line.mm b/engine/src/flutter/shell/platform/darwin/common/command_line.mm index 84ab3ca432..6b601fae30 100644 --- a/engine/src/flutter/shell/platform/darwin/common/command_line.mm +++ b/engine/src/flutter/shell/platform/darwin/common/command_line.mm @@ -6,7 +6,7 @@ #import -namespace shell { +namespace flutter { fml::CommandLine CommandLineFromNSProcessInfo() { std::vector args_vector; @@ -18,4 +18,4 @@ fml::CommandLine CommandLineFromNSProcessInfo() { return fml::CommandLineFromIterators(args_vector.begin(), args_vector.end()); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index 1af9fcdd9f..47277007a9 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -26,7 +26,7 @@ extern const intptr_t kPlatformStrongDillSize; static const char* kApplicationKernelSnapshotFileName = "kernel_blob.bin"; static flutter::Settings DefaultSettingsForProcess(NSBundle* bundle = nil) { - auto command_line = shell::CommandLineFromNSProcessInfo(); + auto command_line = flutter::CommandLineFromNSProcessInfo(); // Precedence: // 1. Settings from the specified NSBundle. @@ -45,7 +45,7 @@ static flutter::Settings DefaultSettingsForProcess(NSBundle* bundle = nil) { bundle = mainBundle; } - auto settings = shell::SettingsFromCommandLine(command_line); + auto settings = flutter::SettingsFromCommandLine(command_line); settings.task_observer_add = [](intptr_t key, fml::closure callback) { fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); @@ -175,17 +175,17 @@ static flutter::Settings DefaultSettingsForProcess(NSBundle* bundle = nil) { return _settings; } -- (shell::RunConfiguration)runConfiguration { +- (flutter::RunConfiguration)runConfiguration { return [self runConfigurationForEntrypoint:nil]; } -- (shell::RunConfiguration)runConfigurationForEntrypoint:(NSString*)entrypointOrNil { +- (flutter::RunConfiguration)runConfigurationForEntrypoint:(NSString*)entrypointOrNil { return [self runConfigurationForEntrypoint:entrypointOrNil libraryOrNil:nil]; } -- (shell::RunConfiguration)runConfigurationForEntrypoint:(NSString*)entrypointOrNil - libraryOrNil:(NSString*)dartLibraryOrNil { - shell::RunConfiguration config = shell::RunConfiguration::InferFromSettings(_settings); +- (flutter::RunConfiguration)runConfigurationForEntrypoint:(NSString*)entrypointOrNil + libraryOrNil:(NSString*)dartLibraryOrNil { + auto config = flutter::RunConfiguration::InferFromSettings(_settings); if (dartLibraryOrNil && entrypointOrNil) { config.SetEntrypointAndLibrary(std::string([entrypointOrNil UTF8String]), std::string([dartLibraryOrNil UTF8String])); diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h index 3147b44ef8..2c67f094f7 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h @@ -13,10 +13,10 @@ - (const flutter::Settings&)settings; -- (shell::RunConfiguration)runConfiguration; -- (shell::RunConfiguration)runConfigurationForEntrypoint:(NSString*)entrypointOrNil; -- (shell::RunConfiguration)runConfigurationForEntrypoint:(NSString*)entrypointOrNil - libraryOrNil:(NSString*)dartLibraryOrNil; +- (flutter::RunConfiguration)runConfiguration; +- (flutter::RunConfiguration)runConfigurationForEntrypoint:(NSString*)entrypointOrNil; +- (flutter::RunConfiguration)runConfigurationForEntrypoint:(NSString*)entrypointOrNil + libraryOrNil:(NSString*)dartLibraryOrNil; + (NSString*)flutterAssetsName:(NSBundle*)bundle; diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index 326b1867a3..50208e65a0 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -38,15 +38,15 @@ @implementation FlutterEngine { fml::scoped_nsobject _dartProject; - shell::ThreadHost _threadHost; - std::unique_ptr _shell; + flutter::ThreadHost _threadHost; + std::unique_ptr _shell; NSString* _labelPrefix; std::unique_ptr> _weakFactory; fml::WeakPtr _viewController; fml::scoped_nsobject _publisher; - std::unique_ptr _platformViewsController; + std::unique_ptr _platformViewsController; // Channels fml::scoped_nsobject _platformPlugin; @@ -89,7 +89,7 @@ _dartProject.reset([projectOrNil retain]); _pluginPublications = [NSMutableDictionary new]; - _platformViewsController.reset(new shell::FlutterPlatformViewsController()); + _platformViewsController.reset(new flutter::FlutterPlatformViewsController()); [self setupChannels]; @@ -101,7 +101,7 @@ [super dealloc]; } -- (shell::Shell&)shell { +- (flutter::Shell&)shell { FML_DCHECK(_shell); return *_shell; } @@ -131,14 +131,14 @@ _nextPointerFlowId++; } -- (fml::WeakPtr)platformView { +- (fml::WeakPtr)platformView { FML_DCHECK(_shell); return _shell->GetPlatformView(); } -- (shell::PlatformViewIOS*)iosPlatformView { +- (flutter::PlatformViewIOS*)iosPlatformView { FML_DCHECK(_shell); - return static_cast(_shell->GetPlatformView().get()); + return static_cast(_shell->GetPlatformView().get()); } - (fml::RefPtr)platformTaskRunner { @@ -179,7 +179,7 @@ - (FlutterPlatformPlugin*)platformPlugin { return _platformPlugin.get(); } -- (shell::FlutterPlatformViewsController*)platformViewsController { +- (flutter::FlutterPlatformViewsController*)platformViewsController { return _platformViewsController.get(); } - (FlutterTextInputPlugin*)textInputPlugin { @@ -286,8 +286,8 @@ } } -- (shell::Rasterizer::Screenshot)screenshot:(shell::Rasterizer::ScreenshotType)type - base64Encode:(bool)base64Encode { +- (flutter::Rasterizer::Screenshot)screenshot:(flutter::Rasterizer::ScreenshotType)type + base64Encode:(bool)base64Encode { return self.shell.Screenshot(type, base64Encode); } @@ -300,7 +300,7 @@ ]() mutable { if (engine) { auto result = engine->Run(std::move(config)); - if (result == shell::Engine::RunStatus::Failure) { + if (result == flutter::Engine::RunStatus::Failure) { FML_LOG(ERROR) << "Could not launch engine with configuration."; } } @@ -335,23 +335,24 @@ // initialized. fml::MessageLoop::EnsureInitializedForCurrentThread(); - _threadHost = { - threadLabel.UTF8String, // label - shell::ThreadHost::Type::UI | shell::ThreadHost::Type::GPU | shell::ThreadHost::Type::IO}; + _threadHost = {threadLabel.UTF8String, // label + flutter::ThreadHost::Type::UI | flutter::ThreadHost::Type::GPU | + flutter::ThreadHost::Type::IO}; // Lambda captures by pointers to ObjC objects are fine here because the // create call is // synchronous. - shell::Shell::CreateCallback on_create_platform_view = - [](shell::Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); + flutter::Shell::CreateCallback on_create_platform_view = + [](flutter::Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); }; - shell::Shell::CreateCallback on_create_rasterizer = [](shell::Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }; + flutter::Shell::CreateCallback on_create_rasterizer = + [](flutter::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; - if (shell::IsIosEmbeddedViewsPreviewEnabled()) { + if (flutter::IsIosEmbeddedViewsPreviewEnabled()) { // Embedded views requires the gpu and the platform views to be the same. // The plan is to eventually dynamically merge the threads when there's a // platform view in the layer tree. @@ -367,10 +368,10 @@ _threadHost.io_thread->GetTaskRunner() // io ); // Create the shell. This is a blocking operation. - _shell = shell::Shell::Create(std::move(task_runners), // task runners - std::move(settings), // settings - on_create_platform_view, // platform view creation - on_create_rasterizer // rasterzier creation + _shell = flutter::Shell::Create(std::move(task_runners), // task runners + std::move(settings), // settings + on_create_platform_view, // platform view creation + on_create_rasterizer // rasterzier creation ); } else { flutter::TaskRunners task_runners(threadLabel.UTF8String, // label @@ -380,10 +381,10 @@ _threadHost.io_thread->GetTaskRunner() // io ); // Create the shell. This is a blocking operation. - _shell = shell::Shell::Create(std::move(task_runners), // task runners - std::move(settings), // settings - on_create_platform_view, // platform view creation - on_create_rasterizer // rasterzier creation + _shell = flutter::Shell::Create(std::move(task_runners), // task runners + std::move(settings), // settings + on_create_platform_view, // platform view creation + on_create_rasterizer // rasterzier creation ); } @@ -393,7 +394,7 @@ } else { [self setupChannels]; if (!_platformViewsController) { - _platformViewsController.reset(new shell::FlutterPlatformViewsController()); + _platformViewsController.reset(new flutter::FlutterPlatformViewsController()); } _publisher.reset([[FlutterObservatoryPublisher alloc] init]); [self maybeSetupPlatformViewChannels]; @@ -487,8 +488,8 @@ #pragma mark - Screenshot Delegate -- (shell::Rasterizer::Screenshot)takeScreenshot:(shell::Rasterizer::ScreenshotType)type - asBase64Encoded:(BOOL)base64Encode { +- (flutter::Rasterizer::Screenshot)takeScreenshot:(flutter::Rasterizer::ScreenshotType)type + asBase64Encoded:(BOOL)base64Encode { FML_DCHECK(_shell) << "Cannot takeScreenshot without a shell"; return _shell->Screenshot(type, base64Encode); } @@ -503,9 +504,9 @@ message:(NSData*)message binaryReply:(FlutterBinaryReply)callback { NSAssert(channel, @"The channel must not be null"); - fml::RefPtr response = + fml::RefPtr response = (callback == nil) ? nullptr - : fml::MakeRefCounted( + : fml::MakeRefCounted( ^(NSData* reply) { callback(reply); }, @@ -513,7 +514,7 @@ fml::RefPtr platformMessage = (message == nil) ? fml::MakeRefCounted(channel.UTF8String, response) : fml::MakeRefCounted( - channel.UTF8String, shell::GetVectorFromNSData(message), response); + channel.UTF8String, flutter::GetVectorFromNSData(message), response); _shell->GetPlatformView()->DispatchPlatformMessage(platformMessage); } diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h index f00f4dbd01..4994814d84 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h @@ -26,20 +26,20 @@ @interface FlutterEngine () -- (shell::Shell&)shell; +- (flutter::Shell&)shell; - (void)updateViewportMetrics:(flutter::ViewportMetrics)viewportMetrics; - (void)dispatchPointerDataPacket:(std::unique_ptr)packet; - (fml::RefPtr)platformTaskRunner; -- (fml::WeakPtr)platformView; +- (fml::WeakPtr)platformView; -- (shell::Rasterizer::Screenshot)screenshot:(shell::Rasterizer::ScreenshotType)type - base64Encode:(bool)base64Encode; +- (flutter::Rasterizer::Screenshot)screenshot:(flutter::Rasterizer::ScreenshotType)type + base64Encode:(bool)base64Encode; - (FlutterPlatformPlugin*)platformPlugin; -- (shell::FlutterPlatformViewsController*)platformViewsController; +- (flutter::FlutterPlatformViewsController*)platformViewsController; - (FlutterTextInputPlugin*)textInputPlugin; - (void)launchEngine:(NSString*)entrypoint libraryURI:(NSString*)libraryOrNil; - (BOOL)createShell:(NSString*)entrypoint libraryURI:(NSString*)libraryOrNil; diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.h index 7332e46115..dddfd6ca87 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.h @@ -24,9 +24,9 @@ - (instancetype)init NS_DESIGNATED_INITIALIZER; - (instancetype)initWithContentsScale:(CGFloat)contentsScale; -- (std::unique_ptr)createSoftwareSurface; -- (std::unique_ptr)createGLSurfaceWithContext: - (std::shared_ptr)gl_context; +- (std::unique_ptr)createSoftwareSurface; +- (std::unique_ptr)createGLSurfaceWithContext: + (std::shared_ptr)gl_context; @end diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.mm index 394ae89550..091b13e706 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.mm @@ -64,20 +64,20 @@ #endif // TARGET_IPHONE_SIMULATOR } -- (std::unique_ptr)createSoftwareSurface { +- (std::unique_ptr)createSoftwareSurface { fml::scoped_nsobject layer(reinterpret_cast([self.layer retain])); - return std::make_unique(std::move(layer), nullptr); + return std::make_unique(std::move(layer), nullptr); } -- (std::unique_ptr)createGLSurfaceWithContext: - (std::shared_ptr)gl_context { +- (std::unique_ptr)createGLSurfaceWithContext: + (std::shared_ptr)gl_context { fml::scoped_nsobject eagl_layer(reinterpret_cast([self.layer retain])); // TODO(amirh): We can lower this to iOS 8.0 once we have a Metal rendering backend. // https://github.com/flutter/flutter/issues/24132 if (@available(iOS 9.0, *)) { eagl_layer.get().presentsWithTransaction = YES; } - return std::make_unique(eagl_layer, std::move(gl_context)); + return std::make_unique(eagl_layer, std::move(gl_context)); } // TODO(amirh): implement drawLayer to suppoer snapshotting. diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h index d1558a1cfd..3efcff1667 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h @@ -17,13 +17,13 @@ @end -namespace shell { +namespace flutter { extern const char* const kOrientationUpdateNotificationName; extern const char* const kOrientationUpdateNotificationKey; extern const char* const kOverlayStyleUpdateNotificationName; extern const char* const kOverlayStyleUpdateNotificationKey; -} // namespace shell +} // namespace flutter #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERPLATFORMPLUGIN_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm index 5f43a026b5..4fa0d46942 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm @@ -17,7 +17,7 @@ const UInt32 kKeyPressClickSoundId = 1306; } // namespaces -namespace shell { +namespace flutter { // TODO(abarth): Move these definitions from system_chrome_impl.cc to here. const char* const kOrientationUpdateNotificationName = @@ -29,9 +29,9 @@ const char* const kOverlayStyleUpdateNotificationName = const char* const kOverlayStyleUpdateNotificationKey = "io.flutter.plugin.platform.SystemChromeOverlayNotificationKey"; -} // namespace shell +} // namespace flutter -using namespace shell; +using namespace flutter; @implementation FlutterPlatformPlugin { fml::WeakPtr _engine; diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm index f2f0550b8c..0f4855d0d0 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm @@ -16,7 +16,7 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterChannels.h" -namespace shell { +namespace flutter { void FlutterPlatformViewsController::SetFlutterView(UIView* flutter_view) { flutter_view_.reset([flutter_view retain]); @@ -330,7 +330,7 @@ void FlutterPlatformViewsController::EnsureGLOverlayInitialized( overlays_gr_context_ = gr_context; } -} // namespace shell +} // namespace flutter // This recognizers delays touch events from being dispatched to the responder chain until it failed // recognizing a gesture. diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h index 0f2cfe3d57..62921aadbe 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h @@ -27,7 +27,7 @@ - (void)blockGesture; @end -namespace shell { +namespace flutter { class IOSGLContext; class IOSSurface; @@ -120,6 +120,6 @@ class FlutterPlatformViewsController { FML_DISALLOW_COPY_AND_ASSIGN(FlutterPlatformViewsController); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERPLATFORMVIEWS_INTERNAL_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm index b6c85c6097..7c2fb3e6ca 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm @@ -6,7 +6,8 @@ #include "flutter/shell/platform/darwin/ios/ios_surface.h" -namespace shell { +namespace flutter { + FlutterPlatformViewLayer::FlutterPlatformViewLayer(fml::scoped_nsobject overlay_view, std::unique_ptr ios_surface, std::unique_ptr surface) @@ -20,4 +21,4 @@ FlutterPlatformViewsController::FlutterPlatformViewsController() = default; FlutterPlatformViewsController::~FlutterPlatformViewsController() = default; -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec.mm index d7c151bfa7..f4b174bb84 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec.mm @@ -145,7 +145,7 @@ } @end -using namespace shell; +using namespace flutter; #pragma mark - Standard serializable types diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec_Internal.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec_Internal.h index c1eab20fa1..186adce19d 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec_Internal.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec_Internal.h @@ -25,7 +25,7 @@ typedef NS_ENUM(NSInteger, FlutterStandardField) { FlutterStandardFieldMap, }; -namespace shell { +namespace flutter { FlutterStandardField FlutterStandardFieldForDataType(FlutterStandardDataType type) { return (FlutterStandardField)(type + FlutterStandardFieldUInt8Data); } @@ -44,6 +44,6 @@ UInt8 elementSizeForFlutterStandardDataType(FlutterStandardDataType type) { return 8; } } -} // namespace shell +} // namespace flutter #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERSTANDARDCODECINTERNAL_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h index ee7110446c..0da2d5b0bc 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h @@ -17,10 +17,10 @@ @protocol FlutterViewEngineDelegate -- (shell::Rasterizer::Screenshot)takeScreenshot:(shell::Rasterizer::ScreenshotType)type - asBase64Encoded:(BOOL)base64Encode; +- (flutter::Rasterizer::Screenshot)takeScreenshot:(flutter::Rasterizer::ScreenshotType)type + asBase64Encoded:(BOOL)base64Encode; -- (shell::FlutterPlatformViewsController*)platformViewsController; +- (flutter::FlutterPlatformViewsController*)platformViewsController; @end @@ -33,7 +33,8 @@ - (instancetype)initWithDelegate:(id)delegate opaque:(BOOL)opaque NS_DESIGNATED_INITIALIZER; -- (std::unique_ptr)createSurface:(std::shared_ptr)context; +- (std::unique_ptr)createSurface: + (std::shared_ptr)context; @end diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 17caee87ed..61b5db9c56 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -71,11 +71,12 @@ id _delegate; #endif // TARGET_IPHONE_SIMULATOR } -- (std::unique_ptr)createSurface:(std::shared_ptr)context { +- (std::unique_ptr)createSurface: + (std::shared_ptr)context { if ([self.layer isKindOfClass:[CAEAGLLayer class]]) { fml::scoped_nsobject eagl_layer( reinterpret_cast([self.layer retain])); - if (shell::IsIosEmbeddedViewsPreviewEnabled()) { + if (flutter::IsIosEmbeddedViewsPreviewEnabled()) { // TODO(amirh): We can lower this to iOS 8.0 once we have a Metal rendering backend. // https://github.com/flutter/flutter/issues/24132 if (@available(iOS 9.0, *)) { @@ -84,12 +85,12 @@ id _delegate; eagl_layer.get().presentsWithTransaction = YES; } } - return std::make_unique(context, std::move(eagl_layer), - [_delegate platformViewsController]); + return std::make_unique(context, std::move(eagl_layer), + [_delegate platformViewsController]); } else { fml::scoped_nsobject layer(reinterpret_cast([self.layer retain])); - return std::make_unique(std::move(layer), - [_delegate platformViewsController]); + return std::make_unique(std::move(layer), + [_delegate platformViewsController]); } } @@ -100,7 +101,7 @@ id _delegate; return; } - auto screenshot = [_delegate takeScreenshot:shell::Rasterizer::ScreenshotType::UncompressedImage + auto screenshot = [_delegate takeScreenshot:flutter::Rasterizer::ScreenshotType::UncompressedImage asBase64Encoded:NO]; if (!screenshot.data || screenshot.data->isEmpty() || screenshot.frame_size.isEmpty()) { diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index bebfabbc7e..0f987d42e4 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -135,12 +135,12 @@ NSNotificationName const FlutterSemanticsUpdateNotification = @"FlutterSemantics NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; [center addObserver:self selector:@selector(onOrientationPreferencesUpdated:) - name:@(shell::kOrientationUpdateNotificationName) + name:@(flutter::kOrientationUpdateNotificationName) object:nil]; [center addObserver:self selector:@selector(onPreferredStatusBarStyleUpdated:) - name:@(shell::kOverlayStyleUpdateNotificationName) + name:@(flutter::kOverlayStyleUpdateNotificationName) object:nil]; [center addObserver:self @@ -752,7 +752,7 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch) dispatch_async(dispatch_get_main_queue(), ^{ NSDictionary* info = notification.userInfo; - NSNumber* update = info[@(shell::kOrientationUpdateNotificationKey)]; + NSNumber* update = info[@(flutter::kOrientationUpdateNotificationKey)]; if (update == nil) { return; @@ -975,7 +975,7 @@ constexpr CGFloat kStandardStatusBarHeight = 20.0; dispatch_async(dispatch_get_main_queue(), ^{ NSDictionary* info = notification.userInfo; - NSNumber* update = info[@(shell::kOverlayStyleUpdateNotificationKey)]; + NSNumber* update = info[@(flutter::kOverlayStyleUpdateNotificationKey)]; if (update == nil) { return; @@ -992,7 +992,7 @@ constexpr CGFloat kStandardStatusBarHeight = 20.0; #pragma mark - Platform views -- (shell::FlutterPlatformViewsController*)platformViewsController { +- (flutter::FlutterPlatformViewsController*)platformViewsController { return [_engine.get() platformViewsController]; } diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h index 4908c7dc80..5947a9327f 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h @@ -15,7 +15,7 @@ @interface FlutterViewController () - (fml::WeakPtr)getWeakPtr; -- (shell::FlutterPlatformViewsController*)platformViewsController; +- (flutter::FlutterPlatformViewsController*)platformViewsController; @end diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h index c7f62b8890..1f0193e6bd 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h @@ -23,9 +23,9 @@ #include "third_party/skia/include/core/SkMatrix44.h" #include "third_party/skia/include/core/SkRect.h" -namespace shell { +namespace flutter { class AccessibilityBridge; -} // namespace shell +} // namespace flutter @class FlutterPlatformViewSemanticsContainer; @@ -50,7 +50,7 @@ class AccessibilityBridge; * object may use the bridge to access contextual application information. A weak pointer is used * because the platform view owns the accessibility bridge. */ -@property(nonatomic, readonly) fml::WeakPtr bridge; +@property(nonatomic, readonly) fml::WeakPtr bridge; /** * The semantics node used to produce this semantics object. @@ -83,7 +83,7 @@ class AccessibilityBridge; #pragma mark - Designated initializers - (instancetype)init __attribute__((unavailable("Use initWithBridge instead"))); -- (instancetype)initWithBridge:(fml::WeakPtr)bridge +- (instancetype)initWithBridge:(fml::WeakPtr)bridge uid:(int32_t)uid NS_DESIGNATED_INITIALIZER; @end @@ -132,7 +132,7 @@ class AccessibilityBridge; @end -namespace shell { +namespace flutter { class PlatformViewIOS; class AccessibilityBridge final { @@ -180,6 +180,6 @@ class AccessibilityBridge final { FML_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); }; -} // namespace shell +} // namespace flutter #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_ACCESSIBILITY_BRIDGE_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 1c62c19eeb..e9a083e224 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -84,7 +84,7 @@ flutter::SemanticsAction GetSemanticsActionForScrollDirection( @interface SemanticsObjectContainer : NSObject - (instancetype)init __attribute__((unavailable("Use initWithSemanticsObject instead"))); - (instancetype)initWithSemanticsObject:(SemanticsObject*)semanticsObject - bridge:(fml::WeakPtr)bridge + bridge:(fml::WeakPtr)bridge NS_DESIGNATED_INITIALIZER; @property(nonatomic, weak) SemanticsObject* semanticsObject; @@ -106,7 +106,7 @@ flutter::SemanticsAction GetSemanticsActionForScrollDirection( #pragma mark - Designated initializers -- (instancetype)initWithBridge:(fml::WeakPtr)bridge uid:(int32_t)uid { +- (instancetype)initWithBridge:(fml::WeakPtr)bridge uid:(int32_t)uid { FML_DCHECK(bridge) << "bridge must be set"; FML_DCHECK(uid >= kRootNodeId); self = [super init]; @@ -363,7 +363,7 @@ flutter::SemanticsAction GetSemanticsActionForScrollDirection( #pragma mark - Designated initializers -- (instancetype)initWithBridge:(fml::WeakPtr)bridge uid:(int32_t)uid { +- (instancetype)initWithBridge:(fml::WeakPtr)bridge uid:(int32_t)uid { self = [super initWithBridge:bridge uid:uid]; return self; } @@ -424,7 +424,7 @@ flutter::SemanticsAction GetSemanticsActionForScrollDirection( @implementation SemanticsObjectContainer { SemanticsObject* _semanticsObject; - fml::WeakPtr _bridge; + fml::WeakPtr _bridge; } #pragma mark - initializers @@ -437,7 +437,7 @@ flutter::SemanticsAction GetSemanticsActionForScrollDirection( } - (instancetype)initWithSemanticsObject:(SemanticsObject*)semanticsObject - bridge:(fml::WeakPtr)bridge { + bridge:(fml::WeakPtr)bridge { FML_DCHECK(semanticsObject) << "semanticsObject must be set"; self = [super init]; @@ -529,7 +529,7 @@ flutter::SemanticsAction GetSemanticsActionForScrollDirection( #pragma mark - AccessibilityBridge impl -namespace shell { +namespace flutter { AccessibilityBridge::AccessibilityBridge(UIView* view, PlatformViewIOS* platform_view, @@ -606,7 +606,7 @@ void AccessibilityBridge::UpdateSemantics(flutter::SemanticsNodeUpdates nodes, } if (object.node.IsPlatformViewNode()) { - shell::FlutterPlatformViewsController* controller = GetPlatformViewsController(); + FlutterPlatformViewsController* controller = GetPlatformViewsController(); if (controller) { object.platformViewSemanticsContainer = [[FlutterPlatformViewSemanticsContainer alloc] initWithAccessibilityContainer:[object accessibilityContainer]]; @@ -753,4 +753,4 @@ void AccessibilityBridge::clearState() { previous_routes_.clear(); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm index 35e50e1a13..f6a620080b 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm @@ -169,7 +169,7 @@ FlutterInactiveTextInput* _inactive_text_input; } -- (instancetype)initWithBridge:(fml::WeakPtr)bridge uid:(int32_t)uid { +- (instancetype)initWithBridge:(fml::WeakPtr)bridge uid:(int32_t)uid { self = [super initWithBridge:bridge uid:uid]; if (self) { diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h index 75660e3744..ca18f6c4e6 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h @@ -16,7 +16,7 @@ typedef void (^PlatformMessageResponseCallback)(NSData*); -namespace shell { +namespace flutter { class PlatformMessageResponseDarwin : public flutter::PlatformMessageResponse { public: @@ -36,6 +36,6 @@ class PlatformMessageResponseDarwin : public flutter::PlatformMessageResponse { FML_FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm index 0d45e4e2ff..89f0f2d580 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm @@ -4,7 +4,7 @@ #include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" -namespace shell { +namespace flutter { PlatformMessageResponseDarwin::PlatformMessageResponseDarwin( PlatformMessageResponseCallback callback, @@ -17,7 +17,7 @@ PlatformMessageResponseDarwin::~PlatformMessageResponseDarwin() = default; void PlatformMessageResponseDarwin::Complete(std::unique_ptr data) { fml::RefPtr self(this); platform_task_runner_->PostTask(fml::MakeCopyable([self, data = std::move(data)]() mutable { - self->callback_.get()(shell::GetNSDataFromMapping(std::move(data))); + self->callback_.get()(GetNSDataFromMapping(std::move(data))); })); } @@ -27,4 +27,4 @@ void PlatformMessageResponseDarwin::CompleteEmpty() { fml::MakeCopyable([self]() mutable { self->callback_.get()(nil); })); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h index d9c4cc2af7..3447fb9495 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h @@ -12,7 +12,7 @@ #include "flutter/lib/ui/window/platform_message.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterBinaryMessenger.h" -namespace shell { +namespace flutter { class PlatformMessageRouter { public: @@ -32,6 +32,6 @@ class PlatformMessageRouter { FML_DISALLOW_COPY_AND_ASSIGN(PlatformMessageRouter); }; -} // namespace shell +} // namespace flutter #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_ACCESSIBILITY_BRIDGE_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.mm index 997a96ce8d..0f8d097945 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.mm @@ -8,7 +8,7 @@ #include "flutter/shell/platform/darwin/common/buffer_conversions.h" -namespace shell { +namespace flutter { PlatformMessageRouter::PlatformMessageRouter() = default; @@ -49,4 +49,4 @@ void PlatformMessageRouter::SetMessageHandler(const std::string& channel, } } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h index 81dbe8d737..29097da8f7 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h @@ -12,7 +12,7 @@ @class VSyncClient; -namespace shell { +namespace flutter { class VsyncWaiterIOS final : public VsyncWaiter { public: @@ -23,12 +23,12 @@ class VsyncWaiterIOS final : public VsyncWaiter { private: fml::scoped_nsobject client_; - // |shell::VsyncWaiter| + // |VsyncWaiter| void AwaitVSync() override; FML_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterIOS); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm index 4f1486eeb8..f16c656c07 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm @@ -17,7 +17,7 @@ @interface VSyncClient : NSObject - (instancetype)initWithTaskRunner:(fml::RefPtr)task_runner - callback:(shell::VsyncWaiter::Callback)callback; + callback:(flutter::VsyncWaiter::Callback)callback; - (void)await; @@ -25,7 +25,7 @@ @end -namespace shell { +namespace flutter { VsyncWaiterIOS::VsyncWaiterIOS(flutter::TaskRunners task_runners) : VsyncWaiter(std::move(task_runners)), @@ -45,15 +45,15 @@ void VsyncWaiterIOS::AwaitVSync() { [client_.get() await]; } -} // namespace shell +} // namespace flutter @implementation VSyncClient { - shell::VsyncWaiter::Callback callback_; + flutter::VsyncWaiter::Callback callback_; fml::scoped_nsobject display_link_; } - (instancetype)initWithTaskRunner:(fml::RefPtr)task_runner - callback:(shell::VsyncWaiter::Callback)callback { + callback:(flutter::VsyncWaiter::Callback)callback { self = [super init]; if (self) { diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_external_texture_gl.h b/engine/src/flutter/shell/platform/darwin/ios/ios_external_texture_gl.h index d258234708..d583c85c0e 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_external_texture_gl.h +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_external_texture_gl.h @@ -9,7 +9,7 @@ #include "flutter/fml/platform/darwin/cf_utils.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h" -namespace shell { +namespace flutter { class IOSExternalTextureGL : public flow::Texture { public: @@ -33,6 +33,6 @@ class IOSExternalTextureGL : public flow::Texture { FML_DISALLOW_COPY_AND_ASSIGN(IOSExternalTextureGL); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_IOS_EXTERNAL_TEXTURE_GL_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_external_texture_gl.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_external_texture_gl.mm index 543d2582e6..3e0e2d2d73 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_external_texture_gl.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -12,7 +12,7 @@ #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" -namespace shell { +namespace flutter { IOSExternalTextureGL::IOSExternalTextureGL(int64_t textureId, NSObject* externalTexture) @@ -74,4 +74,4 @@ void IOSExternalTextureGL::OnGrContextDestroyed() { void IOSExternalTextureGL::MarkNewFrameAvailable() {} -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_gl_context.h b/engine/src/flutter/shell/platform/darwin/ios/ios_gl_context.h index 08778d2131..232645d9c8 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_gl_context.h +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_gl_context.h @@ -15,7 +15,7 @@ #include "flutter/shell/common/platform_view.h" #include "ios_gl_render_target.h" -namespace shell { +namespace flutter { class IOSGLContext { public: @@ -40,6 +40,6 @@ class IOSGLContext { FML_DISALLOW_COPY_AND_ASSIGN(IOSGLContext); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_GL_CONTEXT_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_gl_context.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_gl_context.mm index 74e98b223a..52fb85f8f1 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_gl_context.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_gl_context.mm @@ -10,7 +10,7 @@ #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" -namespace shell { +namespace flutter { IOSGLContext::IOSGLContext() { resource_context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3]); @@ -60,4 +60,4 @@ bool IOSGLContext::ResourceMakeCurrent() { return [EAGLContext setCurrentContext:resource_context_.get()]; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_gl_render_target.h b/engine/src/flutter/shell/platform/darwin/ios/ios_gl_render_target.h index ce2a128bd3..b2eafe16e0 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_gl_render_target.h +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_gl_render_target.h @@ -14,7 +14,7 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" -namespace shell { +namespace flutter { class IOSGLRenderTarget { public: @@ -52,6 +52,6 @@ class IOSGLRenderTarget { FML_DISALLOW_COPY_AND_ASSIGN(IOSGLRenderTarget); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_GL_RENDER_TARGET_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_gl_render_target.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_gl_render_target.mm index 210d9a9d8c..1401707b28 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_gl_render_target.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_gl_render_target.mm @@ -10,7 +10,7 @@ #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" -namespace shell { +namespace flutter { IOSGLRenderTarget::IOSGLRenderTarget(fml::scoped_nsobject layer, EAGLContext* context, @@ -138,4 +138,4 @@ bool IOSGLRenderTarget::ResourceMakeCurrent() { return [EAGLContext setCurrentContext:resource_context_.get()]; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface.h b/engine/src/flutter/shell/platform/darwin/ios/ios_surface.h index 1fc6a4218d..8b065bb9ef 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface.h +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface.h @@ -13,7 +13,7 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/surface.h" -namespace shell { +namespace flutter { // Returns true if the app explicitly specified to use the iOS view embedding // mechanism which is still in a release preview. @@ -43,6 +43,6 @@ class IOSSurface { FML_DISALLOW_COPY_AND_ASSIGN(IOSSurface); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_surface.mm index f9d2d4cfbd..4c2b4efd85 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface.mm @@ -9,7 +9,7 @@ #include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" #include "flutter/shell/platform/darwin/ios/ios_surface_software.h" -namespace shell { +namespace flutter { // The name of the Info.plist flag to enable the embedded iOS views preview. const char* const kEmbeddedViewsPreview = "io.flutter.embedded_views_preview"; @@ -26,4 +26,4 @@ IOSSurface::~IOSSurface() = default; FlutterPlatformViewsController* IOSSurface::GetPlatformViewsController() { return platform_views_controller_; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.h b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.h index 7de1e00a31..116033fda1 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.h +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.h @@ -14,7 +14,7 @@ @class CAEAGLLayer; -namespace shell { +namespace flutter { class IOSSurfaceGL : public IOSSurface, public GPUSurfaceGLDelegate, @@ -48,7 +48,7 @@ class IOSSurfaceGL : public IOSSurface, bool UseOffscreenSurface() const override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| flow::ExternalViewEmbedder* GetExternalViewEmbedder() override; // |flow::ExternalViewEmbedder| @@ -73,6 +73,6 @@ class IOSSurfaceGL : public IOSSurface, FML_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceGL); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.mm index 2c7ab3a2d1..0973dbfeb4 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_gl.mm @@ -7,7 +7,7 @@ #include "flutter/fml/trace_event.h" #include "flutter/shell/gpu/gpu_surface_gl.h" -namespace shell { +namespace flutter { IOSSurfaceGL::IOSSurfaceGL(std::shared_ptr context, fml::scoped_nsobject layer, @@ -118,4 +118,4 @@ bool IOSSurfaceGL::SubmitFrame(GrContext* context) { return submitted; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.h b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.h index 79695b3a27..c45342a3da 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.h +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.h @@ -13,7 +13,7 @@ @class CALayer; -namespace shell { +namespace flutter { class IOSSurfaceSoftware final : public IOSSurface, public GPUSurfaceSoftwareDelegate, @@ -24,25 +24,25 @@ class IOSSurfaceSoftware final : public IOSSurface, ~IOSSurfaceSoftware() override; - // |shell::IOSSurface| + // |IOSSurface| bool IsValid() const override; - // |shell::IOSSurface| + // |IOSSurface| bool ResourceContextMakeCurrent() override; - // |shell::IOSSurface| + // |IOSSurface| void UpdateStorageSizeIfNecessary() override; - // |shell::IOSSurface| + // |IOSSurface| std::unique_ptr CreateGPUSurface() override; - // |shell::GPUSurfaceSoftwareDelegate| + // |GPUSurfaceSoftwareDelegate| sk_sp AcquireBackingStore(const SkISize& size) override; - // |shell::GPUSurfaceSoftwareDelegate| + // |GPUSurfaceSoftwareDelegate| bool PresentBackingStore(sk_sp backing_store) override; - // |shell::GPUSurfaceSoftwareDelegate| + // |GPUSurfaceSoftwareDelegate| flow::ExternalViewEmbedder* GetExternalViewEmbedder() override; // |flow::ExternalViewEmbedder| @@ -67,6 +67,6 @@ class IOSSurfaceSoftware final : public IOSSurface, FML_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceSoftware); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.mm b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.mm index 714f5a5610..2731ad9c07 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/ios_surface_software.mm @@ -13,7 +13,7 @@ #include "flutter/fml/trace_event.h" #include "third_party/skia/include/utils/mac/SkCGUtils.h" -namespace shell { +namespace flutter { IOSSurfaceSoftware::IOSSurfaceSoftware(fml::scoped_nsobject layer, FlutterPlatformViewsController* platform_views_controller) @@ -168,4 +168,4 @@ bool IOSSurfaceSoftware::SubmitFrame(GrContext* context) { return platform_views_controller->SubmitFrame(false, nullptr, nullptr); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.h b/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.h index 1b13055ee1..38fc2a9f30 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.h +++ b/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.h @@ -22,7 +22,7 @@ @class FlutterViewController; -namespace shell { +namespace flutter { class PlatformViewIOS final : public PlatformView { public: @@ -41,7 +41,7 @@ class PlatformViewIOS final : public PlatformView { void SetTextInputPlugin(fml::scoped_nsprotocol plugin); - // |shell::PlatformView| + // |PlatformView| void SetSemanticsEnabled(bool enabled) override; private: @@ -53,31 +53,31 @@ class PlatformViewIOS final : public PlatformView { fml::scoped_nsprotocol text_input_plugin_; fml::closure firstFrameCallback_; - // |shell::PlatformView| + // |PlatformView| void HandlePlatformMessage(fml::RefPtr message) override; - // |shell::PlatformView| + // |PlatformView| std::unique_ptr CreateRenderingSurface() override; - // |shell::PlatformView| + // |PlatformView| sk_sp CreateResourceContext() const override; - // |shell::PlatformView| + // |PlatformView| void SetAccessibilityFeatures(int32_t flags) override; - // |shell::PlatformView| + // |PlatformView| void UpdateSemantics(flutter::SemanticsNodeUpdates update, flutter::CustomAccessibilityActionUpdates actions) override; - // |shell::PlatformView| + // |PlatformView| std::unique_ptr CreateVSyncWaiter() override; - // |shell::PlatformView| + // |PlatformView| void OnPreEngineRestart() const override; FML_DISALLOW_COPY_AND_ASSIGN(PlatformViewIOS); }; -} // namespace shell +} // namespace flutter #endif // SHELL_PLATFORM_IOS_PLATFORM_VIEW_IOS_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.mm b/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.mm index d2a24ffce0..c80ae377c0 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.mm @@ -11,13 +11,13 @@ #include "flutter/common/task_runners.h" #include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/trace_event.h" -#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/common/shell_io_manager.h" #include "flutter/shell/gpu/gpu_surface_gl_delegate.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" -namespace shell { +namespace flutter { PlatformViewIOS::PlatformViewIOS(PlatformView::Delegate& delegate, flutter::TaskRunners task_runners) @@ -33,7 +33,7 @@ PlatformMessageRouter& PlatformViewIOS::GetPlatformMessageRouter() { return platform_message_router_; } -// |shell::PlatformView| +// |PlatformView| void PlatformViewIOS::HandlePlatformMessage(fml::RefPtr message) { platform_message_router_.HandlePlatformMessage(std::move(message)); } @@ -71,7 +71,7 @@ void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, RegisterTexture(std::make_shared(texture_id, texture)); } -// |shell::PlatformView| +// |PlatformView| std::unique_ptr PlatformViewIOS::CreateRenderingSurface() { if (!ios_surface_) { FML_DLOG(INFO) << "Could not CreateRenderingSurface, this PlatformViewIOS " @@ -81,7 +81,7 @@ std::unique_ptr PlatformViewIOS::CreateRenderingSurface() { return ios_surface_->CreateGPUSurface(); } -// |shell::PlatformView| +// |PlatformView| sk_sp PlatformViewIOS::CreateResourceContext() const { if (!gl_context_ || !gl_context_->ResourceMakeCurrent()) { FML_DLOG(INFO) << "Could not make resource context current on IO thread. " @@ -90,11 +90,11 @@ sk_sp PlatformViewIOS::CreateResourceContext() const { return nullptr; } - return IOManager::CreateCompatibleResourceLoadingContext( + return ShellIOManager::CreateCompatibleResourceLoadingContext( GrBackend::kOpenGL_GrBackend, GPUSurfaceGLDelegate::GetDefaultPlatformGLInterface()); } -// |shell::PlatformView| +// |PlatformView| void PlatformViewIOS::SetSemanticsEnabled(bool enabled) { if (!owner_controller_) { FML_LOG(WARNING) << "Could not set semantics to enabled, this " @@ -116,7 +116,7 @@ void PlatformViewIOS::SetAccessibilityFeatures(int32_t flags) { PlatformView::SetAccessibilityFeatures(flags); } -// |shell::PlatformView| +// |PlatformView| void PlatformViewIOS::UpdateSemantics(flutter::SemanticsNodeUpdates update, flutter::CustomAccessibilityActionUpdates actions) { FML_DCHECK(owner_controller_); @@ -127,7 +127,7 @@ void PlatformViewIOS::UpdateSemantics(flutter::SemanticsNodeUpdates update, } } -// |shell::PlatformView| +// |PlatformView| std::unique_ptr PlatformViewIOS::CreateVSyncWaiter() { return std::make_unique(task_runners_); } @@ -150,4 +150,4 @@ void PlatformViewIOS::SetTextInputPlugin(fml::scoped_nsprotocol +static flutter::Shell::CreateCallback InferOpenGLPlatformViewCreationCallback( const FlutterRendererConfig* config, void* user_data, - shell::PlatformViewEmbedder::PlatformDispatchTable + flutter::PlatformViewEmbedder::PlatformDispatchTable platform_dispatch_table) { if (config->type != kOpenGL) { return nullptr; @@ -165,7 +165,7 @@ InferOpenGLPlatformViewCreationCallback( }; } - shell::GPUSurfaceGLDelegate::GLProcResolver gl_proc_resolver = nullptr; + flutter::GPUSurfaceGLDelegate::GLProcResolver gl_proc_resolver = nullptr; if (SAFE_ACCESS(open_gl_config, gl_proc_resolver, nullptr) != nullptr) { gl_proc_resolver = [ptr = config->open_gl.gl_proc_resolver, user_data](const char* gl_proc_name) { @@ -180,7 +180,7 @@ InferOpenGLPlatformViewCreationCallback( bool fbo_reset_after_present = SAFE_ACCESS(open_gl_config, fbo_reset_after_present, false); - shell::EmbedderSurfaceGL::GLDispatchTable gl_dispatch_table = { + flutter::EmbedderSurfaceGL::GLDispatchTable gl_dispatch_table = { gl_make_current, // gl_make_current_callback gl_clear_current, // gl_clear_current_callback gl_present, // gl_present_callback @@ -191,8 +191,8 @@ InferOpenGLPlatformViewCreationCallback( }; return [gl_dispatch_table, fbo_reset_after_present, - platform_dispatch_table](shell::Shell& shell) { - return std::make_unique( + platform_dispatch_table](flutter::Shell& shell) { + return std::make_unique( shell, // delegate shell.GetTaskRunners(), // task runners gl_dispatch_table, // embedder GL dispatch table @@ -202,11 +202,11 @@ InferOpenGLPlatformViewCreationCallback( }; } -static shell::Shell::CreateCallback +static flutter::Shell::CreateCallback InferSoftwarePlatformViewCreationCallback( const FlutterRendererConfig* config, void* user_data, - shell::PlatformViewEmbedder::PlatformDispatchTable + flutter::PlatformViewEmbedder::PlatformDispatchTable platform_dispatch_table) { if (config->type != kSoftware) { return nullptr; @@ -218,27 +218,27 @@ InferSoftwarePlatformViewCreationCallback( return ptr(user_data, allocation, row_bytes, height); }; - shell::EmbedderSurfaceSoftware::SoftwareDispatchTable + flutter::EmbedderSurfaceSoftware::SoftwareDispatchTable software_dispatch_table = { software_present_backing_store, // required }; - return - [software_dispatch_table, platform_dispatch_table](shell::Shell& shell) { - return std::make_unique( - shell, // delegate - shell.GetTaskRunners(), // task runners - software_dispatch_table, // software dispatch table - platform_dispatch_table // platform dispatch table - ); - }; + return [software_dispatch_table, + platform_dispatch_table](flutter::Shell& shell) { + return std::make_unique( + shell, // delegate + shell.GetTaskRunners(), // task runners + software_dispatch_table, // software dispatch table + platform_dispatch_table // platform dispatch table + ); + }; } -static shell::Shell::CreateCallback +static flutter::Shell::CreateCallback InferPlatformViewCreationCallback( const FlutterRendererConfig* config, void* user_data, - shell::PlatformViewEmbedder::PlatformDispatchTable + flutter::PlatformViewEmbedder::PlatformDispatchTable platform_dispatch_table) { if (config == nullptr) { return nullptr; @@ -348,11 +348,11 @@ FlutterEngineResult FlutterEngineRun(size_t version, if (SAFE_ACCESS(args, persistent_cache_path, nullptr) != nullptr) { std::string persistent_cache_path = SAFE_ACCESS(args, persistent_cache_path, nullptr); - shell::PersistentCache::SetCacheDirectoryPath(persistent_cache_path); + flutter::PersistentCache::SetCacheDirectoryPath(persistent_cache_path); } if (SAFE_ACCESS(args, is_persistent_cache_read_only, false)) { - shell::PersistentCache::gIsReadOnly = true; + flutter::PersistentCache::gIsReadOnly = true; } fml::CommandLine command_line; @@ -363,7 +363,7 @@ FlutterEngineResult FlutterEngineRun(size_t version, SAFE_ACCESS(args, command_line_argv, nullptr)); } - flutter::Settings settings = shell::SettingsFromCommandLine(command_line); + flutter::Settings settings = flutter::SettingsFromCommandLine(command_line); PopulateSnapshotMappingCallbacks(args, settings); @@ -397,7 +397,7 @@ FlutterEngineResult FlutterEngineRun(size_t version, }; } - shell::PlatformViewEmbedder::UpdateSemanticsNodesCallback + flutter::PlatformViewEmbedder::UpdateSemanticsNodesCallback update_semantics_nodes_callback = nullptr; if (SAFE_ACCESS(args, update_semantics_node_callback, nullptr) != nullptr) { update_semantics_nodes_callback = @@ -455,7 +455,7 @@ FlutterEngineResult FlutterEngineRun(size_t version, }; } - shell::PlatformViewEmbedder::UpdateSemanticsCustomActionsCallback + flutter::PlatformViewEmbedder::UpdateSemanticsCustomActionsCallback update_semantics_custom_actions_callback = nullptr; if (SAFE_ACCESS(args, update_semantics_custom_action_callback, nullptr) != nullptr) { @@ -481,7 +481,7 @@ FlutterEngineResult FlutterEngineRun(size_t version, }; } - shell::PlatformViewEmbedder::PlatformMessageResponseCallback + flutter::PlatformViewEmbedder::PlatformMessageResponseCallback platform_message_response_callback = nullptr; if (SAFE_ACCESS(args, platform_message_callback, nullptr) != nullptr) { platform_message_response_callback = @@ -500,19 +500,20 @@ FlutterEngineResult FlutterEngineRun(size_t version, }; } - shell::VsyncWaiterEmbedder::VsyncCallback vsync_callback = nullptr; + flutter::VsyncWaiterEmbedder::VsyncCallback vsync_callback = nullptr; if (SAFE_ACCESS(args, vsync_callback, nullptr) != nullptr) { vsync_callback = [ptr = args->vsync_callback, user_data](intptr_t baton) { return ptr(user_data, baton); }; } - shell::PlatformViewEmbedder::PlatformDispatchTable platform_dispatch_table = { - update_semantics_nodes_callback, // - update_semantics_custom_actions_callback, // - platform_message_response_callback, // - vsync_callback, // - }; + flutter::PlatformViewEmbedder::PlatformDispatchTable platform_dispatch_table = + { + update_semantics_nodes_callback, // + update_semantics_custom_actions_callback, // + platform_message_response_callback, // + vsync_callback, // + }; auto on_create_platform_view = InferPlatformViewCreationCallback( config, user_data, platform_dispatch_table); @@ -521,14 +522,14 @@ FlutterEngineResult FlutterEngineRun(size_t version, return LOG_EMBEDDER_ERROR(kInvalidArguments); } - shell::Shell::CreateCallback on_create_rasterizer = - [](shell::Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); + flutter::Shell::CreateCallback on_create_rasterizer = + [](flutter::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); }; // TODO(chinmaygarde): This is the wrong spot for this. It belongs in the // platform view jump table. - shell::EmbedderExternalTextureGL::ExternalTextureCallback + flutter::EmbedderExternalTextureGL::ExternalTextureCallback external_texture_callback; if (config->type == kOpenGL) { const FlutterOpenGLRendererConfig* open_gl_config = &config->open_gl; @@ -578,7 +579,7 @@ FlutterEngineResult FlutterEngineRun(size_t version, } auto thread_host = - shell::EmbedderThreadHost::CreateEmbedderOrEngineManagedThreadHost( + flutter::EmbedderThreadHost::CreateEmbedderOrEngineManagedThreadHost( SAFE_ACCESS(args, custom_task_runners, nullptr)); if (!thread_host || !thread_host->IsValid()) { @@ -596,12 +597,12 @@ FlutterEngineResult FlutterEngineRun(size_t version, // Step 1: Create the engine. auto embedder_engine = - std::make_unique(std::move(thread_host), // - std::move(task_runners), // - settings, // - on_create_platform_view, // - on_create_rasterizer, // - external_texture_callback // + std::make_unique(std::move(thread_host), // + std::move(task_runners), // + settings, // + on_create_platform_view, // + on_create_rasterizer, // + external_texture_callback // ); if (!embedder_engine->IsValid()) { @@ -614,7 +615,8 @@ FlutterEngineResult FlutterEngineRun(size_t version, } // Step 3: Run the engine. - auto run_configuration = shell::RunConfiguration::InferFromSettings(settings); + auto run_configuration = + flutter::RunConfiguration::InferFromSettings(settings); if (SAFE_ACCESS(args, custom_dart_entrypoint, nullptr) != nullptr) { auto dart_entrypoint = std::string{args->custom_dart_entrypoint}; @@ -647,7 +649,7 @@ FlutterEngineResult FlutterEngineShutdown(FlutterEngine engine) { if (engine == nullptr) { return LOG_EMBEDDER_ERROR(kInvalidArguments); } - auto embedder_engine = reinterpret_cast(engine); + auto embedder_engine = reinterpret_cast(engine); embedder_engine->NotifyDestroyed(); delete embedder_engine; return kSuccess; @@ -666,7 +668,7 @@ FlutterEngineResult FlutterEngineSendWindowMetricsEvent( metrics.physical_height = SAFE_ACCESS(flutter_metrics, height, 0.0); metrics.device_pixel_ratio = SAFE_ACCESS(flutter_metrics, pixel_ratio, 1.0); - return reinterpret_cast(engine)->SetViewportMetrics( + return reinterpret_cast(engine)->SetViewportMetrics( std::move(metrics)) ? kSuccess : LOG_EMBEDDER_ERROR(kInvalidArguments); @@ -738,7 +740,7 @@ FlutterEngineResult FlutterEngineSendPointerEvent( reinterpret_cast(current) + current->struct_size); } - return reinterpret_cast(engine) + return reinterpret_cast(engine) ->DispatchPointerDataPacket(std::move(packet)) ? kSuccess : LOG_EMBEDDER_ERROR(kInvalidArguments); @@ -763,8 +765,8 @@ FlutterEngineResult FlutterEngineSendPlatformMessage( flutter_message->message + flutter_message->message_size), nullptr); - return reinterpret_cast(engine)->SendPlatformMessage( - std::move(message)) + return reinterpret_cast(engine) + ->SendPlatformMessage(std::move(message)) ? kSuccess : LOG_EMBEDDER_ERROR(kInvalidArguments); } @@ -803,7 +805,7 @@ FlutterEngineResult FlutterEngineRegisterExternalTexture( if (engine == nullptr || texture_identifier == 0) { return LOG_EMBEDDER_ERROR(kInvalidArguments); } - if (!reinterpret_cast(engine)->RegisterTexture( + if (!reinterpret_cast(engine)->RegisterTexture( texture_identifier)) { return LOG_EMBEDDER_ERROR(kInternalInconsistency); } @@ -817,7 +819,7 @@ FlutterEngineResult FlutterEngineUnregisterExternalTexture( return kInvalidArguments; } - if (!reinterpret_cast(engine)->UnregisterTexture( + if (!reinterpret_cast(engine)->UnregisterTexture( texture_identifier)) { return LOG_EMBEDDER_ERROR(kInternalInconsistency); } @@ -831,7 +833,7 @@ FlutterEngineResult FlutterEngineMarkExternalTextureFrameAvailable( if (engine == nullptr || texture_identifier == 0) { return LOG_EMBEDDER_ERROR(kInvalidArguments); } - if (!reinterpret_cast(engine) + if (!reinterpret_cast(engine) ->MarkTextureFrameAvailable(texture_identifier)) { return LOG_EMBEDDER_ERROR(kInternalInconsistency); } @@ -843,7 +845,7 @@ FlutterEngineResult FlutterEngineUpdateSemanticsEnabled(FlutterEngine engine, if (engine == nullptr) { return LOG_EMBEDDER_ERROR(kInvalidArguments); } - if (!reinterpret_cast(engine)->SetSemanticsEnabled( + if (!reinterpret_cast(engine)->SetSemanticsEnabled( enabled)) { return LOG_EMBEDDER_ERROR(kInternalInconsistency); } @@ -856,7 +858,7 @@ FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures( if (engine == nullptr) { return LOG_EMBEDDER_ERROR(kInvalidArguments); } - if (!reinterpret_cast(engine) + if (!reinterpret_cast(engine) ->SetAccessibilityFeatures(flags)) { return LOG_EMBEDDER_ERROR(kInternalInconsistency); } @@ -873,7 +875,7 @@ FlutterEngineResult FlutterEngineDispatchSemanticsAction( return LOG_EMBEDDER_ERROR(kInvalidArguments); } auto engine_action = static_cast(action); - if (!reinterpret_cast(engine) + if (!reinterpret_cast(engine) ->DispatchSemanticsAction( id, engine_action, std::vector({data, data + data_length}))) { @@ -898,7 +900,7 @@ FlutterEngineResult FlutterEngineOnVsync(FlutterEngine engine, auto target_time = fml::TimePoint::FromEpochDelta( fml::TimeDelta::FromNanoseconds(frame_target_time_nanos)); - if (!reinterpret_cast(engine)->OnVsyncEvent( + if (!reinterpret_cast(engine)->OnVsyncEvent( baton, start_time, target_time)) { return LOG_EMBEDDER_ERROR(kInternalInconsistency); } @@ -927,8 +929,8 @@ FlutterEngineResult FlutterEnginePostRenderThreadTask(FlutterEngine engine, auto task = [callback, baton]() { callback(baton); }; - return reinterpret_cast(engine)->PostRenderThreadTask( - task) + return reinterpret_cast(engine) + ->PostRenderThreadTask(task) ? kSuccess : LOG_EMBEDDER_ERROR(kInternalInconsistency); } @@ -943,7 +945,7 @@ FlutterEngineResult FlutterEngineRunTask(FlutterEngine engine, return LOG_EMBEDDER_ERROR(kInvalidArguments); } - return reinterpret_cast(engine)->RunTask(task) + return reinterpret_cast(engine)->RunTask(task) ? kSuccess : LOG_EMBEDDER_ERROR(kInvalidArguments); } diff --git a/engine/src/flutter/shell/platform/embedder/embedder_engine.cc b/engine/src/flutter/shell/platform/embedder/embedder_engine.cc index ad48b52802..79c8cf2f8b 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_engine.cc +++ b/engine/src/flutter/shell/platform/embedder/embedder_engine.cc @@ -7,7 +7,7 @@ #include "flutter/fml/make_copyable.h" #include "flutter/shell/platform/embedder/vsync_waiter_embedder.h" -namespace shell { +namespace flutter { EmbedderEngine::EmbedderEngine( std::unique_ptr thread_host, @@ -65,7 +65,7 @@ bool EmbedderEngine::Run(RunConfiguration run_configuration) { ]() mutable { if (engine) { auto result = engine->Run(std::move(config)); - if (result == shell::Engine::RunStatus::Failure) { + if (result == Engine::RunStatus::Failure) { FML_LOG(ERROR) << "Could not launch the engine with configuration."; } } @@ -224,4 +224,4 @@ bool EmbedderEngine::RunTask(const FlutterTask* task) { task->task); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/embedder_engine.h b/engine/src/flutter/shell/platform/embedder/embedder_engine.h index c6ea8d55ea..124f829fd1 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_engine.h +++ b/engine/src/flutter/shell/platform/embedder/embedder_engine.h @@ -16,7 +16,7 @@ #include "flutter/shell/platform/embedder/embedder_external_texture_gl.h" #include "flutter/shell/platform/embedder/embedder_thread_host.h" -namespace shell { +namespace flutter { // The object that is returned to the embedder as an opaque pointer to the // instance of the Flutter engine. @@ -80,6 +80,6 @@ class EmbedderEngine { FML_DISALLOW_COPY_AND_ASSIGN(EmbedderEngine); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ diff --git a/engine/src/flutter/shell/platform/embedder/embedder_external_texture_gl.cc b/engine/src/flutter/shell/platform/embedder/embedder_external_texture_gl.cc index d4c863c376..80a49ee5db 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_external_texture_gl.cc +++ b/engine/src/flutter/shell/platform/embedder/embedder_external_texture_gl.cc @@ -6,7 +6,7 @@ #include "flutter/fml/logging.h" -namespace shell { +namespace flutter { EmbedderExternalTextureGL::EmbedderExternalTextureGL( int64_t texture_identifier, @@ -43,4 +43,4 @@ void EmbedderExternalTextureGL::OnGrContextDestroyed() {} // |flow::Texture| void EmbedderExternalTextureGL::MarkNewFrameAvailable() {} -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/embedder_external_texture_gl.h b/engine/src/flutter/shell/platform/embedder/embedder_external_texture_gl.h index 73017daf19..c99b165236 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_external_texture_gl.h +++ b/engine/src/flutter/shell/platform/embedder/embedder_external_texture_gl.h @@ -10,7 +10,7 @@ #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSize.h" -namespace shell { +namespace flutter { class EmbedderExternalTextureGL : public flow::Texture { public: @@ -41,6 +41,6 @@ class EmbedderExternalTextureGL : public flow::Texture { FML_DISALLOW_COPY_AND_ASSIGN(EmbedderExternalTextureGL); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_EXTERNAL_TEXTURE_GL_H_ diff --git a/engine/src/flutter/shell/platform/embedder/embedder_surface.cc b/engine/src/flutter/shell/platform/embedder/embedder_surface.cc index b61802cbce..dbe619b8e0 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_surface.cc +++ b/engine/src/flutter/shell/platform/embedder/embedder_surface.cc @@ -4,10 +4,10 @@ #include "flutter/shell/platform/embedder/embedder_surface.h" -namespace shell { +namespace flutter { EmbedderSurface::EmbedderSurface() = default; EmbedderSurface::~EmbedderSurface() = default; -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/embedder_surface.h b/engine/src/flutter/shell/platform/embedder/embedder_surface.h index 74af9462b1..a6d11e3e29 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_surface.h +++ b/engine/src/flutter/shell/platform/embedder/embedder_surface.h @@ -8,7 +8,7 @@ #include "flutter/fml/macros.h" #include "flutter/shell/common/surface.h" -namespace shell { +namespace flutter { class EmbedderSurface { public: @@ -26,6 +26,6 @@ class EmbedderSurface { FML_DISALLOW_COPY_AND_ASSIGN(EmbedderSurface); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_H_ diff --git a/engine/src/flutter/shell/platform/embedder/embedder_surface_gl.cc b/engine/src/flutter/shell/platform/embedder/embedder_surface_gl.cc index 487111d698..f006ca0fda 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_surface_gl.cc +++ b/engine/src/flutter/shell/platform/embedder/embedder_surface_gl.cc @@ -4,9 +4,9 @@ #include "flutter/shell/platform/embedder/embedder_surface_gl.h" -#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/common/shell_io_manager.h" -namespace shell { +namespace flutter { EmbedderSurfaceGL::EmbedderSurfaceGL(GLDispatchTable gl_dispatch_table, bool fbo_reset_after_present) @@ -25,37 +25,37 @@ EmbedderSurfaceGL::EmbedderSurfaceGL(GLDispatchTable gl_dispatch_table, EmbedderSurfaceGL::~EmbedderSurfaceGL() = default; -// |shell::EmbedderSurface| +// |EmbedderSurface| bool EmbedderSurfaceGL::IsValid() const { return valid_; } -// |shell::GPUSurfaceGLDelegate| +// |GPUSurfaceGLDelegate| bool EmbedderSurfaceGL::GLContextMakeCurrent() { return gl_dispatch_table_.gl_make_current_callback(); } -// |shell::GPUSurfaceGLDelegate| +// |GPUSurfaceGLDelegate| bool EmbedderSurfaceGL::GLContextClearCurrent() { return gl_dispatch_table_.gl_clear_current_callback(); } -// |shell::GPUSurfaceGLDelegate| +// |GPUSurfaceGLDelegate| bool EmbedderSurfaceGL::GLContextPresent() { return gl_dispatch_table_.gl_present_callback(); } -// |shell::GPUSurfaceGLDelegate| +// |GPUSurfaceGLDelegate| intptr_t EmbedderSurfaceGL::GLContextFBO() const { return gl_dispatch_table_.gl_fbo_callback(); } -// |shell::GPUSurfaceGLDelegate| +// |GPUSurfaceGLDelegate| bool EmbedderSurfaceGL::GLContextFBOResetAfterPresent() const { return fbo_reset_after_present_; } -// |shell::GPUSurfaceGLDelegate| +// |GPUSurfaceGLDelegate| SkMatrix EmbedderSurfaceGL::GLContextSurfaceTransformation() const { auto callback = gl_dispatch_table_.gl_surface_transformation_callback; if (!callback) { @@ -66,21 +66,21 @@ SkMatrix EmbedderSurfaceGL::GLContextSurfaceTransformation() const { return callback(); } -// |shell::GPUSurfaceGLDelegate| +// |GPUSurfaceGLDelegate| EmbedderSurfaceGL::GLProcResolver EmbedderSurfaceGL::GetGLProcResolver() const { return gl_dispatch_table_.gl_proc_resolver; } -// |shell::EmbedderSurface| +// |EmbedderSurface| std::unique_ptr EmbedderSurfaceGL::CreateGPUSurface() { return std::make_unique(this); } -// |shell::EmbedderSurface| +// |EmbedderSurface| sk_sp EmbedderSurfaceGL::CreateResourceContext() const { auto callback = gl_dispatch_table_.gl_make_resource_current_callback; if (callback && callback()) { - if (auto context = IOManager::CreateCompatibleResourceLoadingContext( + if (auto context = ShellIOManager::CreateCompatibleResourceLoadingContext( GrBackend::kOpenGL_GrBackend, GetGLInterface())) { return context; } else { @@ -99,4 +99,4 @@ sk_sp EmbedderSurfaceGL::CreateResourceContext() const { return nullptr; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/embedder_surface_gl.h b/engine/src/flutter/shell/platform/embedder/embedder_surface_gl.h index 949997b687..faf3dfba17 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_surface_gl.h +++ b/engine/src/flutter/shell/platform/embedder/embedder_surface_gl.h @@ -9,7 +9,7 @@ #include "flutter/shell/gpu/gpu_surface_gl.h" #include "flutter/shell/platform/embedder/embedder_surface.h" -namespace shell { +namespace flutter { class EmbedderSurfaceGL final : public EmbedderSurface, public GPUSurfaceGLDelegate { @@ -35,39 +35,39 @@ class EmbedderSurfaceGL final : public EmbedderSurface, GLDispatchTable gl_dispatch_table_; bool fbo_reset_after_present_; - // |shell::EmbedderSurface| + // |EmbedderSurface| bool IsValid() const override; - // |shell::EmbedderSurface| + // |EmbedderSurface| std::unique_ptr CreateGPUSurface() override; - // |shell::EmbedderSurface| + // |EmbedderSurface| sk_sp CreateResourceContext() const override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| bool GLContextClearCurrent() override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| bool GLContextPresent() override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| intptr_t GLContextFBO() const override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| bool GLContextFBOResetAfterPresent() const override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| SkMatrix GLContextSurfaceTransformation() const override; - // |shell::GPUSurfaceGLDelegate| + // |GPUSurfaceGLDelegate| GLProcResolver GetGLProcResolver() const override; FML_DISALLOW_COPY_AND_ASSIGN(EmbedderSurfaceGL); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_GL_H_ diff --git a/engine/src/flutter/shell/platform/embedder/embedder_surface_software.cc b/engine/src/flutter/shell/platform/embedder/embedder_surface_software.cc index 7b7192dc99..0d24933cf5 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_surface_software.cc +++ b/engine/src/flutter/shell/platform/embedder/embedder_surface_software.cc @@ -7,7 +7,7 @@ #include "flutter/fml/trace_event.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace shell { +namespace flutter { EmbedderSurfaceSoftware::EmbedderSurfaceSoftware( SoftwareDispatchTable software_dispatch_table) @@ -20,12 +20,12 @@ EmbedderSurfaceSoftware::EmbedderSurfaceSoftware( EmbedderSurfaceSoftware::~EmbedderSurfaceSoftware() = default; -// |shell::EmbedderSurface| +// |EmbedderSurface| bool EmbedderSurfaceSoftware::IsValid() const { return valid_; } -// |shell::EmbedderSurface| +// |EmbedderSurface| std::unique_ptr EmbedderSurfaceSoftware::CreateGPUSurface() { if (!IsValid()) { return nullptr; @@ -40,12 +40,12 @@ std::unique_ptr EmbedderSurfaceSoftware::CreateGPUSurface() { return surface; } -// |shell::EmbedderSurface| +// |EmbedderSurface| sk_sp EmbedderSurfaceSoftware::CreateResourceContext() const { return nullptr; } -// |shell::GPUSurfaceSoftwareDelegate| +// |GPUSurfaceSoftwareDelegate| sk_sp EmbedderSurfaceSoftware::AcquireBackingStore( const SkISize& size) { TRACE_EVENT0("flutter", "EmbedderSurfaceSoftware::AcquireBackingStore"); @@ -73,7 +73,7 @@ sk_sp EmbedderSurfaceSoftware::AcquireBackingStore( return sk_surface_; } -// |shell::GPUSurfaceSoftwareDelegate| +// |GPUSurfaceSoftwareDelegate| bool EmbedderSurfaceSoftware::PresentBackingStore( sk_sp backing_store) { if (!IsValid()) { @@ -104,4 +104,4 @@ bool EmbedderSurfaceSoftware::PresentBackingStore( ); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/embedder_surface_software.h b/engine/src/flutter/shell/platform/embedder/embedder_surface_software.h index 6bc5d98f89..6e49f1dc00 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_surface_software.h +++ b/engine/src/flutter/shell/platform/embedder/embedder_surface_software.h @@ -9,7 +9,7 @@ #include "flutter/shell/gpu/gpu_surface_software.h" #include "flutter/shell/platform/embedder/embedder_surface.h" -namespace shell { +namespace flutter { class EmbedderSurfaceSoftware final : public EmbedderSurface, public GPUSurfaceSoftwareDelegate { @@ -28,24 +28,24 @@ class EmbedderSurfaceSoftware final : public EmbedderSurface, SoftwareDispatchTable software_dispatch_table_; sk_sp sk_surface_; - // |shell::EmbedderSurface| + // |EmbedderSurface| bool IsValid() const override; - // |shell::EmbedderSurface| + // |EmbedderSurface| std::unique_ptr CreateGPUSurface() override; - // |shell::EmbedderSurface| + // |EmbedderSurface| sk_sp CreateResourceContext() const override; - // |shell::GPUSurfaceSoftwareDelegate| + // |GPUSurfaceSoftwareDelegate| sk_sp AcquireBackingStore(const SkISize& size) override; - // |shell::GPUSurfaceSoftwareDelegate| + // |GPUSurfaceSoftwareDelegate| bool PresentBackingStore(sk_sp backing_store) override; FML_DISALLOW_COPY_AND_ASSIGN(EmbedderSurfaceSoftware); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_SOFTWARE_H_ diff --git a/engine/src/flutter/shell/platform/embedder/embedder_task_runner.cc b/engine/src/flutter/shell/platform/embedder/embedder_task_runner.cc index c0b5ab862b..9a772f47a9 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_task_runner.cc +++ b/engine/src/flutter/shell/platform/embedder/embedder_task_runner.cc @@ -6,7 +6,7 @@ #include "flutter/fml/message_loop_impl.h" -namespace shell { +namespace flutter { EmbedderTaskRunner::EmbedderTaskRunner(DispatchTable table) : TaskRunner(nullptr /* loop implemenation*/), @@ -69,4 +69,4 @@ bool EmbedderTaskRunner::PostTask(uint64_t baton) { return true; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/embedder_task_runner.h b/engine/src/flutter/shell/platform/embedder/embedder_task_runner.h index 084efbf148..507648e652 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_task_runner.h +++ b/engine/src/flutter/shell/platform/embedder/embedder_task_runner.h @@ -12,7 +12,7 @@ #include "flutter/fml/synchronization/thread_annotations.h" #include "flutter/fml/task_runner.h" -namespace shell { +namespace flutter { class EmbedderTaskRunner final : public fml::TaskRunner { public: @@ -52,6 +52,6 @@ class EmbedderTaskRunner final : public fml::TaskRunner { FML_DISALLOW_COPY_AND_ASSIGN(EmbedderTaskRunner); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_TASK_RUNNER_H_ diff --git a/engine/src/flutter/shell/platform/embedder/embedder_thread_host.cc b/engine/src/flutter/shell/platform/embedder/embedder_thread_host.cc index 8cf8515914..5c2a1f3ae2 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_thread_host.cc +++ b/engine/src/flutter/shell/platform/embedder/embedder_thread_host.cc @@ -10,7 +10,7 @@ #include "flutter/fml/message_loop.h" #include "flutter/shell/platform/embedder/embedder_safe_access.h" -namespace shell { +namespace flutter { static fml::RefPtr CreateEmbedderTaskRunner( const FlutterTaskRunnerDescription* description) { @@ -203,4 +203,4 @@ bool EmbedderThreadHost::PostTask(int64_t runner, uint64_t task) const { return found->second->PostTask(task); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/embedder_thread_host.h b/engine/src/flutter/shell/platform/embedder/embedder_thread_host.h index eb2b5a5eae..fc28037f35 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder_thread_host.h +++ b/engine/src/flutter/shell/platform/embedder/embedder_thread_host.h @@ -15,7 +15,7 @@ #include "flutter/shell/platform/embedder/embedder.h" #include "flutter/shell/platform/embedder/embedder_task_runner.h" -namespace shell { +namespace flutter { class EmbedderThreadHost { public: @@ -49,6 +49,6 @@ class EmbedderThreadHost { FML_DISALLOW_COPY_AND_ASSIGN(EmbedderThreadHost); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_THREAD_HOST_H_ diff --git a/engine/src/flutter/shell/platform/embedder/platform_view_embedder.cc b/engine/src/flutter/shell/platform/embedder/platform_view_embedder.cc index 8a5d6b3283..449612417f 100644 --- a/engine/src/flutter/shell/platform/embedder/platform_view_embedder.cc +++ b/engine/src/flutter/shell/platform/embedder/platform_view_embedder.cc @@ -4,7 +4,7 @@ #include "flutter/shell/platform/embedder/platform_view_embedder.h" -namespace shell { +namespace flutter { PlatformViewEmbedder::PlatformViewEmbedder( PlatformView::Delegate& delegate, @@ -62,7 +62,7 @@ void PlatformViewEmbedder::HandlePlatformMessage( std::move(message)); } -// |shell::PlatformView| +// |PlatformView| std::unique_ptr PlatformViewEmbedder::CreateRenderingSurface() { if (embedder_surface_ == nullptr) { FML_LOG(ERROR) << "Embedder surface was null."; @@ -71,7 +71,7 @@ std::unique_ptr PlatformViewEmbedder::CreateRenderingSurface() { return embedder_surface_->CreateGPUSurface(); } -// |shell::PlatformView| +// |PlatformView| sk_sp PlatformViewEmbedder::CreateResourceContext() const { if (embedder_surface_ == nullptr) { FML_LOG(ERROR) << "Embedder surface was null."; @@ -80,7 +80,7 @@ sk_sp PlatformViewEmbedder::CreateResourceContext() const { return embedder_surface_->CreateResourceContext(); } -// |shell::PlatformView| +// |PlatformView| std::unique_ptr PlatformViewEmbedder::CreateVSyncWaiter() { if (!platform_dispatch_table_.vsync_callback) { // Superclass implementation creates a timer based fallback. @@ -91,4 +91,4 @@ std::unique_ptr PlatformViewEmbedder::CreateVSyncWaiter() { platform_dispatch_table_.vsync_callback, task_runners_); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/platform_view_embedder.h b/engine/src/flutter/shell/platform/embedder/platform_view_embedder.h index e0d885db4e..6e40dc5808 100644 --- a/engine/src/flutter/shell/platform/embedder/platform_view_embedder.h +++ b/engine/src/flutter/shell/platform/embedder/platform_view_embedder.h @@ -15,7 +15,7 @@ #include "flutter/shell/platform/embedder/embedder_surface_software.h" #include "flutter/shell/platform/embedder/vsync_waiter_embedder.h" -namespace shell { +namespace flutter { class PlatformViewEmbedder final : public PlatformView { public: @@ -51,12 +51,12 @@ class PlatformViewEmbedder final : public PlatformView { ~PlatformViewEmbedder() override; - // |shell::PlatformView| + // |PlatformView| void UpdateSemantics( flutter::SemanticsNodeUpdates update, flutter::CustomAccessibilityActionUpdates actions) override; - // |shell::PlatformView| + // |PlatformView| void HandlePlatformMessage( fml::RefPtr message) override; @@ -64,18 +64,18 @@ class PlatformViewEmbedder final : public PlatformView { std::unique_ptr embedder_surface_; PlatformDispatchTable platform_dispatch_table_; - // |shell::PlatformView| + // |PlatformView| std::unique_ptr CreateRenderingSurface() override; - // |shell::PlatformView| + // |PlatformView| sk_sp CreateResourceContext() const override; - // |shell::PlatformView| + // |PlatformView| std::unique_ptr CreateVSyncWaiter() override; FML_DISALLOW_COPY_AND_ASSIGN(PlatformViewEmbedder); }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_PLATFORM_VIEW_EMBEDDER_H_ diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_a11y_unittests.cc b/engine/src/flutter/shell/platform/embedder/tests/embedder_a11y_unittests.cc index 326a6bdac0..5da4938175 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_a11y_unittests.cc +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_a11y_unittests.cc @@ -16,7 +16,7 @@ #include "flutter/shell/platform/embedder/tests/embedder_config_builder.h" #include "flutter/testing/testing.h" -namespace shell { +namespace flutter { namespace testing { using Embedder11yTest = testing::EmbedderTest; @@ -168,4 +168,4 @@ TEST_F(Embedder11yTest, A11yTreeIsConsistent) { } } // namespace testing -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_config_builder.cc b/engine/src/flutter/shell/platform/embedder/tests/embedder_config_builder.cc index 7a43162770..d172650357 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_config_builder.cc +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_config_builder.cc @@ -4,7 +4,7 @@ #include "flutter/shell/platform/embedder/tests/embedder_config_builder.h" -namespace shell { +namespace flutter { namespace testing { EmbedderConfigBuilder::EmbedderConfigBuilder( @@ -128,4 +128,4 @@ UniqueEngine EmbedderConfigBuilder::LaunchEngine() { } } // namespace testing -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_config_builder.h b/engine/src/flutter/shell/platform/embedder/tests/embedder_config_builder.h index 9e0f3fcf62..b416278f1a 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_config_builder.h +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_config_builder.h @@ -11,7 +11,7 @@ #include "flutter/shell/platform/embedder/tests/embedder_context.h" #include "flutter/shell/platform/embedder/tests/embedder_test.h" -namespace shell { +namespace flutter { namespace testing { struct UniqueEngineTraits { @@ -71,6 +71,6 @@ class EmbedderConfigBuilder { }; } // namespace testing -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_TESTS_EMBEDDER_CONFIG_BUILDER_H_ diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_context.cc b/engine/src/flutter/shell/platform/embedder/tests/embedder_context.cc index 779c50f632..870c18d4d8 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_context.cc +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_context.cc @@ -6,7 +6,7 @@ #include "flutter/runtime/dart_vm.h" -namespace shell { +namespace flutter { namespace testing { static std::unique_ptr GetMapping(const fml::UniqueFD& directory, @@ -137,4 +137,4 @@ EmbedderContext::GetUpdateSemanticsCustomActionCallbackHook() { } } // namespace testing -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_context.h b/engine/src/flutter/shell/platform/embedder/tests/embedder_context.h index c1b65a3865..3ca774ae54 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_context.h +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_context.h @@ -16,7 +16,7 @@ #include "flutter/shell/platform/embedder/embedder.h" #include "flutter/testing/test_dart_native_resolver.h" -namespace shell { +namespace flutter { namespace testing { using SemanticsNodeCallback = std::function; @@ -78,6 +78,6 @@ class EmbedderContext { }; } // namespace testing -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_TESTS_EMBEDDER_CONTEXT_H_ diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_test.cc b/engine/src/flutter/shell/platform/embedder/tests/embedder_test.cc index b23e795967..06ae0d21cf 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_test.cc +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_test.cc @@ -4,7 +4,7 @@ #include "flutter/shell/platform/embedder/tests/embedder_test.h" -namespace shell { +namespace flutter { namespace testing { EmbedderTest::EmbedderTest() = default; @@ -36,4 +36,4 @@ void EmbedderTest::TearDown() { } } // namespace testing -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_test.h b/engine/src/flutter/shell/platform/embedder/tests/embedder_test.h index f0850bf6f8..1112c8339b 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_test.h +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_test.h @@ -11,7 +11,7 @@ #include "flutter/shell/platform/embedder/tests/embedder_context.h" #include "flutter/testing/testing.h" -namespace shell { +namespace flutter { namespace testing { class EmbedderTest : public ::testing::Test { @@ -37,6 +37,6 @@ class EmbedderTest : public ::testing::Test { }; } // namespace testing -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_TESTS_EMBEDDER_TEST_H_ diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_unittests.cc b/engine/src/flutter/shell/platform/embedder/tests/embedder_unittests.cc index 25f4ed95a9..f762594820 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_unittests.cc +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_unittests.cc @@ -17,7 +17,7 @@ #include "flutter/shell/platform/embedder/tests/embedder_test.h" #include "flutter/testing/testing.h" -namespace shell { +namespace flutter { namespace testing { using EmbedderTest = testing::EmbedderTest; @@ -210,4 +210,4 @@ TEST(EmbedderTestNoFixture, CanGetCurrentTimeInNanoseconds) { } } // namespace testing -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/vsync_waiter_embedder.cc b/engine/src/flutter/shell/platform/embedder/vsync_waiter_embedder.cc index c7662b4105..64f1cf08e1 100644 --- a/engine/src/flutter/shell/platform/embedder/vsync_waiter_embedder.cc +++ b/engine/src/flutter/shell/platform/embedder/vsync_waiter_embedder.cc @@ -4,7 +4,7 @@ #include "flutter/shell/platform/embedder/vsync_waiter_embedder.h" -namespace shell { +namespace flutter { VsyncWaiterEmbedder::VsyncWaiterEmbedder(VsyncCallback vsync_callback, flutter::TaskRunners task_runners) @@ -14,7 +14,7 @@ VsyncWaiterEmbedder::VsyncWaiterEmbedder(VsyncCallback vsync_callback, VsyncWaiterEmbedder::~VsyncWaiterEmbedder() = default; -// |shell::VsyncWaiter| +// |VsyncWaiter| void VsyncWaiterEmbedder::AwaitVSync() { auto* weak_waiter = new std::weak_ptr(shared_from_this()); vsync_callback_(reinterpret_cast(weak_waiter)); @@ -40,4 +40,4 @@ bool VsyncWaiterEmbedder::OnEmbedderVsync(intptr_t baton, return true; } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/embedder/vsync_waiter_embedder.h b/engine/src/flutter/shell/platform/embedder/vsync_waiter_embedder.h index 84b7f4eeea..9c361e158a 100644 --- a/engine/src/flutter/shell/platform/embedder/vsync_waiter_embedder.h +++ b/engine/src/flutter/shell/platform/embedder/vsync_waiter_embedder.h @@ -8,7 +8,7 @@ #include "flutter/fml/macros.h" #include "flutter/shell/common/vsync_waiter.h" -namespace shell { +namespace flutter { class VsyncWaiterEmbedder final : public VsyncWaiter { public: @@ -26,12 +26,12 @@ class VsyncWaiterEmbedder final : public VsyncWaiter { private: const VsyncCallback vsync_callback_; - // |shell::VsyncWaiter| + // |VsyncWaiter| void AwaitVSync() override; FML_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterEmbedder); }; -} // namespace shell +} // namespace flutter #endif // SHELL_PLATFORM_EMBEDDER_VSYNC_WAITER_EMBEDDER_H_ diff --git a/engine/src/flutter/shell/platform/glfw/flutter_glfw.cc b/engine/src/flutter/shell/platform/glfw/flutter_glfw.cc index 77a3d40e6a..12354f4667 100644 --- a/engine/src/flutter/shell/platform/glfw/flutter_glfw.cc +++ b/engine/src/flutter/shell/platform/glfw/flutter_glfw.cc @@ -50,13 +50,13 @@ struct FlutterDesktopWindowState { std::unique_ptr plugin_registrar; // Message dispatch manager for messages from the Flutter engine. - std::unique_ptr message_dispatcher; + std::unique_ptr message_dispatcher; // The plugin registrar managing internal plugins. std::unique_ptr internal_plugin_registrar; // Handlers for keyboard events from GLFW. - std::vector> + std::vector> keyboard_hook_handlers; // Whether or not to track mouse movements to send kHover events. @@ -91,7 +91,7 @@ struct FlutterDesktopMessenger { FlutterEngine engine; // The message dispatcher for handling incoming messages. - shell::IncomingMessageDispatcher* dispatcher; + flutter::IncomingMessageDispatcher* dispatcher; }; // Retrieves state bag for the window in question from the GLFWWindow. @@ -505,7 +505,7 @@ FlutterDesktopWindowRef FlutterDesktopCreateWindow(int initial_width, // that this isn't a tangle of references. auto messenger = std::make_unique(); state->message_dispatcher = - std::make_unique(messenger.get()); + std::make_unique(messenger.get()); messenger->engine = engine; messenger->dispatcher = state->message_dispatcher.get(); @@ -519,9 +519,9 @@ FlutterDesktopWindowRef FlutterDesktopCreateWindow(int initial_width, auto internal_plugin_messenger = state->internal_plugin_registrar->messenger(); state->keyboard_hook_handlers.push_back( - std::make_unique(internal_plugin_messenger)); + std::make_unique(internal_plugin_messenger)); state->keyboard_hook_handlers.push_back( - std::make_unique(internal_plugin_messenger)); + std::make_unique(internal_plugin_messenger)); // Trigger an initial size callback to send size information to Flutter. state->monitor_screen_coordinates_per_inch = GetScreenCoordinatesPerInch(); diff --git a/engine/src/flutter/shell/platform/glfw/key_event_handler.cc b/engine/src/flutter/shell/platform/glfw/key_event_handler.cc index 7e370d0cdc..c193fda8a9 100644 --- a/engine/src/flutter/shell/platform/glfw/key_event_handler.cc +++ b/engine/src/flutter/shell/platform/glfw/key_event_handler.cc @@ -18,7 +18,7 @@ static constexpr char kAndroidKeyMap[] = "android"; static constexpr char kKeyUp[] = "keyup"; static constexpr char kKeyDown[] = "keydown"; -namespace shell { +namespace flutter { KeyEventHandler::KeyEventHandler(flutter::BinaryMessenger* messenger) : channel_( @@ -57,4 +57,4 @@ void KeyEventHandler::KeyboardHook(GLFWwindow* window, channel_->Send(event); } -} // namespace shell \ No newline at end of file +} // namespace flutter \ No newline at end of file diff --git a/engine/src/flutter/shell/platform/glfw/key_event_handler.h b/engine/src/flutter/shell/platform/glfw/key_event_handler.h index 171a17b620..19b0ffa316 100644 --- a/engine/src/flutter/shell/platform/glfw/key_event_handler.h +++ b/engine/src/flutter/shell/platform/glfw/key_event_handler.h @@ -13,7 +13,7 @@ #include "flutter/shell/platform/glfw/public/flutter_glfw.h" #include "rapidjson/document.h" -namespace shell { +namespace flutter { // Implements a KeyboardHookHandler // @@ -24,14 +24,14 @@ class KeyEventHandler : public KeyboardHookHandler { virtual ~KeyEventHandler(); - // |shell::KeyboardHookHandler| + // |KeyboardHookHandler| void KeyboardHook(GLFWwindow* window, int key, int scancode, int action, int mods) override; - // |shell::KeyboardHookHandler| + // |KeyboardHookHandler| void CharHook(GLFWwindow* window, unsigned int code_point) override; private: @@ -39,6 +39,6 @@ class KeyEventHandler : public KeyboardHookHandler { std::unique_ptr> channel_; }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_GLFW_KEY_EVENT_HANDLER_H_ diff --git a/engine/src/flutter/shell/platform/glfw/keyboard_hook_handler.h b/engine/src/flutter/shell/platform/glfw/keyboard_hook_handler.h index 5415105161..8769bd5f7d 100644 --- a/engine/src/flutter/shell/platform/glfw/keyboard_hook_handler.h +++ b/engine/src/flutter/shell/platform/glfw/keyboard_hook_handler.h @@ -9,7 +9,7 @@ #include "flutter/shell/platform/glfw/public/flutter_glfw.h" -namespace shell { +namespace flutter { // Abstract class for handling keyboard input events. class KeyboardHookHandler { @@ -27,6 +27,6 @@ class KeyboardHookHandler { virtual void CharHook(GLFWwindow* window, unsigned int code_point) = 0; }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_GLFW_KEYBOARD_HOOK_HANDLER_H_ diff --git a/engine/src/flutter/shell/platform/glfw/text_input_plugin.cc b/engine/src/flutter/shell/platform/glfw/text_input_plugin.cc index 76dbf8d118..87706de851 100644 --- a/engine/src/flutter/shell/platform/glfw/text_input_plugin.cc +++ b/engine/src/flutter/shell/platform/glfw/text_input_plugin.cc @@ -34,7 +34,7 @@ static constexpr char kInternalConsistencyError[] = static constexpr uint32_t kInputModelLimit = 256; -namespace shell { +namespace flutter { void TextInputPlugin::CharHook(GLFWwindow* window, unsigned int code_point) { if (active_model_ == nullptr) { @@ -207,4 +207,4 @@ void TextInputPlugin::EnterPressed(TextInputModel* model) { channel_->InvokeMethod(kPerformActionMethod, std::move(args)); } -} // namespace shell +} // namespace flutter diff --git a/engine/src/flutter/shell/platform/glfw/text_input_plugin.h b/engine/src/flutter/shell/platform/glfw/text_input_plugin.h index a6d8a4ed56..daf2fa7d22 100644 --- a/engine/src/flutter/shell/platform/glfw/text_input_plugin.h +++ b/engine/src/flutter/shell/platform/glfw/text_input_plugin.h @@ -14,7 +14,7 @@ #include "flutter/shell/platform/glfw/keyboard_hook_handler.h" #include "flutter/shell/platform/glfw/public/flutter_glfw.h" -namespace shell { +namespace flutter { // Implements a text input plugin. // @@ -25,14 +25,14 @@ class TextInputPlugin : public KeyboardHookHandler { virtual ~TextInputPlugin(); - // |shell::KeyboardHookHandler| + // |KeyboardHookHandler| void KeyboardHook(GLFWwindow* window, int key, int scancode, int action, int mods) override; - // |shell::KeyboardHookHandler| + // |KeyboardHookHandler| void CharHook(GLFWwindow* window, unsigned int code_point) override; private: @@ -57,6 +57,6 @@ class TextInputPlugin : public KeyboardHookHandler { TextInputModel* active_model_; }; -} // namespace shell +} // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_GLFW_TEXT_INPUT_PLUGIN_H_ diff --git a/engine/src/flutter/shell/testing/tester_main.cc b/engine/src/flutter/shell/testing/tester_main.cc index d3fe5616ff..fd729d1f43 100644 --- a/engine/src/flutter/shell/testing/tester_main.cc +++ b/engine/src/flutter/shell/testing/tester_main.cc @@ -21,7 +21,7 @@ #include "flutter/shell/common/thread_host.h" #include "third_party/dart/runtime/include/bin/dart_io_api.h" -namespace shell { +namespace flutter { // Checks whether the engine's main Dart isolate has no pending work. If so, // then exit the given message loop. @@ -186,7 +186,7 @@ int RunTester(const flutter::Settings& settings, bool run_forever) { reinterpret_cast(&completion_observer), [&completion_observer]() { completion_observer.DidProcessTask(); }); if (engine->Run(std::move(config)) != - shell::Engine::RunStatus::Failure) { + flutter::Engine::RunStatus::Failure) { engine_did_run = true; flutter::ViewportMetrics metrics; @@ -226,7 +226,7 @@ int RunTester(const flutter::Settings& settings, bool run_forever) { return completion_observer.GetExitCodeForLastError(); } -} // namespace shell +} // namespace flutter int main(int argc, char* argv[]) { dart::bin::SetExecutableName(argv[0]); @@ -234,12 +234,12 @@ int main(int argc, char* argv[]) { auto command_line = fml::CommandLineFromArgcArgv(argc, argv); - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { - shell::PrintUsage("flutter_tester"); + if (command_line.HasOption(flutter::FlagForSwitch(flutter::Switch::Help))) { + flutter::PrintUsage("flutter_tester"); return EXIT_SUCCESS; } - auto settings = shell::SettingsFromCommandLine(command_line); + auto settings = flutter::SettingsFromCommandLine(command_line); if (command_line.positional_args().size() > 0) { // The tester may not use the switch for the main dart file path. Specifying // it as a positional argument instead. @@ -266,7 +266,7 @@ int main(int argc, char* argv[]) { fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); }; - return shell::RunTester( - settings, - command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever))); + return flutter::RunTester( + settings, command_line.HasOption( + flutter::FlagForSwitch(flutter::Switch::RunForever))); }