mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Adds lint for checking argument commments (flutter/engine#47305)
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
parent
135b013a77
commit
2b28dc130d
@ -2,6 +2,7 @@
|
||||
|
||||
# Prefix check with "-" to ignore.
|
||||
Checks: >-
|
||||
bugprone-argument-comment,
|
||||
bugprone-use-after-move,
|
||||
bugprone-unchecked-optional-access,
|
||||
clang-analyzer-*,
|
||||
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,11 +55,22 @@ std::shared_ptr<FilterContents> 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<FilterContents> 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<FilterContents> 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;
|
||||
}
|
||||
|
||||
|
||||
@ -177,16 +177,16 @@ std::unique_ptr<Shell> Shell::Create(
|
||||
auto resource_cache_limit_calculator =
|
||||
std::make_shared<ResourceCacheLimitCalculator>(
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<const void*>{(__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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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<flutter::PointerDataPacket>(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<flutter::PointerDataPacket>(2);
|
||||
packet->SetPointerData(/*index=*/0, pointer_data);
|
||||
packet->SetPointerData(/*i=*/0, pointer_data);
|
||||
flutter::PointerData inertia_cancel = pointer_data;
|
||||
inertia_cancel.device = reinterpret_cast<int64_t>(_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<flutter::PointerDataPacket>(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<flutter::PointerDataPacket>(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<flutter::PointerDataPacket>(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<flutter::PointerDataPacket>(1);
|
||||
packet->SetPointerData(/*index=*/0, pointer_data);
|
||||
packet->SetPointerData(/*i=*/0, pointer_data);
|
||||
[_engine.get() dispatchPointerDataPacket:std::move(packet)];
|
||||
}
|
||||
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user