diff --git a/engine/src/flutter/.clang-tidy b/engine/src/flutter/.clang-tidy index 0e68ce7e4b3..1a7583a5dd4 100644 --- a/engine/src/flutter/.clang-tidy +++ b/engine/src/flutter/.clang-tidy @@ -2,6 +2,7 @@ # Prefix check with "-" to ignore. Checks: >- + bugprone-argument-comment, bugprone-use-after-move, bugprone-unchecked-optional-access, clang-analyzer-*, diff --git a/engine/src/flutter/flow/stopwatch_dl.cc b/engine/src/flutter/flow/stopwatch_dl.cc index e341e6cccc5..8c20b035e53 100644 --- a/engine/src/flutter/flow/stopwatch_dl.cc +++ b/engine/src/flutter/flow/stopwatch_dl.cc @@ -50,10 +50,10 @@ void DlStopwatchVisualizer::Visualize(DlCanvas* canvas, auto const bar_height = height * sample_unit_height; auto const bar_left = x + width * sample_unit_width * i; - painter.DrawRect(SkRect::MakeLTRB(/*left=*/bar_left, - /*top=*/y + bar_height, - /*right=*/bar_left + bar_width, - /*bottom=*/bottom), + painter.DrawRect(SkRect::MakeLTRB(/*l=*/bar_left, + /*t=*/y + bar_height, + /*r=*/bar_left + bar_width, + /*b=*/bottom), DlColor(0xAA0000FF)); } } @@ -75,10 +75,10 @@ void DlStopwatchVisualizer::Visualize(DlCanvas* canvas, max_unit_interval); // Draw a skinny rectangle (i.e. a line). - painter.DrawRect(SkRect::MakeLTRB(/*left=*/x, - /*top=*/y + frame_height, - /*right=*/width, - /*bottom=*/y + frame_height + 1), + painter.DrawRect(SkRect::MakeLTRB(/*l=*/x, + /*t=*/y + frame_height, + /*r=*/width, + /*b=*/y + frame_height + 1), DlColor(0xCC000000)); } } diff --git a/engine/src/flutter/impeller/entity/contents/filters/filter_contents.cc b/engine/src/flutter/impeller/entity/contents/filters/filter_contents.cc index 57653b10b73..c5e2ae2dc94 100644 --- a/engine/src/flutter/impeller/entity/contents/filters/filter_contents.cc +++ b/engine/src/flutter/impeller/entity/contents/filters/filter_contents.cc @@ -55,11 +55,22 @@ std::shared_ptr FilterContents::MakeGaussianBlur( Sigma sigma_y, BlurStyle blur_style, Entity::TileMode tile_mode) { - auto x_blur = MakeDirectionalGaussianBlur( - input, sigma_x, Point(1, 0), BlurStyle::kNormal, tile_mode, false, {}); - auto y_blur = MakeDirectionalGaussianBlur(FilterInput::Make(x_blur), sigma_y, - Point(0, 1), blur_style, tile_mode, - true, sigma_x); + std::shared_ptr x_blur = MakeDirectionalGaussianBlur( + /*input=*/input, + /*sigma=*/sigma_x, + /*direction=*/Point(1, 0), + /*blur_style=*/BlurStyle::kNormal, + /*tile_mode=*/tile_mode, + /*is_second_pass=*/false, + /*secondary_sigma=*/{}); + std::shared_ptr y_blur = MakeDirectionalGaussianBlur( + /*input=*/FilterInput::Make(x_blur), + /*sigma=*/sigma_y, + /*direction=*/Point(0, 1), + /*blur_style=*/blur_style, + /*tile_mode=*/tile_mode, + /*is_second_pass=*/true, + /*secondary_sigma=*/sigma_x); return y_blur; } diff --git a/engine/src/flutter/shell/common/shell.cc b/engine/src/flutter/shell/common/shell.cc index 731cdcc19d1..b6318c45d99 100644 --- a/engine/src/flutter/shell/common/shell.cc +++ b/engine/src/flutter/shell/common/shell.cc @@ -177,16 +177,16 @@ std::unique_ptr Shell::Create( auto resource_cache_limit_calculator = std::make_shared( settings.resource_cache_max_bytes_threshold); - return CreateWithSnapshot(platform_data, // - task_runners, // - /*parent_merger=*/nullptr, // - /*parent_io_manager=*/nullptr, // - resource_cache_limit_calculator, // - settings, // - std::move(vm), // - std::move(isolate_snapshot), // - on_create_platform_view, // - on_create_rasterizer, // + return CreateWithSnapshot(platform_data, // + task_runners, // + /*parent_thread_merger=*/nullptr, // + /*parent_io_manager=*/nullptr, // + resource_cache_limit_calculator, // + settings, // + std::move(vm), // + std::move(isolate_snapshot), // + on_create_platform_view, // + on_create_rasterizer, // CreateEngine, is_gpu_disabled); } diff --git a/engine/src/flutter/shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.mm b/engine/src/flutter/shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.mm index 55ca7cb9064..79a7eadff3d 100644 --- a/engine/src/flutter/shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.mm +++ b/engine/src/flutter/shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.mm @@ -297,7 +297,7 @@ FLUTTER_ASSERT_ARC skiaBackendTextures[0] = GrBackendTexture(/*width=*/width, /*height=*/height, /*mipMapped=*/skgpu::Mipmapped::kNo, - /*textureInfo=*/ySkiaTextureInfo); + /*mtlInfo=*/ySkiaTextureInfo); GrMtlTextureInfo uvSkiaTextureInfo; uvSkiaTextureInfo.fTexture = sk_cfp{(__bridge_retained const void*)uvTex}; @@ -305,7 +305,7 @@ FLUTTER_ASSERT_ARC skiaBackendTextures[1] = GrBackendTexture(/*width=*/width, /*height=*/height, /*mipMapped=*/skgpu::Mipmapped::kNo, - /*textureInfo=*/uvSkiaTextureInfo); + /*mtlInfo=*/uvSkiaTextureInfo); SkYUVAInfo yuvaInfo(skiaBackendTextures[0].dimensions(), SkYUVAInfo::PlaneConfig::kY_UV, SkYUVAInfo::Subsampling::k444, colorSpace); GrYUVABackendTextures yuvaBackendTextures(yuvaInfo, skiaBackendTextures, @@ -326,11 +326,11 @@ FLUTTER_ASSERT_ARC GrBackendTexture skiaBackendTexture(/*width=*/width, /*height=*/height, /*mipMapped=*/skgpu::Mipmapped ::kNo, - /*textureInfo=*/skiaTextureInfo); + /*mtlInfo=*/skiaTextureInfo); return SkImages::BorrowTextureFrom(grContext, skiaBackendTexture, kTopLeft_GrSurfaceOrigin, kBGRA_8888_SkColorType, kPremul_SkAlphaType, - /*imageColorSpace=*/nullptr, /*releaseProc*/ nullptr, + /*colorSpace=*/nullptr, /*releaseProc*/ nullptr, /*releaseContext*/ nullptr); } @end diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm index 6c3bcd9ccda..c0a77072835 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm @@ -681,7 +681,7 @@ bool FlutterPlatformViewsController::SubmitFrame(GrDirectContext* gr_context, // Clipping the background canvas before drawing the picture recorders requires // saving and restoring the clip context. - DlAutoCanvasRestore save(background_canvas, /*doSave=*/true); + DlAutoCanvasRestore save(background_canvas, /*do_save=*/true); // Maps a platform view id to a vector of `FlutterPlatformViewLayer`. LayersMap platform_view_layers; 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 c3223766d4c..7170bc1d4f4 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 @@ -2398,7 +2398,7 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch) // Only send the event if it occured before the expected natural end of gesture momentum. // If received after the deadline, it's not likely the event is from a user-initiated cancel. auto packet = std::make_unique(1); - packet->SetPointerData(/*index=*/0, pointer_data); + packet->SetPointerData(/*i=*/0, pointer_data); [_engine.get() dispatchPointerDataPacket:std::move(packet)]; _scrollInertiaEventAppKitDeadline = 0; } @@ -2449,17 +2449,17 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch) // is received with the same position as the previous one, it can only be from a finger // making or breaking contact with the trackpad surface. auto packet = std::make_unique(2); - packet->SetPointerData(/*index=*/0, pointer_data); + packet->SetPointerData(/*i=*/0, pointer_data); flutter::PointerData inertia_cancel = pointer_data; inertia_cancel.device = reinterpret_cast(_continuousScrollingPanGestureRecognizer); inertia_cancel.kind = flutter::PointerData::DeviceKind::kTrackpad; inertia_cancel.signal_kind = flutter::PointerData::SignalKind::kScrollInertiaCancel; - packet->SetPointerData(/*index=*/1, inertia_cancel); + packet->SetPointerData(/*i=*/1, inertia_cancel); [_engine.get() dispatchPointerDataPacket:std::move(packet)]; _scrollInertiaEventStartline = DBL_MAX; } else { auto packet = std::make_unique(1); - packet->SetPointerData(/*index=*/0, pointer_data); + packet->SetPointerData(/*i=*/0, pointer_data); [_engine.get() dispatchPointerDataPacket:std::move(packet)]; } } @@ -2489,7 +2489,7 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch) } auto packet = std::make_unique(1); - packet->SetPointerData(/*index=*/0, pointer_data); + packet->SetPointerData(/*i=*/0, pointer_data); [_engine.get() dispatchPointerDataPacket:std::move(packet)]; } @@ -2540,7 +2540,7 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch) } auto packet = std::make_unique(1); - packet->SetPointerData(/*index=*/0, pointer_data); + packet->SetPointerData(/*i=*/0, pointer_data); [_engine.get() dispatchPointerDataPacket:std::move(packet)]; } @@ -2569,7 +2569,7 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch) } auto packet = std::make_unique(1); - packet->SetPointerData(/*index=*/0, pointer_data); + packet->SetPointerData(/*i=*/0, pointer_data); [_engine.get() dispatchPointerDataPacket:std::move(packet)]; } diff --git a/engine/src/flutter/shell/platform/embedder/embedder.cc b/engine/src/flutter/shell/platform/embedder/embedder.cc index e0f43d860c6..24fbb0b92af 100644 --- a/engine/src/flutter/shell/platform/embedder/embedder.cc +++ b/engine/src/flutter/shell/platform/embedder/embedder.cc @@ -2728,7 +2728,7 @@ FlutterEngineResult FlutterEngineReloadSystemFonts( void FlutterEngineTraceEventDurationBegin(const char* name) { fml::tracing::TraceEvent0("flutter", name, /*flow_id_count=*/0, - /*flow_id=*/nullptr); + /*flow_ids=*/nullptr); } void FlutterEngineTraceEventDurationEnd(const char* name) { @@ -2737,7 +2737,7 @@ void FlutterEngineTraceEventDurationEnd(const char* name) { void FlutterEngineTraceEventInstant(const char* name) { fml::tracing::TraceEventInstant0("flutter", name, /*flow_id_count=*/0, - /*flow_id=*/nullptr); + /*flow_ids=*/nullptr); } FlutterEngineResult FlutterEnginePostRenderThreadTask(