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:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Prefix check with "-" to ignore.
|
# Prefix check with "-" to ignore.
|
||||||
Checks: >-
|
Checks: >-
|
||||||
|
bugprone-argument-comment,
|
||||||
bugprone-use-after-move,
|
bugprone-use-after-move,
|
||||||
bugprone-unchecked-optional-access,
|
bugprone-unchecked-optional-access,
|
||||||
clang-analyzer-*,
|
clang-analyzer-*,
|
||||||
|
|||||||
@@ -50,10 +50,10 @@ void DlStopwatchVisualizer::Visualize(DlCanvas* canvas,
|
|||||||
auto const bar_height = height * sample_unit_height;
|
auto const bar_height = height * sample_unit_height;
|
||||||
auto const bar_left = x + width * sample_unit_width * i;
|
auto const bar_left = x + width * sample_unit_width * i;
|
||||||
|
|
||||||
painter.DrawRect(SkRect::MakeLTRB(/*left=*/bar_left,
|
painter.DrawRect(SkRect::MakeLTRB(/*l=*/bar_left,
|
||||||
/*top=*/y + bar_height,
|
/*t=*/y + bar_height,
|
||||||
/*right=*/bar_left + bar_width,
|
/*r=*/bar_left + bar_width,
|
||||||
/*bottom=*/bottom),
|
/*b=*/bottom),
|
||||||
DlColor(0xAA0000FF));
|
DlColor(0xAA0000FF));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,10 +75,10 @@ void DlStopwatchVisualizer::Visualize(DlCanvas* canvas,
|
|||||||
max_unit_interval);
|
max_unit_interval);
|
||||||
|
|
||||||
// Draw a skinny rectangle (i.e. a line).
|
// Draw a skinny rectangle (i.e. a line).
|
||||||
painter.DrawRect(SkRect::MakeLTRB(/*left=*/x,
|
painter.DrawRect(SkRect::MakeLTRB(/*l=*/x,
|
||||||
/*top=*/y + frame_height,
|
/*t=*/y + frame_height,
|
||||||
/*right=*/width,
|
/*r=*/width,
|
||||||
/*bottom=*/y + frame_height + 1),
|
/*b=*/y + frame_height + 1),
|
||||||
DlColor(0xCC000000));
|
DlColor(0xCC000000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,11 +55,22 @@ std::shared_ptr<FilterContents> FilterContents::MakeGaussianBlur(
|
|||||||
Sigma sigma_y,
|
Sigma sigma_y,
|
||||||
BlurStyle blur_style,
|
BlurStyle blur_style,
|
||||||
Entity::TileMode tile_mode) {
|
Entity::TileMode tile_mode) {
|
||||||
auto x_blur = MakeDirectionalGaussianBlur(
|
std::shared_ptr<FilterContents> x_blur = MakeDirectionalGaussianBlur(
|
||||||
input, sigma_x, Point(1, 0), BlurStyle::kNormal, tile_mode, false, {});
|
/*input=*/input,
|
||||||
auto y_blur = MakeDirectionalGaussianBlur(FilterInput::Make(x_blur), sigma_y,
|
/*sigma=*/sigma_x,
|
||||||
Point(0, 1), blur_style, tile_mode,
|
/*direction=*/Point(1, 0),
|
||||||
true, sigma_x);
|
/*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;
|
return y_blur;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,16 +177,16 @@ std::unique_ptr<Shell> Shell::Create(
|
|||||||
auto resource_cache_limit_calculator =
|
auto resource_cache_limit_calculator =
|
||||||
std::make_shared<ResourceCacheLimitCalculator>(
|
std::make_shared<ResourceCacheLimitCalculator>(
|
||||||
settings.resource_cache_max_bytes_threshold);
|
settings.resource_cache_max_bytes_threshold);
|
||||||
return CreateWithSnapshot(platform_data, //
|
return CreateWithSnapshot(platform_data, //
|
||||||
task_runners, //
|
task_runners, //
|
||||||
/*parent_merger=*/nullptr, //
|
/*parent_thread_merger=*/nullptr, //
|
||||||
/*parent_io_manager=*/nullptr, //
|
/*parent_io_manager=*/nullptr, //
|
||||||
resource_cache_limit_calculator, //
|
resource_cache_limit_calculator, //
|
||||||
settings, //
|
settings, //
|
||||||
std::move(vm), //
|
std::move(vm), //
|
||||||
std::move(isolate_snapshot), //
|
std::move(isolate_snapshot), //
|
||||||
on_create_platform_view, //
|
on_create_platform_view, //
|
||||||
on_create_rasterizer, //
|
on_create_rasterizer, //
|
||||||
CreateEngine, is_gpu_disabled);
|
CreateEngine, is_gpu_disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ FLUTTER_ASSERT_ARC
|
|||||||
skiaBackendTextures[0] = GrBackendTexture(/*width=*/width,
|
skiaBackendTextures[0] = GrBackendTexture(/*width=*/width,
|
||||||
/*height=*/height,
|
/*height=*/height,
|
||||||
/*mipMapped=*/skgpu::Mipmapped::kNo,
|
/*mipMapped=*/skgpu::Mipmapped::kNo,
|
||||||
/*textureInfo=*/ySkiaTextureInfo);
|
/*mtlInfo=*/ySkiaTextureInfo);
|
||||||
|
|
||||||
GrMtlTextureInfo uvSkiaTextureInfo;
|
GrMtlTextureInfo uvSkiaTextureInfo;
|
||||||
uvSkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)uvTex};
|
uvSkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)uvTex};
|
||||||
@@ -305,7 +305,7 @@ FLUTTER_ASSERT_ARC
|
|||||||
skiaBackendTextures[1] = GrBackendTexture(/*width=*/width,
|
skiaBackendTextures[1] = GrBackendTexture(/*width=*/width,
|
||||||
/*height=*/height,
|
/*height=*/height,
|
||||||
/*mipMapped=*/skgpu::Mipmapped::kNo,
|
/*mipMapped=*/skgpu::Mipmapped::kNo,
|
||||||
/*textureInfo=*/uvSkiaTextureInfo);
|
/*mtlInfo=*/uvSkiaTextureInfo);
|
||||||
SkYUVAInfo yuvaInfo(skiaBackendTextures[0].dimensions(), SkYUVAInfo::PlaneConfig::kY_UV,
|
SkYUVAInfo yuvaInfo(skiaBackendTextures[0].dimensions(), SkYUVAInfo::PlaneConfig::kY_UV,
|
||||||
SkYUVAInfo::Subsampling::k444, colorSpace);
|
SkYUVAInfo::Subsampling::k444, colorSpace);
|
||||||
GrYUVABackendTextures yuvaBackendTextures(yuvaInfo, skiaBackendTextures,
|
GrYUVABackendTextures yuvaBackendTextures(yuvaInfo, skiaBackendTextures,
|
||||||
@@ -326,11 +326,11 @@ FLUTTER_ASSERT_ARC
|
|||||||
GrBackendTexture skiaBackendTexture(/*width=*/width,
|
GrBackendTexture skiaBackendTexture(/*width=*/width,
|
||||||
/*height=*/height,
|
/*height=*/height,
|
||||||
/*mipMapped=*/skgpu::Mipmapped ::kNo,
|
/*mipMapped=*/skgpu::Mipmapped ::kNo,
|
||||||
/*textureInfo=*/skiaTextureInfo);
|
/*mtlInfo=*/skiaTextureInfo);
|
||||||
|
|
||||||
return SkImages::BorrowTextureFrom(grContext, skiaBackendTexture, kTopLeft_GrSurfaceOrigin,
|
return SkImages::BorrowTextureFrom(grContext, skiaBackendTexture, kTopLeft_GrSurfaceOrigin,
|
||||||
kBGRA_8888_SkColorType, kPremul_SkAlphaType,
|
kBGRA_8888_SkColorType, kPremul_SkAlphaType,
|
||||||
/*imageColorSpace=*/nullptr, /*releaseProc*/ nullptr,
|
/*colorSpace=*/nullptr, /*releaseProc*/ nullptr,
|
||||||
/*releaseContext*/ nullptr);
|
/*releaseContext*/ nullptr);
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -681,7 +681,7 @@ bool FlutterPlatformViewsController::SubmitFrame(GrDirectContext* gr_context,
|
|||||||
|
|
||||||
// Clipping the background canvas before drawing the picture recorders requires
|
// Clipping the background canvas before drawing the picture recorders requires
|
||||||
// saving and restoring the clip context.
|
// 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`.
|
// Maps a platform view id to a vector of `FlutterPlatformViewLayer`.
|
||||||
LayersMap platform_view_layers;
|
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.
|
// 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.
|
// 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);
|
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)];
|
[_engine.get() dispatchPointerDataPacket:std::move(packet)];
|
||||||
_scrollInertiaEventAppKitDeadline = 0;
|
_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
|
// 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.
|
// making or breaking contact with the trackpad surface.
|
||||||
auto packet = std::make_unique<flutter::PointerDataPacket>(2);
|
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;
|
flutter::PointerData inertia_cancel = pointer_data;
|
||||||
inertia_cancel.device = reinterpret_cast<int64_t>(_continuousScrollingPanGestureRecognizer);
|
inertia_cancel.device = reinterpret_cast<int64_t>(_continuousScrollingPanGestureRecognizer);
|
||||||
inertia_cancel.kind = flutter::PointerData::DeviceKind::kTrackpad;
|
inertia_cancel.kind = flutter::PointerData::DeviceKind::kTrackpad;
|
||||||
inertia_cancel.signal_kind = flutter::PointerData::SignalKind::kScrollInertiaCancel;
|
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)];
|
[_engine.get() dispatchPointerDataPacket:std::move(packet)];
|
||||||
_scrollInertiaEventStartline = DBL_MAX;
|
_scrollInertiaEventStartline = DBL_MAX;
|
||||||
} else {
|
} else {
|
||||||
auto packet = std::make_unique<flutter::PointerDataPacket>(1);
|
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)];
|
[_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);
|
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)];
|
[_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);
|
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)];
|
[_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);
|
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)];
|
[_engine.get() dispatchPointerDataPacket:std::move(packet)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2728,7 +2728,7 @@ FlutterEngineResult FlutterEngineReloadSystemFonts(
|
|||||||
|
|
||||||
void FlutterEngineTraceEventDurationBegin(const char* name) {
|
void FlutterEngineTraceEventDurationBegin(const char* name) {
|
||||||
fml::tracing::TraceEvent0("flutter", name, /*flow_id_count=*/0,
|
fml::tracing::TraceEvent0("flutter", name, /*flow_id_count=*/0,
|
||||||
/*flow_id=*/nullptr);
|
/*flow_ids=*/nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlutterEngineTraceEventDurationEnd(const char* name) {
|
void FlutterEngineTraceEventDurationEnd(const char* name) {
|
||||||
@@ -2737,7 +2737,7 @@ void FlutterEngineTraceEventDurationEnd(const char* name) {
|
|||||||
|
|
||||||
void FlutterEngineTraceEventInstant(const char* name) {
|
void FlutterEngineTraceEventInstant(const char* name) {
|
||||||
fml::tracing::TraceEventInstant0("flutter", name, /*flow_id_count=*/0,
|
fml::tracing::TraceEventInstant0("flutter", name, /*flow_id_count=*/0,
|
||||||
/*flow_id=*/nullptr);
|
/*flow_ids=*/nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
FlutterEngineResult FlutterEnginePostRenderThreadTask(
|
FlutterEngineResult FlutterEnginePostRenderThreadTask(
|
||||||
|
|||||||
Reference in New Issue
Block a user