[go: nahoru, domu]

Skip to content

Commit

Permalink
Adds lint for checking argument commments (flutter#47305)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaaclarke committed Oct 25, 2023
1 parent ab50967 commit 84416c9
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 37 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Prefix check with "-" to ignore.
Checks: >-
bugprone-argument-comment,
bugprone-use-after-move,
bugprone-unchecked-optional-access,
clang-analyzer-*,
Expand Down
16 changes: 8 additions & 8 deletions flow/stopwatch_dl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand All @@ -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));
}
}
Expand Down
21 changes: 16 additions & 5 deletions impeller/entity/contents/filters/filter_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
20 changes: 10 additions & 10 deletions shell/common/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,15 @@ @implementation FlutterDarwinExternalTextureSkImageWrapper
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};

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,
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<flutter::PointerDataPacket>(1);
packet->SetPointerData(/*index=*/0, pointer_data);
packet->SetPointerData(/*i=*/0, pointer_data);
[_engine.get() dispatchPointerDataPacket:std::move(packet)];
_scrollInertiaEventAppKitDeadline = 0;
}
Expand Down Expand Up @@ -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<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)];
}
}
Expand Down Expand Up @@ -2489,7 +2489,7 @@ - (void)discreteScrollEvent:(UIPanGestureRecognizer*)recognizer API_AVAILABLE(io
}

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)];
}

Expand Down Expand Up @@ -2540,7 +2540,7 @@ - (void)continuousScrollEvent:(UIPanGestureRecognizer*)recognizer API_AVAILABLE(
}

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)];
}

Expand Down Expand Up @@ -2569,7 +2569,7 @@ - (void)pinchEvent:(UIPinchGestureRecognizer*)recognizer API_AVAILABLE(ios(13.4)
}

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)];
}

Expand Down
4 changes: 2 additions & 2 deletions shell/platform/embedder/embedder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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(
Expand Down

0 comments on commit 84416c9

Please sign in to comment.