diff --git a/.clang-tidy b/.clang-tidy index 0e68ce7e4b3c1..1a7583a5dd4f9 100644 --- a/.clang-tidy +++ b/.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/flow/stopwatch_dl.cc b/flow/stopwatch_dl.cc index e341e6cccc568..8c20b035e5372 100644 --- a/flow/stopwatch_dl.cc +++ b/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/impeller/entity/contents/filters/filter_contents.cc b/impeller/entity/contents/filters/filter_contents.cc index 57653b10b739f..c5e2ae2dc940e 100644 --- a/impeller/entity/contents/filters/filter_contents.cc +++ b/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/shell/common/shell.cc b/shell/common/shell.cc index 731cdcc19d137..b6318c45d9943 100644 --- a/shell/common/shell.cc +++ b/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/shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.mm b/shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.mm index 55ca7cb906408..79a7eadff3de6 100644 --- a/shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.mm +++ b/shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.mm @@ -297,7 +297,7 @@ @implementation FlutterDarwinExternalTextureSkImageWrapper 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 @@ @implementation FlutterDarwinExternalTextureSkImageWrapper 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 @@ GrYUVABackendTextures yuvaBackendTextures(yuvaInfo, skiaBackendTextures, 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/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm index 6c3bcd9ccdaab..c0a7707283570 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm @@ -681,7 +681,7 @@ static bool ClipRRectContainsPlatformViewBoundingRect(const SkRRect& clip_rrect, // 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/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index c3223766d4c01..7170bc1d4f4cd 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -2398,7 +2398,7 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer // 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 @@ - (void)hoverEvent:(UIPanGestureRecognizer*)recognizer API_AVAILABLE(ios(13.4)) // 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 @@ - (void)discreteScrollEvent:(UIPanGestureRecognizer*)recognizer API_AVAILABLE(io } 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 @@ - (void)continuousScrollEvent:(UIPanGestureRecognizer*)recognizer API_AVAILABLE( } 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 @@ - (void)pinchEvent:(UIPinchGestureRecognizer*)recognizer API_AVAILABLE(ios(13.4) } 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/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index e0f43d860c6d5..24fbb0b92afe9 100644 --- a/shell/platform/embedder/embedder.cc +++ b/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(