From ac24af87f0ebb0857ef1acc8e97cf1824f8c85b4 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Tue, 12 Sep 2017 15:36:20 -0700 Subject: [PATCH] Format all c-like sources with clang-format (flutter/engine#4088) * format * license script adaptions * updated licenses * review comments --- engine/src/flutter/assets/zip_asset_store.cc | 2 +- engine/src/flutter/flow/export_node.h | 4 +- engine/src/flutter/flow/instrumentation.cc | 11 +- .../flutter/flow/layers/clip_path_layer.cc | 6 +- .../flutter/flow/layers/clip_rect_layer.cc | 6 +- .../flutter/flow/layers/clip_rrect_layer.cc | 2 +- engine/src/flutter/flow/layers/layer.h | 6 +- engine/src/flutter/flow/layers/layer_tree.cc | 4 +- .../src/flutter/flow/layers/picture_layer.cc | 2 +- engine/src/flutter/flow/paint_utils.cc | 9 +- engine/src/flutter/flow/raster_cache.cc | 10 +- .../flutter/flow/raster_cache_unittests.cc | 44 +-- .../src/flutter/flow/scene_update_context.cc | 10 +- .../src/flutter/flow/scene_update_context.h | 13 +- .../platform/android/message_loop_android.cc | 4 +- .../flutter/fml/platform/linux/paths_linux.cc | 3 +- engine/src/flutter/fml/thread.cc | 10 +- engine/src/flutter/fml/trace_event.cc | 24 +- .../src/flutter/lib/ui/compositing/scene.cc | 10 +- .../lib/ui/compositing/scene_builder.cc | 5 +- .../src/flutter/lib/ui/dart_runtime_hooks.cc | 4 +- .../src/flutter/lib/ui/dart_runtime_hooks.h | 2 +- engine/src/flutter/lib/ui/painting/canvas.cc | 53 ++-- .../src/flutter/lib/ui/painting/gradient.cc | 2 +- engine/src/flutter/lib/ui/painting/gradient.h | 2 +- engine/src/flutter/lib/ui/painting/image.cc | 2 +- .../flutter/lib/ui/painting/image_filter.cc | 2 +- .../flutter/lib/ui/painting/image_shader.cc | 5 +- .../flutter/lib/ui/painting/mask_filter.cc | 2 +- engine/src/flutter/lib/ui/painting/paint.cc | 3 +- engine/src/flutter/lib/ui/painting/path.cc | 8 +- engine/src/flutter/lib/ui/painting/picture.cc | 6 +- .../lib/ui/painting/picture_recorder.cc | 2 +- engine/src/flutter/lib/ui/painting/rrect.cc | 2 +- engine/src/flutter/lib/ui/painting/shader.cc | 5 +- engine/src/flutter/lib/ui/painting/utils.cc | 8 +- engine/src/flutter/lib/ui/painting/utils.h | 5 +- .../src/flutter/lib/ui/painting/vertices.cc | 16 +- engine/src/flutter/lib/ui/painting/vertices.h | 11 +- .../flutter/lib/ui/text/font_collection.cc | 2 +- .../flutter/lib/ui/text/paragraph_builder.cc | 5 +- engine/src/flutter/lib/ui/ui_dart_state.cc | 1 - .../window/platform_message_response_dart.cc | 8 +- engine/src/flutter/lib/ui/window/window.cc | 18 +- engine/src/flutter/runtime/dart_controller.cc | 41 +-- engine/src/flutter/runtime/dart_controller.h | 2 +- engine/src/flutter/runtime/dart_init.cc | 33 +- engine/src/flutter/runtime/dart_init.h | 2 +- .../flutter/runtime/dart_service_isolate.cc | 5 +- engine/src/flutter/runtime/platform_impl.h | 2 +- .../src/flutter/runtime/runtime_controller.cc | 3 +- .../src/flutter/runtime/test_font_selector.cc | 13 +- engine/src/flutter/shell/common/animator.cc | 2 +- .../common/diagnostic/diagnostic_server.cc | 4 +- engine/src/flutter/shell/common/engine.h | 3 +- .../src/flutter/shell/common/platform_view.h | 3 +- .../common/platform_view_service_protocol.cc | 10 +- .../shell/common/vsync_waiter_fallback.cc | 2 +- .../platform/android/android_context_gl.cc | 35 +-- .../platform/android/android_context_gl.h | 1 - .../android/android_surface_software.cc | 14 +- .../platform/android/platform_view_android.cc | 27 +- .../platform/android/platform_view_android.h | 1 - .../android/platform_view_android_jni.cc | 5 +- .../platform/android/vsync_waiter_android.cc | 13 +- .../darwin/desktop/vsync_waiter_mac.h | 2 +- .../darwin/ios/framework/Headers/Flutter.h | 2 +- .../framework/Headers/FlutterAppDelegate.h | 5 +- .../Headers/FlutterNavigationController.h | 2 +- .../framework/Source/FlutterAppDelegate.mm | 4 +- .../ios/framework/Source/FlutterCodecs.mm | 6 +- .../framework/Source/FlutterDartProject.mm | 17 +- .../Source/FlutterNavigationController.mm | 2 +- .../framework/Source/FlutterPlatformPlugin.mm | 3 +- .../framework/Source/FlutterViewController.mm | 20 +- .../framework/Source/accessibility_bridge.h | 3 +- .../Source/flutter_codecs_unittest.mm | 2 +- .../Source/platform_message_router.h | 6 +- .../platform/darwin/ios/ios_gl_context.h | 4 +- .../platform/darwin/ios/ios_gl_context.mm | 14 +- .../darwin/ios/ios_surface_software.mm | 3 +- .../platform/darwin/ios/platform_view_ios.mm | 3 +- .../shell/testing/platform_view_test.cc | 3 +- .../src/flutter/shell/testing/test_runner.cc | 7 +- .../flutter/sky/packages/sky_engine/LICENSE | 296 +++++++++--------- .../src/flutter/synchronization/semaphore.h | 2 +- .../txt/src/txt/asset_font_manager.cc | 2 +- .../src/txt/directory_asset_data_provider.cc | 2 +- .../third_party/txt/src/txt/paragraph.cc | 22 +- .../txt/tests/CmapCoverageTest.cpp | 3 +- .../txt/tests/GraphemeBreakTests.cpp | 2 +- .../flutter/tools/licenses/lib/patterns.dart | 4 +- engine/src/flutter/vulkan/vulkan_device.cc | 2 +- engine/src/flutter/vulkan/vulkan_handle.h | 2 +- engine/src/flutter/vulkan/vulkan_image.cc | 2 +- 95 files changed, 511 insertions(+), 516 deletions(-) diff --git a/engine/src/flutter/assets/zip_asset_store.cc b/engine/src/flutter/assets/zip_asset_store.cc index e3ebefb730..8b8d93e3c0 100644 --- a/engine/src/flutter/assets/zip_asset_store.cc +++ b/engine/src/flutter/assets/zip_asset_store.cc @@ -10,9 +10,9 @@ #include #include +#include "flutter/glue/trace_event.h" #include "lib/fxl/files/eintr_wrapper.h" #include "lib/fxl/files/unique_fd.h" -#include "flutter/glue/trace_event.h" #include "lib/zip/unique_unzipper.h" namespace blink { diff --git a/engine/src/flutter/flow/export_node.h b/engine/src/flutter/flow/export_node.h index aa8b55f49e..a8ccc7dfda 100644 --- a/engine/src/flutter/flow/export_node.h +++ b/engine/src/flutter/flow/export_node.h @@ -9,14 +9,14 @@ #include -#include "lib/ui/scenic/client/resources.h" -#include "flutter/flow/scene_update_context.h" #include "dart-pkg/zircon/sdk_ext/handle.h" +#include "flutter/flow/scene_update_context.h" #include "lib/fxl/build_config.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" #include "lib/fxl/synchronization/mutex.h" #include "lib/fxl/synchronization/thread_annotations.h" +#include "lib/ui/scenic/client/resources.h" #include "third_party/skia/include/core/SkPoint.h" namespace flow { diff --git a/engine/src/flutter/flow/instrumentation.cc b/engine/src/flutter/flow/instrumentation.cc index 4dcd18aa9f..d8952f9ec3 100644 --- a/engine/src/flutter/flow/instrumentation.cc +++ b/engine/src/flutter/flow/instrumentation.cc @@ -87,8 +87,7 @@ void Stopwatch::Visualize(SkCanvas& canvas, const SkRect& rect) const { const double sample_margin_unit_width = sample_unit_width / 6.0; const double sample_margin_width = width * sample_margin_unit_width; path.moveTo(x, bottom); - path.lineTo(x, y + - height * (1.0 - UnitHeight(laps_[0].ToMillisecondsF(), + path.lineTo(x, y + height * (1.0 - UnitHeight(laps_[0].ToMillisecondsF(), max_unit_interval))); double unit_x; double unit_next_x = 0.0; @@ -96,16 +95,14 @@ void Stopwatch::Visualize(SkCanvas& canvas, const SkRect& rect) const { unit_x = unit_next_x; unit_next_x = (static_cast(i + 1) / kMaxSamples); const double sample_y = - y + - height * - (1.0 - UnitHeight(laps_[i].ToMillisecondsF(), max_unit_interval)); + y + height * (1.0 - UnitHeight(laps_[i].ToMillisecondsF(), + max_unit_interval)); path.lineTo(x + width * unit_x + sample_margin_width, sample_y); path.lineTo(x + width * unit_next_x - sample_margin_width, sample_y); } path.lineTo( right, - y + - height * (1.0 - UnitHeight(laps_[kMaxSamples - 1].ToMillisecondsF(), + y + height * (1.0 - UnitHeight(laps_[kMaxSamples - 1].ToMillisecondsF(), max_unit_interval))); path.lineTo(right, bottom); path.close(); diff --git a/engine/src/flutter/flow/layers/clip_path_layer.cc b/engine/src/flutter/flow/layers/clip_path_layer.cc index eedebd7cae..35afdb9509 100644 --- a/engine/src/flutter/flow/layers/clip_path_layer.cc +++ b/engine/src/flutter/flow/layers/clip_path_layer.cc @@ -34,9 +34,9 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { // Treating the shape as a rectangle for now. auto bounds = clip_path_.getBounds(); scenic_lib::Rectangle shape(context.session(), // session - bounds.width(), // width - bounds.height() // height - ); + bounds.width(), // width + bounds.height() // height + ); SceneUpdateContext::Clip clip(context, shape, bounds); UpdateSceneChildren(context); diff --git a/engine/src/flutter/flow/layers/clip_rect_layer.cc b/engine/src/flutter/flow/layers/clip_rect_layer.cc index e0aa00bf7f..20ffd55e37 100644 --- a/engine/src/flutter/flow/layers/clip_rect_layer.cc +++ b/engine/src/flutter/flow/layers/clip_rect_layer.cc @@ -25,9 +25,9 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { FXL_DCHECK(needs_system_composite()); scenic_lib::Rectangle shape(context.session(), // session - clip_rect_.width(), // width - clip_rect_.height() // height - ); + clip_rect_.width(), // width + clip_rect_.height() // height + ); SceneUpdateContext::Clip clip(context, shape, clip_rect_); UpdateSceneChildren(context); diff --git a/engine/src/flutter/flow/layers/clip_rrect_layer.cc b/engine/src/flutter/flow/layers/clip_rrect_layer.cc index 913af8df19..6128dc9ab9 100644 --- a/engine/src/flutter/flow/layers/clip_rrect_layer.cc +++ b/engine/src/flutter/flow/layers/clip_rrect_layer.cc @@ -34,7 +34,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { clip_rrect_.radii(SkRRect::kLowerRight_Corner) .x(), // bottom_right_radius clip_rrect_.radii(SkRRect::kLowerLeft_Corner).x() // bottom_left_radius - ); + ); SceneUpdateContext::Clip clip(context, shape, clip_rrect_.getBounds()); UpdateSceneChildren(context); diff --git a/engine/src/flutter/flow/layers/layer.h b/engine/src/flutter/flow/layers/layer.h index ffab33ef0a..51c2a66729 100644 --- a/engine/src/flutter/flow/layers/layer.h +++ b/engine/src/flutter/flow/layers/layer.h @@ -25,9 +25,9 @@ #if defined(OS_FUCHSIA) -#include "lib/ui/scenic/client/resources.h" //nogncheck -#include "lib/ui/scenic/client/session.h" //nogncheck -#include "flutter/flow/scene_update_context.h" //nogncheck +#include "flutter/flow/scene_update_context.h" //nogncheck +#include "lib/ui/scenic/client/resources.h" //nogncheck +#include "lib/ui/scenic/client/session.h" //nogncheck #endif // defined(OS_FUCHSIA) diff --git a/engine/src/flutter/flow/layers/layer_tree.cc b/engine/src/flutter/flow/layers/layer_tree.cc index 000a841d54..1596046c64 100644 --- a/engine/src/flutter/flow/layers/layer_tree.cc +++ b/engine/src/flutter/flow/layers/layer_tree.cc @@ -32,7 +32,9 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, checkerboard_raster_cache_images_); Layer::PrerollContext context = { ignore_raster_cache ? nullptr : &frame.context().raster_cache(), - frame.gr_context(), color_space, SkRect::MakeEmpty(), + frame.gr_context(), + color_space, + SkRect::MakeEmpty(), }; root_layer_->Preroll(&context, SkMatrix::I()); diff --git a/engine/src/flutter/flow/layers/picture_layer.cc b/engine/src/flutter/flow/layers/picture_layer.cc index e2bcb03c44..05dbbec165 100644 --- a/engine/src/flutter/flow/layers/picture_layer.cc +++ b/engine/src/flutter/flow/layers/picture_layer.cc @@ -46,7 +46,7 @@ void PictureLayer::Paint(PaintContext& context) { raster_cache_result_.destination_rect(), // destination nullptr, // paint SkCanvas::kStrict_SrcRectConstraint // source constraint - ); + ); } else { context.canvas.drawPicture(picture_.get()); } diff --git a/engine/src/flutter/flow/paint_utils.cc b/engine/src/flutter/flow/paint_utils.cc index a64f7aa666..a9e2bb45ca 100644 --- a/engine/src/flutter/flow/paint_utils.cc +++ b/engine/src/flutter/flow/paint_utils.cc @@ -12,9 +12,7 @@ namespace flow { namespace { -sk_sp CreateCheckerboardShader(SkColor c1, - SkColor c2, - int size) { +sk_sp CreateCheckerboardShader(SkColor c1, SkColor c2, int size) { SkBitmap bm; bm.allocN32Pixels(2 * size, 2 * size); bm.eraseColor(c1); @@ -26,10 +24,7 @@ sk_sp CreateCheckerboardShader(SkColor c1, } // anonymous namespace -void DrawCheckerboard(SkCanvas* canvas, - SkColor c1, - SkColor c2, - int size) { +void DrawCheckerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) { SkPaint paint; paint.setShader(CreateCheckerboardShader(c1, c2, size)); canvas->drawPaint(paint); diff --git a/engine/src/flutter/flow/raster_cache.cc b/engine/src/flutter/flow/raster_cache.cc index 4d0efa286a..7a89a368d2 100644 --- a/engine/src/flutter/flow/raster_cache.cc +++ b/engine/src/flutter/flow/raster_cache.cc @@ -82,11 +82,11 @@ RasterCacheResult RasterizePicture(SkPicture* picture, SkRect::MakeWH(std::fabs(logical_rect.width() * scale.x()), std::fabs(logical_rect.height() * scale.y())); - const SkImageInfo image_info = - SkImageInfo::MakeN32Premul(std::ceil(physical_rect.width()), // physical width - std::ceil(physical_rect.height()), // physical height - sk_ref_sp(dst_color_space) // colorspace - ); + const SkImageInfo image_info = SkImageInfo::MakeN32Premul( + std::ceil(physical_rect.width()), // physical width + std::ceil(physical_rect.height()), // physical height + sk_ref_sp(dst_color_space) // colorspace + ); sk_sp surface = context diff --git a/engine/src/flutter/flow/raster_cache_unittests.cc b/engine/src/flutter/flow/raster_cache_unittests.cc index b361edf67e..cadf168e77 100644 --- a/engine/src/flutter/flow/raster_cache_unittests.cc +++ b/engine/src/flutter/flow/raster_cache_unittests.cc @@ -33,14 +33,14 @@ TEST(RasterCache, ThresholdIsRespected) { sk_sp image; sk_sp srgb = SkColorSpace::MakeSRGB(); - ASSERT_FALSE( - cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 1 + ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), + true, false)); // 1 cache.SweepAfterFrame(); - ASSERT_FALSE( - cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 2 + ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), + true, false)); // 2 cache.SweepAfterFrame(); - ASSERT_TRUE( - cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 3 + ASSERT_TRUE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), + true, false)); // 3 cache.SweepAfterFrame(); } @@ -55,14 +55,14 @@ TEST(RasterCache, ThresholdIsRespectedWhenZero) { sk_sp image; sk_sp srgb = SkColorSpace::MakeSRGB(); - ASSERT_FALSE( - cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 1 + ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), + true, false)); // 1 cache.SweepAfterFrame(); - ASSERT_FALSE( - cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 2 + ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), + true, false)); // 2 cache.SweepAfterFrame(); - ASSERT_FALSE( - cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 3 + ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), + true, false)); // 3 cache.SweepAfterFrame(); } @@ -77,19 +77,19 @@ TEST(RasterCache, SweepsRemoveUnusedFrames) { sk_sp image; sk_sp srgb = SkColorSpace::MakeSRGB(); - ASSERT_FALSE( - cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 1 + ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), + true, false)); // 1 cache.SweepAfterFrame(); - ASSERT_FALSE( - cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 2 + ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), + true, false)); // 2 cache.SweepAfterFrame(); - ASSERT_TRUE( - cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 3 + ASSERT_TRUE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), + true, false)); // 3 cache.SweepAfterFrame(); - ASSERT_TRUE( - cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 4 + ASSERT_TRUE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), + true, false)); // 4 cache.SweepAfterFrame(); cache.SweepAfterFrame(); // Extra frame without a preroll image access. - ASSERT_FALSE( - cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), true, false)); // 5 + ASSERT_FALSE(cache.GetPrerolledImage(NULL, picture.get(), matrix, srgb.get(), + true, false)); // 5 } diff --git a/engine/src/flutter/flow/scene_update_context.cc b/engine/src/flutter/flow/scene_update_context.cc index e26e0a7709..dc42a3bf3e 100644 --- a/engine/src/flutter/flow/scene_update_context.cc +++ b/engine/src/flutter/flow/scene_update_context.cc @@ -72,7 +72,7 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, rrect.radii(SkRRect::kUpperRight_Corner).x(), // top_right_radius rrect.radii(SkRRect::kLowerRight_Corner).x(), // bottom_right_radius rrect.radii(SkRRect::kLowerLeft_Corner).x() // bottom_left_radius - ); + ); scenic_lib::ShapeNode shape_node(session_); shape_node.SetShape(shape); shape_node.SetTranslation(shape_bounds.width() * 0.5f + shape_bounds.left(), @@ -102,7 +102,7 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, SetShapeColor(shape_node, color); scenic_lib::Rectangle inner_shape(session_, inner_bounds.width(), - inner_bounds.height()); + inner_bounds.height()); scenic_lib::ShapeNode inner_node(session_); inner_node.SetShape(inner_shape); inner_node.SetTranslation(inner_bounds.width() * 0.5f + inner_bounds.left(), @@ -255,12 +255,12 @@ SceneUpdateContext::Transform::Transform(SceneUpdateContext& context, entity_node().SetTranslation(decomposition.translation().x(), // decomposition.translation().y(), // decomposition.translation().z() // - ); + ); entity_node().SetScale(decomposition.scale().x(), // decomposition.scale().y(), // decomposition.scale().z() // - ); + ); context.top_scale_x_ *= decomposition.scale().x(); context.top_scale_y_ *= decomposition.scale().y(); @@ -268,7 +268,7 @@ SceneUpdateContext::Transform::Transform(SceneUpdateContext& context, decomposition.rotation().fData[1], // decomposition.rotation().fData[2], // decomposition.rotation().fData[3] // - ); + ); } } } diff --git a/engine/src/flutter/flow/scene_update_context.h b/engine/src/flutter/flow/scene_update_context.h index 918bfebc47..4bba913f52 100644 --- a/engine/src/flutter/flow/scene_update_context.h +++ b/engine/src/flutter/flow/scene_update_context.h @@ -8,11 +8,11 @@ #include #include -#include "lib/ui/scenic/client/resources.h" #include "flutter/flow/compositor_context.h" #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" #include "lib/fxl/macros.h" +#include "lib/ui/scenic/client/resources.h" #include "third_party/skia/include/core/SkRect.h" #include "third_party/skia/include/core/SkSurface.h" @@ -167,12 +167,11 @@ class SceneUpdateContext { const SkRect& paint_bounds, std::vector paint_layers); void SetShapeColor(scenic_lib::ShapeNode& shape_node, SkColor color); - scenic_lib::Image* GenerateImageIfNeeded( - SkColor color, - SkScalar scale_x, - SkScalar scale_y, - const SkRect& paint_bounds, - std::vector paint_layers); + scenic_lib::Image* GenerateImageIfNeeded(SkColor color, + SkScalar scale_x, + SkScalar scale_y, + const SkRect& paint_bounds, + std::vector paint_layers); Entity* top_entity_ = nullptr; float top_scale_x_ = 1.f; diff --git a/engine/src/flutter/fml/platform/android/message_loop_android.cc b/engine/src/flutter/fml/platform/android/message_loop_android.cc index 7a83e22509..0004d1e042 100644 --- a/engine/src/flutter/fml/platform/android/message_loop_android.cc +++ b/engine/src/flutter/fml/platform/android/message_loop_android.cc @@ -51,7 +51,7 @@ MessageLoopAndroid::MessageLoopAndroid() kWakeEvents, // events read_event_fd, // callback this // baton - ); + ); FXL_CHECK(add_result == 1); } @@ -70,7 +70,7 @@ void MessageLoopAndroid::Run() { nullptr, // out fd, nullptr, // out events, nullptr // out data - ); + ); if (result == ALOOPER_POLL_TIMEOUT || result == ALOOPER_POLL_ERROR) { // This handles the case where the loop is terminated using ALooper APIs. running_ = false; diff --git a/engine/src/flutter/fml/platform/linux/paths_linux.cc b/engine/src/flutter/fml/platform/linux/paths_linux.cc index cca676e4d0..4a8da450ef 100644 --- a/engine/src/flutter/fml/platform/linux/paths_linux.cc +++ b/engine/src/flutter/fml/platform/linux/paths_linux.cc @@ -18,7 +18,8 @@ std::pair GetExecutableDirectoryPath() { if (read_size == -1) { return {false, ""}; } - return {true, files::GetDirectoryName(std::string{path, static_cast(read_size)})}; + return {true, files::GetDirectoryName( + std::string{path, static_cast(read_size)})}; } } // namespace paths diff --git a/engine/src/flutter/fml/thread.cc b/engine/src/flutter/fml/thread.cc index 7043556675..a1500bfef4 100644 --- a/engine/src/flutter/fml/thread.cc +++ b/engine/src/flutter/fml/thread.cc @@ -57,10 +57,10 @@ void Thread::Join() { // a MSDN article: http://msdn2.microsoft.com/en-us/library/xcb2z8hs.aspx const DWORD kVCThreadNameException = 0x406D1388; typedef struct tagTHREADNAME_INFO { - DWORD dwType; // Must be 0x1000. - LPCSTR szName; // Pointer to name (in user addr space). + DWORD dwType; // Must be 0x1000. + LPCSTR szName; // Pointer to name (in user addr space). DWORD dwThreadID; // Thread ID (-1=caller thread). - DWORD dwFlags; // Reserved for future use, must be zero. + DWORD dwFlags; // Reserved for future use, must be zero. } THREADNAME_INFO; #endif @@ -79,9 +79,9 @@ void Thread::SetCurrentThreadName(const std::string& name) { info.dwThreadID = GetCurrentThreadId(); info.dwFlags = 0; __try { - RaiseException(kVCThreadNameException, 0, sizeof(info)/sizeof(DWORD), + RaiseException(kVCThreadNameException, 0, sizeof(info) / sizeof(DWORD), reinterpret_cast(&info)); - } __except(EXCEPTION_CONTINUE_EXECUTION) { + } __except (EXCEPTION_CONTINUE_EXECUTION) { } #else #error Unsupported Platform diff --git a/engine/src/flutter/fml/trace_event.cc b/engine/src/flutter/fml/trace_event.cc index 096b2e6c70..cd30d18527 100644 --- a/engine/src/flutter/fml/trace_event.cc +++ b/engine/src/flutter/fml/trace_event.cc @@ -17,7 +17,7 @@ void TraceEvent0(TraceArg category_group, TraceArg name) { 0, // argument_count nullptr, // argument_names nullptr // argument_values - ); + ); } void TraceEvent1(TraceArg category_group, @@ -33,7 +33,7 @@ void TraceEvent1(TraceArg category_group, 1, // argument_count arg_names, // argument_names arg_values // argument_values - ); + ); } void TraceEvent2(TraceArg category_group, @@ -51,7 +51,7 @@ void TraceEvent2(TraceArg category_group, 2, // argument_count arg_names, // argument_names arg_values // argument_values - ); + ); } void TraceEventEnd(TraceArg name) { @@ -62,7 +62,7 @@ void TraceEventEnd(TraceArg name) { 0, // argument_count nullptr, // argument_names nullptr // argument_values - ); + ); } void TraceEventAsyncBegin0(TraceArg category_group, @@ -75,7 +75,7 @@ void TraceEventAsyncBegin0(TraceArg category_group, 0, // argument_count nullptr, // argument_names nullptr // argument_values - ); + ); } void TraceEventAsyncEnd0(TraceArg category_group, @@ -88,7 +88,7 @@ void TraceEventAsyncEnd0(TraceArg category_group, 0, // argument_count nullptr, // argument_names nullptr // argument_values - ); + ); } void TraceEventAsyncBegin1(TraceArg category_group, @@ -105,7 +105,7 @@ void TraceEventAsyncBegin1(TraceArg category_group, 1, // argument_count arg_names, // argument_names arg_values // argument_values - ); + ); } void TraceEventAsyncEnd1(TraceArg category_group, @@ -122,7 +122,7 @@ void TraceEventAsyncEnd1(TraceArg category_group, 1, // argument_count arg_names, // argument_names arg_values // argument_values - ); + ); } void TraceEventInstant0(TraceArg category_group, TraceArg name) { @@ -133,7 +133,7 @@ void TraceEventInstant0(TraceArg category_group, TraceArg name) { 0, // argument_count nullptr, // argument_names nullptr // argument_values - ); + ); } void TraceEventFlowBegin0(TraceArg category_group, @@ -146,7 +146,7 @@ void TraceEventFlowBegin0(TraceArg category_group, 0, // argument_count nullptr, // argument_names nullptr // argument_values - ); + ); } void TraceEventFlowStep0(TraceArg category_group, @@ -159,7 +159,7 @@ void TraceEventFlowStep0(TraceArg category_group, 0, // argument_count nullptr, // argument_names nullptr // argument_values - ); + ); } void TraceEventFlowEnd0(TraceArg category_group, TraceArg name, TraceIDArg id) { @@ -170,7 +170,7 @@ void TraceEventFlowEnd0(TraceArg category_group, TraceArg name, TraceIDArg id) { 0, // argument_count nullptr, // argument_names nullptr // argument_values - ); + ); } } // namespace tracing diff --git a/engine/src/flutter/lib/ui/compositing/scene.cc b/engine/src/flutter/lib/ui/compositing/scene.cc index 52d26a897c..513d89f102 100644 --- a/engine/src/flutter/lib/ui/compositing/scene.cc +++ b/engine/src/flutter/lib/ui/compositing/scene.cc @@ -23,10 +23,9 @@ fxl::RefPtr Scene::create(std::unique_ptr rootLayer, uint32_t rasterizerTracingThreshold, bool checkerboardRasterCacheImages, bool checkerboardOffscreenLayers) { - return fxl::MakeRefCounted(std::move(rootLayer), - rasterizerTracingThreshold, - checkerboardRasterCacheImages, - checkerboardOffscreenLayers); + return fxl::MakeRefCounted( + std::move(rootLayer), rasterizerTracingThreshold, + checkerboardRasterCacheImages, checkerboardOffscreenLayers); } Scene::Scene(std::unique_ptr rootLayer, @@ -38,8 +37,7 @@ Scene::Scene(std::unique_ptr rootLayer, m_layerTree->set_rasterizer_tracing_threshold(rasterizerTracingThreshold); m_layerTree->set_checkerboard_raster_cache_images( checkerboardRasterCacheImages); - m_layerTree->set_checkerboard_offscreen_layers( - checkerboardOffscreenLayers); + m_layerTree->set_checkerboard_offscreen_layers(checkerboardOffscreenLayers); } Scene::~Scene() {} diff --git a/engine/src/flutter/lib/ui/compositing/scene_builder.cc b/engine/src/flutter/lib/ui/compositing/scene_builder.cc index cf9087d0e4..d1e3e61cc0 100644 --- a/engine/src/flutter/lib/ui/compositing/scene_builder.cc +++ b/engine/src/flutter/lib/ui/compositing/scene_builder.cc @@ -16,9 +16,9 @@ #include "flutter/flow/layers/picture_layer.h" #include "flutter/flow/layers/shader_mask_layer.h" #include "flutter/flow/layers/transform_layer.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/painting/matrix.h" #include "flutter/lib/ui/painting/shader.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" #include "lib/fxl/build_config.h" #include "lib/tonic/converter/dart_converter.h" @@ -165,7 +165,8 @@ void SceneBuilder::pushPhysicalModel(const RRect& rrect, if (!cullRect.intersect(rrect.sk_rrect.rect(), m_cullRects.top())) cullRect = SkRect::MakeEmpty(); - SkScalar dpr = UIDartState::Current()->window()->viewport_metrics().device_pixel_ratio; + SkScalar dpr = + UIDartState::Current()->window()->viewport_metrics().device_pixel_ratio; std::unique_ptr layer( new flow::PhysicalModelLayer()); diff --git a/engine/src/flutter/lib/ui/dart_runtime_hooks.cc b/engine/src/flutter/lib/ui/dart_runtime_hooks.cc index d0b3742e23..15663132c2 100644 --- a/engine/src/flutter/lib/ui/dart_runtime_hooks.cc +++ b/engine/src/flutter/lib/ui/dart_runtime_hooks.cc @@ -27,8 +27,8 @@ #include #elif defined(OS_IOS) extern "C" { - // Cannot import the syslog.h header directly because of macro collision. - extern void syslog(int, const char*, ...); +// Cannot import the syslog.h header directly because of macro collision. +extern void syslog(int, const char*, ...); } #endif diff --git a/engine/src/flutter/lib/ui/dart_runtime_hooks.h b/engine/src/flutter/lib/ui/dart_runtime_hooks.h index 2f88ef901a..506665c1e6 100644 --- a/engine/src/flutter/lib/ui/dart_runtime_hooks.h +++ b/engine/src/flutter/lib/ui/dart_runtime_hooks.h @@ -6,8 +6,8 @@ #define FLUTTER_LIB_UI_DART_RUNTIME_HOOKS_H_ #include "dart/runtime/include/dart_api.h" -#include "lib/tonic/dart_library_natives.h" #include "lib/fxl/macros.h" +#include "lib/tonic/dart_library_natives.h" namespace blink { diff --git a/engine/src/flutter/lib/ui/painting/canvas.cc b/engine/src/flutter/lib/ui/painting/canvas.cc index 8dec3a7cf6..929e545715 100644 --- a/engine/src/flutter/lib/ui/painting/canvas.cc +++ b/engine/src/flutter/lib/ui/painting/canvas.cc @@ -7,9 +7,9 @@ #include #include "flutter/flow/layers/physical_model_layer.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/painting/image.h" #include "flutter/lib/ui/painting/matrix.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" @@ -75,8 +75,9 @@ fxl::RefPtr Canvas::Create(PictureRecorder* recorder, double right, double bottom) { if (!recorder) - Dart_ThrowException(ToDart("Canvas constructor called with non-genuine PictureRecorder.")); - FXL_DCHECK(!recorder->isRecording()); // verified by Dart code + Dart_ThrowException( + ToDart("Canvas constructor called with non-genuine PictureRecorder.")); + FXL_DCHECK(!recorder->isRecording()); // verified by Dart code fxl::RefPtr canvas = fxl::MakeRefCounted( recorder->BeginRecording(SkRect::MakeLTRB(left, top, right, bottom))); recorder->set_canvas(canvas); @@ -157,7 +158,8 @@ void Canvas::transform(const tonic::Float64List& matrix4) { void Canvas::clipRect(double left, double top, double right, double bottom) { if (!canvas_) return; - canvas_->clipRect(SkRect::MakeLTRB(left, top, right, bottom), SkClipOp::kIntersect, true); + canvas_->clipRect(SkRect::MakeLTRB(left, top, right, bottom), + SkClipOp::kIntersect, true); } void Canvas::clipRRect(const RRect& rrect) { @@ -170,7 +172,8 @@ void Canvas::clipPath(const CanvasPath* path) { if (!canvas_) return; if (!path) - Dart_ThrowException(ToDart("Canvas.clipPath called with non-genuine Path.")); + Dart_ThrowException( + ToDart("Canvas.clipPath called with non-genuine Path.")); canvas_->clipPath(path->path(), true); } @@ -268,7 +271,8 @@ void Canvas::drawPath(const CanvasPath* path, if (!canvas_) return; if (!path) - Dart_ThrowException(ToDart("Canvas.drawPath called with non-genuine Path.")); + Dart_ThrowException( + ToDart("Canvas.drawPath called with non-genuine Path.")); canvas_->drawPath(path->path(), *paint.paint()); } @@ -280,7 +284,8 @@ void Canvas::drawImage(const CanvasImage* image, if (!canvas_) return; if (!image) - Dart_ThrowException(ToDart("Canvas.drawImage called with non-genuine Image.")); + Dart_ThrowException( + ToDart("Canvas.drawImage called with non-genuine Image.")); canvas_->drawImage(image->image(), x, y, paint.paint()); } @@ -298,7 +303,8 @@ void Canvas::drawImageRect(const CanvasImage* image, if (!canvas_) return; if (!image) - Dart_ThrowException(ToDart("Canvas.drawImageRect called with non-genuine Image.")); + Dart_ThrowException( + ToDart("Canvas.drawImageRect called with non-genuine Image.")); SkRect src = SkRect::MakeLTRB(src_left, src_top, src_right, src_bottom); SkRect dst = SkRect::MakeLTRB(dst_left, dst_top, dst_right, dst_bottom); canvas_->drawImageRect(image->image(), src, dst, paint.paint(), @@ -319,7 +325,8 @@ void Canvas::drawImageNine(const CanvasImage* image, if (!canvas_) return; if (!image) - Dart_ThrowException(ToDart("Canvas.drawImageNine called with non-genuine Image.")); + Dart_ThrowException( + ToDart("Canvas.drawImageNine called with non-genuine Image.")); SkRect center = SkRect::MakeLTRB(center_left, center_top, center_right, center_bottom); SkIRect icenter; @@ -332,7 +339,8 @@ void Canvas::drawPicture(Picture* picture) { if (!canvas_) return; if (!picture) - Dart_ThrowException(ToDart("Canvas.drawPicture called with non-genuine Picture.")); + Dart_ThrowException( + ToDart("Canvas.drawPicture called with non-genuine Picture.")); canvas_->drawPicture(picture->picture().get()); } @@ -359,11 +367,10 @@ void Canvas::drawVertices(const Vertices* vertices, if (!canvas_) return; if (!vertices) - Dart_ThrowException(ToDart("Canvas.drawVertices called with non-genuine Vertices.")); + Dart_ThrowException( + ToDart("Canvas.drawVertices called with non-genuine Vertices.")); - canvas_->drawVertices(vertices->vertices(), - blend_mode, - *paint.paint()); + canvas_->drawVertices(vertices->vertices(), blend_mode, *paint.paint()); } void Canvas::drawAtlas(const Paint& paint, @@ -377,7 +384,9 @@ void Canvas::drawAtlas(const Paint& paint, if (!canvas_) return; if (!atlas) - Dart_ThrowException(ToDart("Canvas.drawAtlas or Canvas.drawRawAtlas called with non-genuine Image.")); + Dart_ThrowException( + ToDart("Canvas.drawAtlas or Canvas.drawRawAtlas called with " + "non-genuine Image.")); sk_sp skImage = atlas->image(); @@ -400,14 +409,12 @@ void Canvas::drawShadow(const CanvasPath* path, double elevation, bool transparentOccluder) { if (!path) - Dart_ThrowException(ToDart("Canvas.drawShader called with non-genuine Path.")); - SkScalar dpr = UIDartState::Current()->window()->viewport_metrics().device_pixel_ratio; - flow::PhysicalModelLayer::DrawShadow(canvas_, - path->path(), - color, - elevation, - transparentOccluder, - dpr); + Dart_ThrowException( + ToDart("Canvas.drawShader called with non-genuine Path.")); + SkScalar dpr = + UIDartState::Current()->window()->viewport_metrics().device_pixel_ratio; + flow::PhysicalModelLayer::DrawShadow(canvas_, path->path(), color, elevation, + transparentOccluder, dpr); } void Canvas::Clear() { diff --git a/engine/src/flutter/lib/ui/painting/gradient.cc b/engine/src/flutter/lib/ui/painting/gradient.cc index e0d19584ea..7035df81b6 100644 --- a/engine/src/flutter/lib/ui/painting/gradient.cc +++ b/engine/src/flutter/lib/ui/painting/gradient.cc @@ -4,9 +4,9 @@ #include "flutter/lib/ui/painting/gradient.h" +#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_library_natives.h" namespace blink { diff --git a/engine/src/flutter/lib/ui/painting/gradient.h b/engine/src/flutter/lib/ui/painting/gradient.h index 063b10673d..788552cee1 100644 --- a/engine/src/flutter/lib/ui/painting/gradient.h +++ b/engine/src/flutter/lib/ui/painting/gradient.h @@ -13,7 +13,7 @@ namespace tonic { class DartLibraryNatives; -} // namspace tonic +} // namespace tonic namespace blink { diff --git a/engine/src/flutter/lib/ui/painting/image.cc b/engine/src/flutter/lib/ui/painting/image.cc index f94f3ff216..0b0127cd0c 100644 --- a/engine/src/flutter/lib/ui/painting/image.cc +++ b/engine/src/flutter/lib/ui/painting/image.cc @@ -6,9 +6,9 @@ #include "flutter/common/threads.h" #include "flutter/lib/ui/painting/utils.h" +#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_library_natives.h" namespace blink { diff --git a/engine/src/flutter/lib/ui/painting/image_filter.cc b/engine/src/flutter/lib/ui/painting/image_filter.cc index 13bb0c9be3..4965b6aa03 100644 --- a/engine/src/flutter/lib/ui/painting/image_filter.cc +++ b/engine/src/flutter/lib/ui/painting/image_filter.cc @@ -4,9 +4,9 @@ #include "flutter/lib/ui/painting/image_filter.h" +#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_library_natives.h" #include "third_party/skia/include/effects/SkBlurImageFilter.h" #include "third_party/skia/include/effects/SkImageSource.h" diff --git a/engine/src/flutter/lib/ui/painting/image_shader.cc b/engine/src/flutter/lib/ui/painting/image_shader.cc index 504c1471f7..0fabd134c7 100644 --- a/engine/src/flutter/lib/ui/painting/image_shader.cc +++ b/engine/src/flutter/lib/ui/painting/image_shader.cc @@ -4,9 +4,9 @@ #include "flutter/lib/ui/painting/image_shader.h" +#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_library_natives.h" using tonic::ToDart; @@ -38,7 +38,8 @@ void ImageShader::initWithImage(CanvasImage* image, SkShader::TileMode tmy, const tonic::Float64List& matrix4) { if (!image) - Dart_ThrowException(ToDart("ImageShader constructor called with non-genuine Image.")); + Dart_ThrowException( + ToDart("ImageShader constructor called with non-genuine Image.")); SkMatrix sk_matrix = ToSkMatrix(matrix4); set_shader(image->image()->makeShader(tmx, tmy, &sk_matrix)); } diff --git a/engine/src/flutter/lib/ui/painting/mask_filter.cc b/engine/src/flutter/lib/ui/painting/mask_filter.cc index 13d43fb184..1dfcfaa4a1 100644 --- a/engine/src/flutter/lib/ui/painting/mask_filter.cc +++ b/engine/src/flutter/lib/ui/painting/mask_filter.cc @@ -6,9 +6,9 @@ #include "flutter/common/threads.h" #include "flutter/lib/ui/painting/utils.h" +#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_library_natives.h" #include "third_party/skia/include/effects/SkBlurMaskFilter.h" diff --git a/engine/src/flutter/lib/ui/painting/paint.cc b/engine/src/flutter/lib/ui/painting/paint.cc index 430e6ffafc..8150695683 100644 --- a/engine/src/flutter/lib/ui/painting/paint.cc +++ b/engine/src/flutter/lib/ui/painting/paint.cc @@ -97,8 +97,7 @@ Paint DartConverter::FromArguments(Dart_NativeArguments args, uint32_t encoded_blend_mode = uint_data[kBlendModeIndex]; if (encoded_blend_mode) { - uint32_t blend_mode = - encoded_blend_mode ^ kBlendModeDefault; + uint32_t blend_mode = encoded_blend_mode ^ kBlendModeDefault; paint.setBlendMode(static_cast(blend_mode)); } diff --git a/engine/src/flutter/lib/ui/painting/path.cc b/engine/src/flutter/lib/ui/painting/path.cc index 0353ebeb8d..e4638e7439 100644 --- a/engine/src/flutter/lib/ui/painting/path.cc +++ b/engine/src/flutter/lib/ui/painting/path.cc @@ -7,9 +7,9 @@ #include #include "flutter/lib/ui/painting/matrix.h" +#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_library_natives.h" using tonic::ToDart; @@ -174,7 +174,8 @@ void CanvasPath::addPath(CanvasPath* path, double dx, double dy) { void CanvasPath::extendWithPath(CanvasPath* path, double dx, double dy) { if (!path) - Dart_ThrowException(ToDart("Path.extendWithPath called with non-genuine Path.")); + Dart_ThrowException( + ToDart("Path.extendWithPath called with non-genuine Path.")); path_.addPath(path->path(), dx, dy, SkPath::kExtend_AddPathMode); } @@ -196,8 +197,7 @@ fxl::RefPtr CanvasPath::shift(double dx, double dy) { return path; } -fxl::RefPtr CanvasPath::transform( - tonic::Float64List& matrix4) { +fxl::RefPtr CanvasPath::transform(tonic::Float64List& matrix4) { fxl::RefPtr path = CanvasPath::Create(); path_.transform(ToSkMatrix(matrix4), &path->path_); matrix4.Release(); diff --git a/engine/src/flutter/lib/ui/painting/picture.cc b/engine/src/flutter/lib/ui/painting/picture.cc index ace8387c2f..89ddbf5f41 100644 --- a/engine/src/flutter/lib/ui/painting/picture.cc +++ b/engine/src/flutter/lib/ui/painting/picture.cc @@ -38,9 +38,9 @@ Picture::~Picture() { fxl::RefPtr Picture::toImage(int width, int height) { fxl::RefPtr image = CanvasImage::Create(); // TODO(abarth): We should pass in an SkColorSpace at some point. - image->set_image( - SkImage::MakeFromPicture(picture_, SkISize::Make(width, height), nullptr, - nullptr, SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB())); + image->set_image(SkImage::MakeFromPicture( + picture_, SkISize::Make(width, height), nullptr, nullptr, + SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB())); return image; } diff --git a/engine/src/flutter/lib/ui/painting/picture_recorder.cc b/engine/src/flutter/lib/ui/painting/picture_recorder.cc index f3365e283c..adc73c0043 100644 --- a/engine/src/flutter/lib/ui/painting/picture_recorder.cc +++ b/engine/src/flutter/lib/ui/painting/picture_recorder.cc @@ -6,9 +6,9 @@ #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/painting/picture.h" +#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_library_natives.h" namespace blink { diff --git a/engine/src/flutter/lib/ui/painting/rrect.cc b/engine/src/flutter/lib/ui/painting/rrect.cc index cfc1d0daae..3f1b6134ca 100644 --- a/engine/src/flutter/lib/ui/painting/rrect.cc +++ b/engine/src/flutter/lib/ui/painting/rrect.cc @@ -4,8 +4,8 @@ #include "flutter/lib/ui/painting/rrect.h" -#include "lib/tonic/logging/dart_error.h" #include "lib/fxl/logging.h" +#include "lib/tonic/logging/dart_error.h" #include "lib/tonic/typed_data/float32_list.h" using namespace blink; diff --git a/engine/src/flutter/lib/ui/painting/shader.cc b/engine/src/flutter/lib/ui/painting/shader.cc index a36238fd49..d7d8ccf20a 100644 --- a/engine/src/flutter/lib/ui/painting/shader.cc +++ b/engine/src/flutter/lib/ui/painting/shader.cc @@ -11,8 +11,7 @@ namespace blink { IMPLEMENT_WRAPPERTYPEINFO(ui, Shader); -Shader::Shader(sk_sp shader) : shader_(shader) { -} +Shader::Shader(sk_sp shader) : shader_(shader) {} Shader::~Shader() { // Skia objects must be deleted on the IO thread so that any associated GL @@ -20,4 +19,4 @@ Shader::~Shader() { SkiaUnrefOnIOThread(&shader_); } -} // namespace blink +} // namespace blink diff --git a/engine/src/flutter/lib/ui/painting/utils.cc b/engine/src/flutter/lib/ui/painting/utils.cc index 3666d0b988..6bffd565d7 100644 --- a/engine/src/flutter/lib/ui/painting/utils.cc +++ b/engine/src/flutter/lib/ui/painting/utils.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/utils.h" +#include "flutter/common/threads.h" namespace blink { @@ -13,8 +13,7 @@ constexpr fxl::TimeDelta kDrainDelay = fxl::TimeDelta::FromMilliseconds(250); } // anonymous namespace -SkiaUnrefQueue::SkiaUnrefQueue() - : drain_pending_(false) {} +SkiaUnrefQueue::SkiaUnrefQueue() : drain_pending_(false) {} SkiaUnrefQueue SkiaUnrefQueue::instance_; @@ -27,8 +26,7 @@ void SkiaUnrefQueue::Unref(SkRefCnt* object) { objects_.push_back(object); if (!drain_pending_) { drain_pending_ = true; - Threads::IO()->PostDelayedTask([this] { Drain(); }, - kDrainDelay); + Threads::IO()->PostDelayedTask([this] { Drain(); }, kDrainDelay); } } diff --git a/engine/src/flutter/lib/ui/painting/utils.h b/engine/src/flutter/lib/ui/painting/utils.h index 0aab9b7e4c..6802171337 100644 --- a/engine/src/flutter/lib/ui/painting/utils.h +++ b/engine/src/flutter/lib/ui/painting/utils.h @@ -27,11 +27,12 @@ class SkiaUnrefQueue { bool drain_pending_ FXL_GUARDED_BY(mutex_); }; -template void SkiaUnrefOnIOThread(sk_sp* sp) { +template +void SkiaUnrefOnIOThread(sk_sp* sp) { T* object = sp->release(); if (object) { SkiaUnrefQueue::Get().Unref(object); } } -} // namespace blink +} // namespace blink diff --git a/engine/src/flutter/lib/ui/painting/vertices.cc b/engine/src/flutter/lib/ui/painting/vertices.cc index 65ba137268..0ad5144251 100644 --- a/engine/src/flutter/lib/ui/painting/vertices.cc +++ b/engine/src/flutter/lib/ui/painting/vertices.cc @@ -11,14 +11,13 @@ namespace blink { namespace { -void DecodePoints(const tonic::Float32List& coords, - SkPoint* points) { +void DecodePoints(const tonic::Float32List& coords, SkPoint* points) { for (int i = 0; i < coords.num_elements(); i += 2) points[i / 2] = SkPoint::Make(coords[i], coords[i + 1]); } -template void DecodeInts(const tonic::Int32List& ints, - T* out) { +template +void DecodeInts(const tonic::Int32List& ints, T* out) { for (int i = 0; i < ints.num_elements(); i++) out[i] = ints[i]; } @@ -31,8 +30,7 @@ static void Vertices_constructor(Dart_NativeArguments args) { IMPLEMENT_WRAPPERTYPEINFO(ui, Vertices); -#define FOR_EACH_BINDING(V) \ - V(Vertices, init) +#define FOR_EACH_BINDING(V) V(Vertices, init) FOR_EACH_BINDING(DART_NATIVE_CALLBACK) @@ -60,10 +58,8 @@ void Vertices::init(SkVertices::VertexMode vertex_mode, if (colors.data()) builderFlags |= SkVertices::kHasColors_BuilderFlag; - SkVertices::Builder builder(vertex_mode, - positions.num_elements() / 2, - indices.num_elements(), - builderFlags); + SkVertices::Builder builder(vertex_mode, positions.num_elements() / 2, + indices.num_elements(), builderFlags); if (positions.data()) DecodePoints(positions, builder.positions()); if (texture_coordinates.data()) diff --git a/engine/src/flutter/lib/ui/painting/vertices.h b/engine/src/flutter/lib/ui/painting/vertices.h index f3deda7ef7..47b5133ae6 100644 --- a/engine/src/flutter/lib/ui/painting/vertices.h +++ b/engine/src/flutter/lib/ui/painting/vertices.h @@ -28,12 +28,11 @@ class Vertices : public fxl::RefCountedThreadSafe, static fxl::RefPtr Create(); - void init( - SkVertices::VertexMode vertex_mode, - const tonic::Float32List& positions, - const tonic::Float32List& texture_coordinates, - const tonic::Int32List& colors, - const tonic::Int32List& indices); + void init(SkVertices::VertexMode vertex_mode, + const tonic::Float32List& positions, + const tonic::Float32List& texture_coordinates, + const tonic::Int32List& colors, + const tonic::Int32List& indices); const sk_sp& vertices() const { return vertices_; } diff --git a/engine/src/flutter/lib/ui/text/font_collection.cc b/engine/src/flutter/lib/ui/text/font_collection.cc index c12284d7d9..cab0796786 100644 --- a/engine/src/flutter/lib/ui/text/font_collection.cc +++ b/engine/src/flutter/lib/ui/text/font_collection.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include #include "flutter/lib/ui/text/font_collection.h" +#include #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/rapidjson.h" #include "third_party/skia/include/core/SkStream.h" diff --git a/engine/src/flutter/lib/ui/text/paragraph_builder.cc b/engine/src/flutter/lib/ui/text/paragraph_builder.cc index ec50efb077..a86fcc9315 100644 --- a/engine/src/flutter/lib/ui/text/paragraph_builder.cc +++ b/engine/src/flutter/lib/ui/text/paragraph_builder.cc @@ -111,7 +111,7 @@ PassRefPtr decodeParagraphStyle(RenderStyle* parentStyle, double fontSize, double lineHeight, const std::u16string& ellipsis) { - FXL_DCHECK(encoded.num_elements() == 6); // also update text.dart + FXL_DCHECK(encoded.num_elements() == 6); // also update text.dart RefPtr style = RenderStyle::create(); style->inheritFrom(parentStyle); @@ -123,7 +123,8 @@ PassRefPtr decodeParagraphStyle(RenderStyle* parentStyle, style->setTextAlign(static_cast(encoded[psTextAlignIndex])); if (mask & psTextDirectionMask) - style->setDirection(static_cast(encoded[psTextDirectionIndex])); + style->setDirection( + static_cast(encoded[psTextDirectionIndex])); if (mask & (psFontWeightMask | psFontStyleMask | psFontFamilyMask | psFontSizeMask)) { diff --git a/engine/src/flutter/lib/ui/ui_dart_state.cc b/engine/src/flutter/lib/ui/ui_dart_state.cc index ac38e9ff0c..da1821641e 100644 --- a/engine/src/flutter/lib/ui/ui_dart_state.cc +++ b/engine/src/flutter/lib/ui/ui_dart_state.cc @@ -49,7 +49,6 @@ void UIDartState::set_font_selector(PassRefPtr selector) { font_selector_ = selector; } - PassRefPtr UIDartState::font_selector() { return font_selector_; } diff --git a/engine/src/flutter/lib/ui/window/platform_message_response_dart.cc b/engine/src/flutter/lib/ui/window/platform_message_response_dart.cc index 1e80040ccc..adddae8365 100644 --- a/engine/src/flutter/lib/ui/window/platform_message_response_dart.cc +++ b/engine/src/flutter/lib/ui/window/platform_message_response_dart.cc @@ -38,8 +38,8 @@ void PlatformMessageResponseDart::Complete(std::vector data) { return; tonic::DartState::Scope scope(dart_state); - Dart_Handle byte_buffer = Dart_NewTypedData( - Dart_TypedData_kByteData, data.size()); + Dart_Handle byte_buffer = + Dart_NewTypedData(Dart_TypedData_kByteData, data.size()); DART_CHECK_VALID(byte_buffer); void* buffer; @@ -60,8 +60,8 @@ void PlatformMessageResponseDart::CompleteEmpty() { return; FXL_DCHECK(!is_complete_); is_complete_ = true; - Threads::UI()->PostTask(fxl::MakeCopyable( - [ callback = std::move(callback_) ]() mutable { + Threads::UI()->PostTask( + fxl::MakeCopyable([callback = std::move(callback_)]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) return; diff --git a/engine/src/flutter/lib/ui/window/window.cc b/engine/src/flutter/lib/ui/window/window.cc index a156c4764e..54ac689559 100644 --- a/engine/src/flutter/lib/ui/window/window.cc +++ b/engine/src/flutter/lib/ui/window/window.cc @@ -40,7 +40,8 @@ Dart_Handle ToByteData(const std::vector& buffer) { } void DefaultRouteName(Dart_NativeArguments args) { - std::string routeName = UIDartState::Current()->window()->client()->DefaultRouteName(); + std::string routeName = + UIDartState::Current()->window()->client()->DefaultRouteName(); Dart_SetReturnValue(args, StdStringToDart(routeName)); } @@ -155,11 +156,11 @@ void Window::UpdateLocale(const std::string& language_code, return; tonic::DartState::Scope scope(dart_state); - DartInvokeField( - library_.value(), "_updateLocale", - { - StdStringToDart(language_code), StdStringToDart(country_code), - }); + DartInvokeField(library_.value(), "_updateLocale", + { + StdStringToDart(language_code), + StdStringToDart(country_code), + }); } void Window::UpdateSemanticsEnabled(bool enabled) { @@ -177,9 +178,8 @@ void Window::DispatchPlatformMessage(fxl::RefPtr message) { if (!dart_state) return; tonic::DartState::Scope scope(dart_state); - Dart_Handle data_handle = (message->hasData()) - ? ToByteData(message->data()) - : Dart_Null(); + Dart_Handle data_handle = + (message->hasData()) ? ToByteData(message->data()) : Dart_Null(); if (Dart_IsError(data_handle)) return; diff --git a/engine/src/flutter/runtime/dart_controller.cc b/engine/src/flutter/runtime/dart_controller.cc index 1452f9ebba..517ad70bec 100644 --- a/engine/src/flutter/runtime/dart_controller.cc +++ b/engine/src/flutter/runtime/dart_controller.cc @@ -44,8 +44,8 @@ std::string ResolvePath(std::string path) { } // namespace -DartController::DartController() : ui_dart_state_(nullptr), - platform_kernel_bytes(nullptr) {} +DartController::DartController() + : ui_dart_state_(nullptr), platform_kernel_bytes(nullptr) {} DartController::~DartController() { if (ui_dart_state_) { @@ -99,11 +99,11 @@ bool DartController::SendStartMessage(Dart_Handle root_library) { } static void CopyVectorBytes(const std::vector& vector, - uint8_t*& bytes) { + uint8_t*& bytes) { if (bytes) { free(bytes); } - bytes = (uint8_t*) malloc(vector.size()); + bytes = (uint8_t*)malloc(vector.size()); memcpy(bytes, vector.data(), vector.size()); } @@ -115,8 +115,8 @@ tonic::DartErrorHandleType DartController::RunFromKernel( uint8_t* kernel_bytes = nullptr; CopyVectorBytes(kernel, kernel_bytes); - Dart_Handle result = Dart_LoadKernel( - Dart_ReadKernelBinary(kernel_bytes, kernel.size())); + Dart_Handle result = + Dart_LoadKernel(Dart_ReadKernelBinary(kernel_bytes, kernel.size())); LogIfError(result); tonic::DartErrorHandleType error = tonic::GetErrorHandleType(result); if (SendStartMessage(Dart_RootLibrary())) { @@ -136,7 +136,8 @@ tonic::DartErrorHandleType DartController::RunFromPrecompiledSnapshot() { } tonic::DartErrorHandleType DartController::RunFromScriptSnapshot( - const uint8_t* buffer, size_t size) { + const uint8_t* buffer, + size_t size) { tonic::DartState::Scope scope(dart_state()); Dart_Handle result = Dart_LoadScriptFromSnapshot(buffer, size); LogIfError(result); @@ -148,7 +149,8 @@ tonic::DartErrorHandleType DartController::RunFromScriptSnapshot( } tonic::DartErrorHandleType DartController::RunFromSource( - const std::string& main, const std::string& packages) { + const std::string& main, + const std::string& packages) { tonic::DartState::Scope scope(dart_state()); tonic::FileLoader& loader = dart_state()->file_loader(); if (!packages.empty() && !loader.LoadPackagesMap(ResolvePath(packages))) @@ -162,11 +164,12 @@ tonic::DartErrorHandleType DartController::RunFromSource( return error; } -void DartController::CreateIsolateFor(const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - const std::vector& platform_kernel, - std::unique_ptr state) { +void DartController::CreateIsolateFor( + const std::string& script_uri, + const uint8_t* isolate_snapshot_data, + const uint8_t* isolate_snapshot_instr, + const std::vector& platform_kernel, + std::unique_ptr state) { char* error = nullptr; Dart_Isolate isolate; @@ -179,13 +182,13 @@ void DartController::CreateIsolateFor(const std::string& script_uri, isolate = Dart_CreateIsolateFromKernel( script_uri.c_str(), "main", Dart_ReadKernelBinary(platform_kernel_bytes, platform_kernel.size()), - nullptr /* flags */, - static_cast(state.get()), &error); + nullptr /* flags */, static_cast(state.get()), + &error); } else { - isolate = Dart_CreateIsolate( - script_uri.c_str(), "main", isolate_snapshot_data, - isolate_snapshot_instr, nullptr, - static_cast(state.get()), &error); + isolate = + Dart_CreateIsolate(script_uri.c_str(), "main", isolate_snapshot_data, + isolate_snapshot_instr, nullptr, + static_cast(state.get()), &error); } FXL_CHECK(isolate) << error; ui_dart_state_ = state.release(); diff --git a/engine/src/flutter/runtime/dart_controller.h b/engine/src/flutter/runtime/dart_controller.h index 16c0ace08d..0145d30089 100644 --- a/engine/src/flutter/runtime/dart_controller.h +++ b/engine/src/flutter/runtime/dart_controller.h @@ -49,6 +49,6 @@ class DartController { FXL_DISALLOW_COPY_AND_ASSIGN(DartController); }; -} +} // namespace blink #endif // FLUTTER_RUNTIME_DART_CONTROLLER_H_ diff --git a/engine/src/flutter/runtime/dart_init.cc b/engine/src/flutter/runtime/dart_init.cc index f11d78e5b2..e458e1210b 100644 --- a/engine/src/flutter/runtime/dart_init.cc +++ b/engine/src/flutter/runtime/dart_init.cc @@ -73,11 +73,8 @@ namespace { // Arguments passed to the Dart VM in all configurations. static const char* kDartLanguageArgs[] = { - "--enable_mirrors=false", - "--background_compilation", - "--await_is_keyword", - "--assert_initializer", - "--causal_async_stacks", + "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", + "--assert_initializer", "--causal_async_stacks", }; static const char* kDartPrecompilationArgs[] = { @@ -110,8 +107,8 @@ static const char* kDartEndlessTraceBufferArgs[]{ }; static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { - "--systrace_timeline", - "--timeline_streams=VM,Isolate,Compiler,Dart,GC", + "--systrace_timeline", + "--timeline_streams=VM,Isolate,Compiler,Dart,GC", }; constexpr char kFileUriPrefix[] = "file://"; @@ -186,7 +183,7 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE // No VM-service in release mode. return nullptr; -#else // FLUTTER_RUNTIME_MODE +#else // FLUTTER_RUNTIME_MODE tonic::DartState* dart_state = new tonic::DartState(); Dart_Isolate isolate = Dart_CreateIsolate( script_uri, "main", g_default_isolate_snapshot_data, @@ -227,7 +224,6 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, #endif // FLUTTER_RUNTIME_MODE } - Dart_Isolate IsolateCreateCallback(const char* script_uri, const char* main, const char* package_root, @@ -279,11 +275,14 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, UIDartState* parent_dart_state = static_cast(callback_data); UIDartState* dart_state = parent_dart_state->CreateForChildIsolate(); - Dart_Isolate isolate = kernel_platform != nullptr - ? Dart_CreateIsolateFromKernel(script_uri, main, kernel_platform, - nullptr /* flags */, dart_state, error) - : Dart_CreateIsolate(script_uri, main, g_default_isolate_snapshot_data, - g_default_isolate_snapshot_instructions, nullptr, dart_state, error); + Dart_Isolate isolate = + kernel_platform != nullptr + ? Dart_CreateIsolateFromKernel(script_uri, main, kernel_platform, + nullptr /* flags */, dart_state, error) + : Dart_CreateIsolate(script_uri, main, + g_default_isolate_snapshot_data, + g_default_isolate_snapshot_instructions, nullptr, + dart_state, error); FXL_CHECK(isolate) << error; dart_state->SetIsolate(isolate); FXL_CHECK(!LogIfError( @@ -302,8 +301,8 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, if (!kernel_data.empty()) { // We are running kernel code. - FXL_CHECK(!LogIfError(Dart_LoadKernel(Dart_ReadKernelBinary(kernel_data.data(), - kernel_data.size())))); + FXL_CHECK(!LogIfError(Dart_LoadKernel( + Dart_ReadKernelBinary(kernel_data.data(), kernel_data.size())))); } else if (!snapshot_data.empty()) { // We are running from a script snapshot. FXL_CHECK(!LogIfError(Dart_LoadScriptFromSnapshot(snapshot_data.data(), @@ -573,7 +572,7 @@ void InitDartVM(const uint8_t* vm_snapshot_data, 0, // argument_count nullptr, // argument_names nullptr // argument_values - ); + ); } } diff --git a/engine/src/flutter/runtime/dart_init.h b/engine/src/flutter/runtime/dart_init.h index 64a18fb80e..5886e470f9 100644 --- a/engine/src/flutter/runtime/dart_init.h +++ b/engine/src/flutter/runtime/dart_init.h @@ -6,8 +6,8 @@ #define FLUTTER_RUNTIME_DART_INIT_H_ #include "dart/runtime/include/dart_api.h" -#include "lib/fxl/functional/closure.h" #include "lib/fxl/build_config.h" +#include "lib/fxl/functional/closure.h" #include #include diff --git a/engine/src/flutter/runtime/dart_service_isolate.cc b/engine/src/flutter/runtime/dart_service_isolate.cc index 9a6184f880..16fae732be 100644 --- a/engine/src/flutter/runtime/dart_service_isolate.cc +++ b/engine/src/flutter/runtime/dart_service_isolate.cc @@ -33,7 +33,7 @@ namespace flutter { namespace runtime { extern ResourcesEntry __flutter_embedded_service_isolate_resources_[]; } -} +} // namespace flutter namespace blink { namespace { @@ -66,7 +66,8 @@ void DartServiceIsolate::TriggerResourceLoad(Dart_NativeArguments args) { void DartServiceIsolate::NotifyServerState(Dart_NativeArguments args) { Dart_Handle exception = nullptr; - std::string uri = tonic::DartConverter::FromArguments(args, 0, exception); + std::string uri = + tonic::DartConverter::FromArguments(args, 0, exception); if (!exception) { observatory_uri_ = uri; } diff --git a/engine/src/flutter/runtime/platform_impl.h b/engine/src/flutter/runtime/platform_impl.h index 5c9b02b69a..280f72e321 100644 --- a/engine/src/flutter/runtime/platform_impl.h +++ b/engine/src/flutter/runtime/platform_impl.h @@ -5,8 +5,8 @@ #ifndef FLUTTER_RUNTIME_PLATFORM_IMPL_H_ #define FLUTTER_RUNTIME_PLATFORM_IMPL_H_ -#include "lib/fxl/macros.h" #include "flutter/sky/engine/public/platform/Platform.h" +#include "lib/fxl/macros.h" namespace blink { diff --git a/engine/src/flutter/runtime/runtime_controller.cc b/engine/src/flutter/runtime/runtime_controller.cc index e388b36142..64457934b1 100644 --- a/engine/src/flutter/runtime/runtime_controller.cc +++ b/engine/src/flutter/runtime/runtime_controller.cc @@ -27,7 +27,8 @@ RuntimeController::RuntimeController(RuntimeDelegate* client) RuntimeController::~RuntimeController() {} void RuntimeController::CreateDartController( - const std::string& script_uri, const uint8_t* isolate_snapshot_data, + const std::string& script_uri, + const uint8_t* isolate_snapshot_data, const uint8_t* isolate_snapshot_instr, const std::vector& platform_kernel) { FXL_DCHECK(!dart_controller_); diff --git a/engine/src/flutter/runtime/test_font_selector.cc b/engine/src/flutter/runtime/test_font_selector.cc index 90907157bb..0f15e7f77f 100644 --- a/engine/src/flutter/runtime/test_font_selector.cc +++ b/engine/src/flutter/runtime/test_font_selector.cc @@ -27,13 +27,12 @@ PassRefPtr TestFontSelector::getFontData( bool syntheticBold = (fontDescription.weight() >= FontWeight600 || fontDescription.isSyntheticBold()); - bool syntheticItalic = (fontDescription.style() || - fontDescription.isSyntheticItalic()); - FontPlatformData platform_data(test_typeface_, "Ahem", - fontDescription.effectiveFontSize(), - syntheticBold, syntheticItalic, - fontDescription.orientation(), - fontDescription.useSubpixelPositioning()); + bool syntheticItalic = + (fontDescription.style() || fontDescription.isSyntheticItalic()); + FontPlatformData platform_data( + test_typeface_, "Ahem", fontDescription.effectiveFontSize(), + syntheticBold, syntheticItalic, fontDescription.orientation(), + fontDescription.useSubpixelPositioning()); return SimpleFontData::create(platform_data, CustomFontData::create()); } diff --git a/engine/src/flutter/shell/common/animator.cc b/engine/src/flutter/shell/common/animator.cc index b671d98ce5..fd2cfef2aa 100644 --- a/engine/src/flutter/shell/common/animator.cc +++ b/engine/src/flutter/shell/common/animator.cc @@ -4,10 +4,10 @@ #include "flutter/shell/common/animator.h" +#include "dart/runtime/include/dart_tools_api.h" #include "flutter/common/threads.h" #include "flutter/fml/trace_event.h" #include "lib/fxl/time/stopwatch.h" -#include "dart/runtime/include/dart_tools_api.h" namespace shell { diff --git a/engine/src/flutter/shell/common/diagnostic/diagnostic_server.cc b/engine/src/flutter/shell/common/diagnostic/diagnostic_server.cc index 64ae0738e6..a064e516ce 100644 --- a/engine/src/flutter/shell/common/diagnostic/diagnostic_server.cc +++ b/engine/src/flutter/shell/common/diagnostic/diagnostic_server.cc @@ -23,13 +23,13 @@ namespace flutter { namespace runtime { extern ResourcesEntry __sky_embedder_diagnostic_server_resources_[]; } -} +} // namespace flutter namespace shell { -using tonic::DartLibraryNatives; using blink::EmbedderResources; using tonic::DartInvokeField; +using tonic::DartLibraryNatives; using tonic::LogIfError; using tonic::ToDart; diff --git a/engine/src/flutter/shell/common/engine.h b/engine/src/flutter/shell/common/engine.h index 1198b24943..1baf245cb0 100644 --- a/engine/src/flutter/shell/common/engine.h +++ b/engine/src/flutter/shell/common/engine.h @@ -85,7 +85,8 @@ class Engine : public blink::RuntimeDelegate { void StartAnimatorIfPossible(); void ConfigureAssetBundle(const std::string& path); - void ConfigureRuntime(const std::string& script_uri, + void ConfigureRuntime( + const std::string& script_uri, const std::vector& platform_kernel = std::vector()); bool HandleLifecyclePlatformMessage(blink::PlatformMessage* message); diff --git a/engine/src/flutter/shell/common/platform_view.h b/engine/src/flutter/shell/common/platform_view.h index 33c6a4ca1a..67176a9f72 100644 --- a/engine/src/flutter/shell/common/platform_view.h +++ b/engine/src/flutter/shell/common/platform_view.h @@ -83,8 +83,7 @@ class PlatformView : public std::enable_shared_from_this { std::unique_ptr vsync_waiter_; SkISize size_; -private: - + private: FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); }; diff --git a/engine/src/flutter/shell/common/platform_view_service_protocol.cc b/engine/src/flutter/shell/common/platform_view_service_protocol.cc index da63869aa5..02c15487a0 100644 --- a/engine/src/flutter/shell/common/platform_view_service_protocol.cc +++ b/engine/src/flutter/shell/common/platform_view_service_protocol.cc @@ -326,11 +326,11 @@ const char* PlatformViewServiceProtocol::kFlushUIThreadTasksExtensionName = // It should be invoked from the VM Service and and blocks it until UI thread // tasks are processed. bool PlatformViewServiceProtocol::FlushUIThreadTasks(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { fxl::AutoResetWaitableEvent latch; blink::Threads::UI()->PostTask([&latch]() { // This task is empty because we just need to synchronize this RPC with the diff --git a/engine/src/flutter/shell/common/vsync_waiter_fallback.cc b/engine/src/flutter/shell/common/vsync_waiter_fallback.cc index d5338cb9e3..01c86cdedc 100644 --- a/engine/src/flutter/shell/common/vsync_waiter_fallback.cc +++ b/engine/src/flutter/shell/common/vsync_waiter_fallback.cc @@ -4,8 +4,8 @@ #include "flutter/shell/common/vsync_waiter_fallback.h" -#include "lib/fxl/logging.h" #include "flutter/common/threads.h" +#include "lib/fxl/logging.h" namespace shell { namespace { 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 ce6642a52f..45b5ee9a8d 100644 --- a/engine/src/flutter/shell/platform/android/android_context_gl.cc +++ b/engine/src/flutter/shell/platform/android/android_context_gl.cc @@ -128,13 +128,9 @@ bool AndroidContextGL::CreateWindowSurface( window_ = std::move(window); EGLDisplay display = environment_->Display(); - const EGLint srgb_attribs[] = { - EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR, - EGL_NONE - }; - const EGLint default_attribs[] = { - EGL_NONE - }; + const EGLint srgb_attribs[] = {EGL_GL_COLORSPACE_KHR, + EGL_GL_COLORSPACE_SRGB_KHR, EGL_NONE}; + const EGLint default_attribs[] = {EGL_NONE}; const EGLint* attribs = default_attribs; if (srgb_support_) { @@ -154,17 +150,14 @@ bool AndroidContextGL::CreatePBufferSurface() { EGLDisplay display = environment_->Display(); - const EGLint srgb_attribs[] = { - EGL_WIDTH, 1, - EGL_HEIGHT, 1, - EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR, - EGL_NONE - }; - const EGLint default_attribs[] = { - EGL_WIDTH, 1, - EGL_HEIGHT, 1, - EGL_NONE - }; + const EGLint srgb_attribs[] = {EGL_WIDTH, + 1, + EGL_HEIGHT, + 1, + EGL_GL_COLORSPACE_KHR, + EGL_GL_COLORSPACE_SRGB_KHR, + EGL_NONE}; + const EGLint default_attribs[] = {EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE}; const EGLint* attribs = default_attribs; if (srgb_support_) { @@ -231,12 +224,14 @@ AndroidContextGL::AndroidContextGL(fxl::RefPtr env, AndroidContextGL::~AndroidContextGL() { if (!TeardownContext(environment_->Display(), context_)) { - FXL_LOG(ERROR) << "Could not tear down the EGL context. Possible resource leak."; + FXL_LOG(ERROR) + << "Could not tear down the EGL context. Possible resource leak."; LogLastEGLError(); } if (!TeardownSurface(environment_->Display(), surface_)) { - FXL_LOG(ERROR) << "Could not tear down the EGL surface. Possible resource leak."; + FXL_LOG(ERROR) + << "Could not tear down the EGL surface. Possible resource leak."; LogLastEGLError(); } } 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 d9672603e3..89f02f52cf 100644 --- a/engine/src/flutter/shell/platform/android/android_context_gl.h +++ b/engine/src/flutter/shell/platform/android/android_context_gl.h @@ -17,7 +17,6 @@ namespace shell { class AndroidContextGL : public fxl::RefCountedThreadSafe { public: - bool CreateWindowSurface(fxl::RefPtr window); bool CreatePBufferSurface(); 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 5c07aed74f..5b916b0ec3 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_software.cc +++ b/engine/src/flutter/shell/platform/android/android_surface_software.cc @@ -34,8 +34,7 @@ bool GetSkColorType(int32_t buffer_format, SkColorType* color_type) { } // anonymous namespace AndroidSurfaceSoftware::AndroidSurfaceSoftware() - : AndroidSurface(), - target_color_type_(kRGBA_8888_SkColorType) {} + : AndroidSurface(), target_color_type_(kRGBA_8888_SkColorType) {} AndroidSurfaceSoftware::~AndroidSurfaceSoftware() = default; @@ -102,20 +101,19 @@ bool AndroidSurfaceSoftware::PresentBackingStore( SkColorType color_type; if (GetSkColorType(native_buffer.format, &color_type)) { - SkImageInfo native_image_info = SkImageInfo::Make( - native_buffer.width, native_buffer.height, color_type, kPremul_SkAlphaType); + SkImageInfo native_image_info = + SkImageInfo::Make(native_buffer.width, native_buffer.height, color_type, + kPremul_SkAlphaType); std::unique_ptr canvas = SkCanvas::MakeRasterDirect( - native_image_info, - native_buffer.bits, + native_image_info, native_buffer.bits, native_buffer.stride * SkColorTypeBytesPerPixel(color_type)); if (canvas) { SkBitmap bitmap; if (bitmap.installPixels(pixmap)) { canvas->drawBitmapRect( - bitmap, - SkRect::MakeIWH(native_buffer.width, native_buffer.height), + bitmap, SkRect::MakeIWH(native_buffer.width, native_buffer.height), nullptr); } } 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 29bd09d748..478894e542 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.cc +++ b/engine/src/flutter/shell/platform/android/platform_view_android.cc @@ -115,19 +115,19 @@ static std::unique_ptr InitializePlatformSurface() { } if (auto surface = InitializePlatformSurfaceSoftware()) { - FXL_DLOG(INFO) << "Software surface initialized."; - return surface; + FXL_DLOG(INFO) << "Software surface initialized."; + return surface; } - FXL_CHECK(false) << "Could not initialize either the Vulkan, OpenGL, or Software" - "surface backends. Flutter requires a GPU to render."; + FXL_CHECK(false) + << "Could not initialize either the Vulkan, OpenGL, or Software" + "surface backends. Flutter requires a GPU to render."; return nullptr; } PlatformViewAndroid::PlatformViewAndroid() : PlatformView(std::make_unique(nullptr)), - android_surface_(InitializePlatformSurface()) { -} + android_surface_(InitializePlatformSurface()) {} PlatformViewAndroid::~PlatformViewAndroid() = default; @@ -141,14 +141,13 @@ void PlatformViewAndroid::Attach() { PostAddToShellTask(); - rasterizer_->AddNextFrameCallback( - [this]() { - JNIEnv* env = fml::jni::AttachCurrentThread(); - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); - if (!view.is_null()) { - FlutterViewOnFirstFrame(env, view.obj()); - } - }); + rasterizer_->AddNextFrameCallback([this]() { + JNIEnv* env = fml::jni::AttachCurrentThread(); + fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + if (!view.is_null()) { + FlutterViewOnFirstFrame(env, view.obj()); + } + }); } void PlatformViewAndroid::Detach() { 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 133bfd9c9e..c6d90e569c 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.h +++ b/engine/src/flutter/shell/platform/android/platform_view_android.h @@ -102,7 +102,6 @@ class PlatformViewAndroid : public PlatformView { android_surface_->SetFlutterView(flutter_view); } - private: const std::unique_ptr android_surface_; fml::jni::JavaObjectWeakGlobalRef flutter_view_; 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 5c0211d0aa..1335d0a471 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 @@ -11,7 +11,8 @@ #include "lib/fxl/arraysize.h" #include "lib/fxl/logging.h" -#define PLATFORM_VIEW (*reinterpret_cast*>(platform_view)) +#define PLATFORM_VIEW \ + (*reinterpret_cast*>(platform_view)) namespace shell { @@ -107,7 +108,7 @@ static void RunBundleAndSnapshot(JNIEnv* env, return PLATFORM_VIEW->RunBundleAndSnapshot( fml::jni::JavaStringToString(env, bundlePath), // fml::jni::JavaStringToString(env, snapshotOverride) // - ); + ); } void RunBundleAndSource(JNIEnv* env, 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 ab18b4cc75..7df245530f 100644 --- a/engine/src/flutter/shell/platform/android/vsync_waiter_android.cc +++ b/engine/src/flutter/shell/platform/android/vsync_waiter_android.cc @@ -41,12 +41,13 @@ void VsyncWaiterAndroid::OnVsync(int64_t frameTimeNanos, int64_t frameTargetTimeNanos) { Callback callback = std::move(callback_); callback_ = Callback(); - blink::Threads::UI()->PostTask([callback, frameTimeNanos, frameTargetTimeNanos] { - callback(fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTimeNanos)), - fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos))); - }); + blink::Threads::UI()->PostTask( + [callback, frameTimeNanos, frameTargetTimeNanos] { + callback(fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTimeNanos)), + fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos))); + }); } static void OnNativeVsync(JNIEnv* env, diff --git a/engine/src/flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h b/engine/src/flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h index d7226011c1..15f551f212 100644 --- a/engine/src/flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h +++ b/engine/src/flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h @@ -5,8 +5,8 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_VSYNC_WAITER_MAC_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_VSYNC_WAITER_MAC_H_ -#include "lib/fxl/macros.h" #include "flutter/shell/common/vsync_waiter.h" +#include "lib/fxl/macros.h" namespace shell { diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/Flutter.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/Flutter.h index f21d3f7075..a47e239bd8 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/Flutter.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/Flutter.h @@ -11,8 +11,8 @@ #include "FlutterCodecs.h" #include "FlutterDartProject.h" #include "FlutterMacros.h" +#include "FlutterNavigationController.h" #include "FlutterPlugin.h" #include "FlutterViewController.h" -#include "FlutterNavigationController.h" #endif // FLUTTER_FLUTTER_H_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h index 7084a02a53..a2ad15742f 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h @@ -24,8 +24,7 @@ * code as necessary from FlutterAppDelegate.mm. */ FLUTTER_EXPORT -@interface FlutterAppDelegate - : UIResponder +@interface FlutterAppDelegate : UIResponder @property(strong, nonatomic) UIWindow* window; @@ -33,7 +32,7 @@ FLUTTER_EXPORT // typically a FlutterViewController, for plugin interop. // // Defaults to window's rootViewController. -- (NSObject*) binaryMessenger; +- (NSObject*)binaryMessenger; @end diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterNavigationController.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterNavigationController.h index 207ab3c8b1..1ff0911bd6 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterNavigationController.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterNavigationController.h @@ -4,6 +4,6 @@ #import -@interface FlutterNavigationController: UINavigationController +@interface FlutterNavigationController : UINavigationController @end diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index ba011a89ad..ad52df61ec 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -160,9 +160,7 @@ options:(NSDictionary*)options { for (id plugin in _pluginDelegates) { if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - openURL:url - options:options]) { + if ([plugin application:application openURL:url options:options]) { return YES; } } diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterCodecs.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterCodecs.mm index 04b6079024..e49ec86aad 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterCodecs.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterCodecs.mm @@ -63,7 +63,7 @@ } else { // NSJSONSerialization does not support top-level simple values. // We encode as singleton array, then extract the relevant bytes. - encoding = [NSJSONSerialization dataWithJSONObject:@[message] options:0 error:nil]; + encoding = [NSJSONSerialization dataWithJSONObject:@[ message ] options:0 error:nil]; if (encoding) { encoding = [encoding subdataWithRange:NSMakeRange(1, encoding.length - 2)]; } @@ -96,7 +96,7 @@ decoded = [NSJSONSerialization JSONObjectWithData:message options:0 error:nil]; } NSAssert(decoded, @"Invalid JSON message, decoding failed"); - return isSimpleValue ? ((NSArray*) decoded)[0] : decoded; + return isSimpleValue ? ((NSArray*)decoded)[0] : decoded; } @end @@ -117,7 +117,7 @@ } - (NSData*)encodeSuccessEnvelope:(id)result { - return [[FlutterJSONMessageCodec sharedInstance] encode:@[[self wrapNil:result]]]; + return [[FlutterJSONMessageCodec sharedInstance] encode:@[ [self wrapNil:result] ]]; } - (NSData*)encodeErrorEnvelope:(FlutterError*)error { 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 ca056955c0..a3230beb32 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 @@ -182,11 +182,11 @@ static NSString* NSStringFromVMType(VMType type) { if (_vmTypeRequirement != embedderVMType) { NSString* message = - [NSString stringWithFormat:@"Could not load the project because of differing project type. " - @"The project can run in '%@' but the embedder is configured as " - @"'%@'", - NSStringFromVMType(_vmTypeRequirement), - NSStringFromVMType(embedderVMType)]; + [NSString stringWithFormat: + @"Could not load the project because of differing project type. " + @"The project can run in '%@' but the embedder is configured as " + @"'%@'", + NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)]; result(NO, message); return; } @@ -218,9 +218,10 @@ static NSString* NSStringFromVMType(VMType type) { NSString* path = [self pathForFLXFromBundle:_precompiledDartBundle]; if (path.length == 0) { - NSString* message = [NSString stringWithFormat:@"Could not find the 'app.flx' archive in " - @"the precompiled Dart bundle with ID '%@'", - _precompiledDartBundle.bundleIdentifier]; + NSString* message = [NSString stringWithFormat: + @"Could not find the 'app.flx' archive in " + @"the precompiled Dart bundle with ID '%@'", + _precompiledDartBundle.bundleIdentifier]; result(NO, message); return; } diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterNavigationController.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterNavigationController.mm index 4c0fc19189..2ca2978a54 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterNavigationController.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterNavigationController.mm @@ -6,7 +6,7 @@ @implementation FlutterNavigationController -- (void) viewWillAppear:(BOOL)animated { +- (void)viewWillAppear:(BOOL)animated { [self setNavigationBarHidden:YES]; [super viewWillAppear:animated]; } 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 9fdcf63347..c9b3ff9433 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 @@ -156,7 +156,7 @@ using namespace shell; // in the navigation hierarchy. UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController; if ([viewController isKindOfClass:[UINavigationController class]]) { - [((UINavigationController*)viewController) popViewControllerAnimated:NO]; + [((UINavigationController*)viewController) popViewControllerAnimated:NO]; } } @@ -170,7 +170,6 @@ using namespace shell; return nil; } - - (void)setClipboardData:(NSDictionary*)data { UIPasteboard* pasteboard = [UIPasteboard generalPasteboard]; pasteboard.string = data[@"text"]; 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 abda71d42d..ca76e88327 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 @@ -127,8 +127,8 @@ class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { _orientationPreferences = UIInterfaceOrientationMaskAll; _statusBarStyle = UIStatusBarStyleDefault; - _platformView = std::make_shared( - reinterpret_cast(self.view.layer)); + _platformView = + std::make_shared(reinterpret_cast(self.view.layer)); _platformView->Attach( // First frame callback. @@ -136,11 +136,13 @@ class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { TRACE_EVENT0("flutter", "First Frame"); if (_launchView) { [UIView animateWithDuration:0.2 - animations:^{ _launchView.get().alpha = 0; } - completion:^(BOOL finished){ - [_launchView.get() removeFromSuperview]; - _launchView.reset(); - }]; + animations:^{ + _launchView.get().alpha = 0; + } + completion:^(BOOL finished) { + [_launchView.get() removeFromSuperview]; + _launchView.reset(); + }]; } }); _platformView->SetupResourceContextOnIOThread(); @@ -298,8 +300,8 @@ class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UILaunchStoryboardName"]; if (launchStoryboardName && !self.isBeingPresented && !self.isMovingToParentViewController) { UIViewController* launchViewController = - [[UIStoryboard storyboardWithName:launchStoryboardName - bundle:nil] instantiateInitialViewController]; + [[UIStoryboard storyboardWithName:launchStoryboardName bundle:nil] + instantiateInitialViewController]; _launchView.reset([launchViewController.view retain]); _launchView.get().frame = self.view.bounds; _launchView.get().autoresizingMask = 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 2a914ec876..574662d5f4 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 @@ -55,7 +55,8 @@ class AccessibilityBridge final { private: SemanticsObject* GetOrCreateObject(int32_t id); - void VisitObjectsRecursivelyAndRemove(SemanticsObject* object, NSMutableArray* doomed_uids); + void VisitObjectsRecursivelyAndRemove(SemanticsObject* object, + NSMutableArray* doomed_uids); void ReleaseObjects(std::unordered_map& objects); UIView* view_; diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/flutter_codecs_unittest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/flutter_codecs_unittest.mm index cc311b10ba..b94793d39e 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/flutter_codecs_unittest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/flutter_codecs_unittest.mm @@ -48,7 +48,7 @@ TEST(FlutterJSONCodec, CanEncodeAndDecodeNil) { } TEST(FlutterJSONCodec, CanEncodeAndDecodeArray) { - NSArray* value = @[ [NSNull null], @"hello", @3.14, @47, @{ @"a" : @"nested" } ]; + NSArray* value = @[ [NSNull null], @"hello", @3.14, @47, @{@"a" : @"nested"} ]; FlutterJSONMessageCodec* codec = [FlutterJSONMessageCodec sharedInstance]; NSData* encoded = [codec encode:value]; NSArray* decoded = [codec decode:encoded]; 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 423d462b71..cfa91c0477 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 @@ -20,10 +20,12 @@ class PlatformMessageRouter { void HandlePlatformMessage(fxl::RefPtr message); - void SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler); + void SetMessageHandler(const std::string& channel, + FlutterBinaryMessageHandler handler); private: - std::unordered_map message_handlers_; + std::unordered_map + message_handlers_; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageRouter); }; 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 091d9eb82e..263031ca91 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 @@ -34,9 +34,7 @@ class IOSGLContext { bool ResourceMakeCurrent(); - sk_sp ColorSpace() const { - return color_space_; - } + sk_sp ColorSpace() const { return color_space_; } private: fml::scoped_nsobject layer_; 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 0d5b7a0180..dc018a0eb5 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 @@ -106,19 +106,16 @@ IOSGLContext::IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* laye // should use iOS APIs to perform the final correction step based on the // device properties. Ex: We can indicate that we have rendered in P3, and // the framework will do the final adjustment for us. - NSOperatingSystemVersion version = [[NSProcessInfo processInfo] - operatingSystemVersion]; + NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; color_space_ = SkColorSpace::MakeSRGB(); if (version.majorVersion >= 10) { - UIDisplayGamut displayGamut = - [UIScreen mainScreen].traitCollection.displayGamut; + UIDisplayGamut displayGamut = [UIScreen mainScreen].traitCollection.displayGamut; switch (displayGamut) { case UIDisplayGamutP3: // Should we consider using more than 8-bits of precision given that // P3 specifies a wider range of colors? - color_space_ = SkColorSpace::MakeRGB( - SkColorSpace::kSRGB_RenderTargetGamma, - SkColorSpace::kDCIP3_D65_Gamut); + color_space_ = SkColorSpace::MakeRGB(SkColorSpace::kSRGB_RenderTargetGamma, + SkColorSpace::kDCIP3_D65_Gamut); break; default: break; @@ -154,7 +151,8 @@ bool IOSGLContext::IsValid() const { bool IOSGLContext::PresentRenderBuffer() const { const GLenum discards[] = { - GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT, + GL_DEPTH_ATTACHMENT, + GL_STENCIL_ATTACHMENT, }; glDiscardFramebufferEXT(GL_FRAMEBUFFER, sizeof(discards) / sizeof(GLenum), discards); 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 be830484cc..06dc2c0bec 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 @@ -63,8 +63,7 @@ sk_sp IOSSurfaceSoftware::AcquireBackingStore(const SkISize& size) { return sk_surface_; } - SkImageInfo info = SkImageInfo::MakeS32(size.fWidth, size.fHeight, - kPremul_SkAlphaType); + SkImageInfo info = SkImageInfo::MakeS32(size.fWidth, size.fHeight, kPremul_SkAlphaType); sk_surface_ = SkSurface::MakeRaster(info, nullptr); return sk_surface_; } 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 b4d574d0dc..56c22b5ce3 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 @@ -20,8 +20,7 @@ namespace shell { PlatformViewIOS::PlatformViewIOS(CALayer* layer) : PlatformView(std::make_unique(std::make_unique())), ios_surface_(IOSSurface::Create(surface_config_, layer)), - weak_factory_(this) { -} + weak_factory_(this) {} PlatformViewIOS::~PlatformViewIOS() = default; diff --git a/engine/src/flutter/shell/testing/platform_view_test.cc b/engine/src/flutter/shell/testing/platform_view_test.cc index 14d731d9e1..04fb1943d7 100644 --- a/engine/src/flutter/shell/testing/platform_view_test.cc +++ b/engine/src/flutter/shell/testing/platform_view_test.cc @@ -10,8 +10,7 @@ namespace shell { PlatformViewTest::PlatformViewTest() - : PlatformView(std::unique_ptr(new NullRasterizer())) { -} + : PlatformView(std::unique_ptr(new NullRasterizer())) {} void PlatformViewTest::Attach() { CreateEngine(); diff --git a/engine/src/flutter/shell/testing/test_runner.cc b/engine/src/flutter/shell/testing/test_runner.cc index 43ff4821ec..838b04120c 100644 --- a/engine/src/flutter/shell/testing/test_runner.cc +++ b/engine/src/flutter/shell/testing/test_runner.cc @@ -13,12 +13,13 @@ namespace shell { -TestRunner::TestRunner() : platform_view_(std::make_shared()) { +TestRunner::TestRunner() + : platform_view_(std::make_shared()) { platform_view_->Attach(); blink::ViewportMetrics metrics; metrics.device_pixel_ratio = 3.0; - metrics.physical_width = 2400; // 800 at 3x resolution - metrics.physical_height = 1800; // 600 at 3x resolution + metrics.physical_width = 2400; // 800 at 3x resolution + metrics.physical_height = 1800; // 600 at 3x resolution blink::Threads::UI()->PostTask( [ engine = platform_view_->engine().GetWeakPtr(), metrics ] { diff --git a/engine/src/flutter/sky/packages/sky_engine/LICENSE b/engine/src/flutter/sky/packages/sky_engine/LICENSE index 9044e74286..6f57bfd364 100644 --- a/engine/src/flutter/sky/packages/sky_engine/LICENSE +++ b/engine/src/flutter/sky/packages/sky_engine/LICENSE @@ -2798,7 +2798,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine -Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. +Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. +All rights reserved. Copyright (C) 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -3138,7 +3139,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine -Copyright (C) 2003, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights reserved. +Copyright (C) 2003, 2006, 2008, 2009, 2010, 2012 Apple Inc. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -3370,7 +3372,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine -Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights reserved. +Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All +rights reserved. Copyright (C) 2005 Alexey Proskuryakov. Redistribution and use in source and binary forms, with or without @@ -4340,7 +4343,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine -Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. +Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -5404,7 +5408,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine -Copyright (C) 2008, 2009 Paul Pedriana . All rights reserved. +Copyright (C) 2008, 2009 Paul Pedriana . +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -6121,16 +6126,16 @@ are met: notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine @@ -6299,16 +6304,17 @@ are met: notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. -------------------------------------------------------------------------------- engine @@ -6721,16 +6727,16 @@ are met: notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine @@ -6825,16 +6831,16 @@ are met: notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine @@ -7040,16 +7046,16 @@ are met: notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine @@ -7185,16 +7191,16 @@ are met: notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine @@ -7234,16 +7240,16 @@ are met: notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine @@ -7258,16 +7264,16 @@ are met: notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES,:tabnew INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES,:tabnew INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine @@ -7302,7 +7308,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. engine Copyright (c) 1991, 2000, 2001 by Lucent Technologies. -Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. All rights reserved. +Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. +All rights reserved. Permission to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice @@ -7319,7 +7326,8 @@ engine Copyright (c) 2005, 2007, Google Inc. All rights reserved. -Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. +Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -8012,36 +8020,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine -Copyright 2013 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - Copyright 2017 The Flutter Authors. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -8556,6 +8534,37 @@ That's all there is to it! -------------------------------------------------------------------------------- engine garnet + +Copyright 2013 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet icu Copyright 2014 The Chromium Authors. All rights reserved. @@ -8607,6 +8616,39 @@ distribution. contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +icu +skia + +Copyright 2016 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -9189,38 +9231,6 @@ necessary. Here is a sample; alter the names: That's all there is to it! -------------------------------------------------------------------------------- -engine -icu -skia - -Copyright 2016 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- etc1 observatory_pub_packages skia diff --git a/engine/src/flutter/synchronization/semaphore.h b/engine/src/flutter/synchronization/semaphore.h index ca8c603098..bb35957e58 100644 --- a/engine/src/flutter/synchronization/semaphore.h +++ b/engine/src/flutter/synchronization/semaphore.h @@ -7,9 +7,9 @@ #include +#include "lib/fxl/compiler_specific.h" #include "lib/fxl/macros.h" #include "lib/fxl/time/time_delta.h" -#include "lib/fxl/compiler_specific.h" namespace flutter { diff --git a/engine/src/flutter/third_party/txt/src/txt/asset_font_manager.cc b/engine/src/flutter/third_party/txt/src/txt/asset_font_manager.cc index 698016b5c0..aadf7e44ec 100644 --- a/engine/src/flutter/third_party/txt/src/txt/asset_font_manager.cc +++ b/engine/src/flutter/third_party/txt/src/txt/asset_font_manager.cc @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "lib/fxl/logging.h" #include "txt/asset_font_manager.h" +#include "lib/fxl/logging.h" namespace txt { diff --git a/engine/src/flutter/third_party/txt/src/txt/directory_asset_data_provider.cc b/engine/src/flutter/third_party/txt/src/txt/directory_asset_data_provider.cc index 3141fa7374..c824769789 100644 --- a/engine/src/flutter/third_party/txt/src/txt/directory_asset_data_provider.cc +++ b/engine/src/flutter/third_party/txt/src/txt/directory_asset_data_provider.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "txt/directory_asset_data_provider.h" #include #include #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkTypeface.h" -#include "txt/directory_asset_data_provider.h" namespace txt { diff --git a/engine/src/flutter/third_party/txt/src/txt/paragraph.cc b/engine/src/flutter/third_party/txt/src/txt/paragraph.cc index 9b54aaceb1..b95e967eb3 100644 --- a/engine/src/flutter/third_party/txt/src/txt/paragraph.cc +++ b/engine/src/flutter/third_party/txt/src/txt/paragraph.cc @@ -350,15 +350,14 @@ void Paragraph::Layout(double width, bool force) { (lines_ == max_lines - 1 || max_lines == std::numeric_limits::max())) { float ellipsis_width = layout.measureText( - reinterpret_cast(ellipsis.data()), - 0, ellipsis.length(), ellipsis.length(), bidiFlags, - font, minikin_paint, minikin_font_collection, nullptr); + reinterpret_cast(ellipsis.data()), 0, + ellipsis.length(), ellipsis.length(), bidiFlags, font, + minikin_paint, minikin_font_collection, nullptr); std::vector text_advances(text_count); float text_width = layout.measureText( - text.data() + layout_start, 0, text_count, text_count, - bidiFlags, font, minikin_paint, minikin_font_collection, - text_advances.data()); + text.data() + layout_start, 0, text_count, text_count, bidiFlags, + font, minikin_paint, minikin_font_collection, text_advances.data()); // Truncate characters from the text until the ellipsis fits. size_t truncate_count = 0; @@ -368,12 +367,13 @@ void Paragraph::Layout(double width, bool force) { truncate_count++; } - ellipsized_text.reserve(text_count - truncate_count + ellipsis.length()); + ellipsized_text.reserve(text_count - truncate_count + + ellipsis.length()); ellipsized_text.insert(ellipsized_text.begin(), text.begin() + layout_start, text.begin() + layout_end - truncate_count); - ellipsized_text.insert(ellipsized_text.end(), - ellipsis.begin(), ellipsis.end()); + ellipsized_text.insert(ellipsized_text.end(), ellipsis.begin(), + ellipsis.end()); text_ptr = ellipsized_text.data(); text_count = ellipsized_text.size(); @@ -388,8 +388,8 @@ void Paragraph::Layout(double width, bool force) { // However, this is not significant for reasonably sized paragraphs. It is // currently recommended to break up very long paragraphs (10k+ // characters) to ensure speedy layout. - layout.doLayout(text_ptr, 0, text_count, text_count, - bidiFlags, font, minikin_paint, minikin_font_collection); + layout.doLayout(text_ptr, 0, text_count, text_count, bidiFlags, font, + minikin_paint, minikin_font_collection); FillWhitespaceSet(layout_start, layout_end, minikin::getHbFontLocked(layout.getFont(0))); diff --git a/engine/src/flutter/third_party/txt/tests/CmapCoverageTest.cpp b/engine/src/flutter/third_party/txt/tests/CmapCoverageTest.cpp index 2d046a38af..f32c76653d 100644 --- a/engine/src/flutter/third_party/txt/tests/CmapCoverageTest.cpp +++ b/engine/src/flutter/third_party/txt/tests/CmapCoverageTest.cpp @@ -49,7 +49,8 @@ static std::vector buildCmapFormat4Table( uint16_t segmentCount = ranges.size() / 2 + 1 /* +1 for end marker */; const size_t numOfUint16 = - 8 /* format, length, languages, segCountX2, searchRange, entrySelector, rangeShift, pad */ + 8 /* format, length, languages, segCountX2, searchRange, entrySelector, + rangeShift, pad */ + segmentCount * 4 /* endCount, startCount, idRange, idRangeOffset */; const size_t finalLength = sizeof(uint16_t) * numOfUint16; diff --git a/engine/src/flutter/third_party/txt/tests/GraphemeBreakTests.cpp b/engine/src/flutter/third_party/txt/tests/GraphemeBreakTests.cpp index 8f42a02ecf..a31a0d90f6 100644 --- a/engine/src/flutter/third_party/txt/tests/GraphemeBreakTests.cpp +++ b/engine/src/flutter/third_party/txt/tests/GraphemeBreakTests.cpp @@ -145,7 +145,7 @@ TEST(GraphemeBreak, rules) { EXPECT_FALSE(IsBreak("'a' | U+0301")); // combining accent // TODO(jsimmons): re-enable this test when ICU has been updated in all // Flutter platforms. - //EXPECT_FALSE(IsBreak("'a' | U+200D")); // ZWJ + // EXPECT_FALSE(IsBreak("'a' | U+200D")); // ZWJ // Rule GB9a, x SpacingMark EXPECT_FALSE(IsBreak("U+0915 | U+093E")); // KA, AA (spacing mark) // Rule GB9b, Prepend x diff --git a/engine/src/flutter/tools/licenses/lib/patterns.dart b/engine/src/flutter/tools/licenses/lib/patterns.dart index 18fb416662..1f6be57254 100644 --- a/engine/src/flutter/tools/licenses/lib/patterns.dart +++ b/engine/src/flutter/tools/licenses/lib/patterns.dart @@ -102,7 +102,7 @@ final List copyrightStatementPatterns = [ new RegExp(r'[-_a-zA-Z0-9()]+ function provided freely by .+'), // TODO(ianh): file a bug on analyzer about what happens if you omit this comma new RegExp(r'^.+ optimized code \(C\) COPYRIGHT .+$', caseSensitive: false), new RegExp(r'^\(Royal Institute of Technology, Stockholm, Sweden\)\.$'), - new RegExp(r'^https?://[^ ]+$'), + new RegExp(r'^\(?https?://[^ ]+$\)?'), new RegExp(r'^The Original Code is Mozilla Communicator client code, released$'), new RegExp(r'^March 31, 1998.$'), // mozilla first release date @@ -1034,7 +1034,7 @@ final List csReferencesByUrl =