Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit aad8d17

Browse files
committed
Turned unnecessary value and move of const to errors for mac host_debug.
1 parent 04fa86e commit aad8d17

28 files changed

+115
-69
lines changed

.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ performance-unnecessary-value-param"
1919
# Add checks when all warnings are fixed
2020
# to prevent new warnings being introduced.
2121
# https://github.com/flutter/flutter/issues/93279
22+
# Note: There are platform specific warnings as errors in
23+
# //tools/clang_tidy/lib/src/options.dart
2224
WarningsAsErrors: "bugprone-use-after-move,\
2325
clang-analyzer-*,\
2426
readability-identifier-naming,\

impeller/renderer/render_target.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ const std::optional<StencilAttachment>& RenderTarget::GetStencilAttachment()
179179

180180
RenderTarget RenderTarget::CreateOffscreen(const Context& context,
181181
ISize size,
182-
std::string label,
182+
const std::string& label,
183183
StorageMode color_storage_mode,
184184
LoadAction color_load_action,
185185
StoreAction color_store_action,
@@ -230,7 +230,7 @@ RenderTarget RenderTarget::CreateOffscreen(const Context& context,
230230
stencil0.texture->SetLabel(SPrintF("%s Stencil Texture", label.c_str()));
231231

232232
RenderTarget target;
233-
target.SetColorAttachment(std::move(color0), 0u);
233+
target.SetColorAttachment(color0, 0u);
234234
target.SetStencilAttachment(std::move(stencil0));
235235

236236
return target;
@@ -239,7 +239,7 @@ RenderTarget RenderTarget::CreateOffscreen(const Context& context,
239239
RenderTarget RenderTarget::CreateOffscreenMSAA(
240240
const Context& context,
241241
ISize size,
242-
std::string label,
242+
const std::string& label,
243243
StorageMode color_storage_mode,
244244
StorageMode color_resolve_storage_mode,
245245
LoadAction color_load_action,
@@ -322,7 +322,7 @@ RenderTarget RenderTarget::CreateOffscreenMSAA(
322322
stencil0.texture->SetLabel(SPrintF("%s Stencil Texture", label.c_str()));
323323

324324
RenderTarget target;
325-
target.SetColorAttachment(std::move(color0), 0u);
325+
target.SetColorAttachment(color0, 0u);
326326
target.SetStencilAttachment(std::move(stencil0));
327327

328328
return target;

impeller/renderer/render_target.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class RenderTarget {
2222
static RenderTarget CreateOffscreen(
2323
const Context& context,
2424
ISize size,
25-
std::string label = "Offscreen",
25+
const std::string& label = "Offscreen",
2626
StorageMode color_storage_mode = StorageMode::kDevicePrivate,
2727
LoadAction color_load_action = LoadAction::kClear,
2828
StoreAction color_store_action = StoreAction::kStore,
@@ -33,7 +33,7 @@ class RenderTarget {
3333
static RenderTarget CreateOffscreenMSAA(
3434
const Context& context,
3535
ISize size,
36-
std::string label = "Offscreen MSAA",
36+
const std::string& label = "Offscreen MSAA",
3737
StorageMode color_storage_mode = StorageMode::kDeviceTransient,
3838
StorageMode color_resolve_storage_mode = StorageMode::kDevicePrivate,
3939
LoadAction color_load_action = LoadAction::kClear,

impeller/typographer/backends/skia/text_render_context_skia.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ static FontGlyphPair::Set CollectUniqueFontGlyphPairsSet(
4747

4848
static FontGlyphPair::Vector CollectUniqueFontGlyphPairs(
4949
GlyphAtlas::Type type,
50-
TextRenderContext::FrameIterator frame_iterator) {
50+
const TextRenderContext::FrameIterator& frame_iterator) {
5151
TRACE_EVENT0("impeller", __FUNCTION__);
5252
FontGlyphPair::Vector vector;
53-
auto set = CollectUniqueFontGlyphPairsSet(type, std::move(frame_iterator));
53+
auto set = CollectUniqueFontGlyphPairsSet(type, frame_iterator);
5454
vector.reserve(set.size());
5555
for (const auto& item : set) {
5656
vector.emplace_back(item);

impeller/typographer/typographer_unittests.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ TEST_P(TypographerTest, LazyAtlasTracksColor) {
8080
LazyGlyphAtlas lazy_atlas;
8181
ASSERT_FALSE(lazy_atlas.HasColor());
8282

83-
lazy_atlas.AddTextFrame(std::move(frame));
83+
lazy_atlas.AddTextFrame(frame);
8484

8585
ASSERT_FALSE(lazy_atlas.HasColor());
8686

8787
frame = TextFrameFromTextBlob(SkTextBlob::MakeFromString("😀 ", emoji_font));
8888

8989
ASSERT_TRUE(frame.HasColor());
9090

91-
lazy_atlas.AddTextFrame(std::move(frame));
91+
lazy_atlas.AddTextFrame(frame);
9292

9393
ASSERT_TRUE(lazy_atlas.HasColor());
9494
}

lib/ui/compositing/scene.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static sk_sp<DlImage> CreateDeferredImage(
110110
width, height, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
111111
return DlDeferredImageGPUSkia::MakeFromLayerTree(
112112
image_info, std::move(layer_tree), std::move(snapshot_delegate),
113-
std::move(raster_task_runner), std::move(unref_queue));
113+
raster_task_runner, std::move(unref_queue));
114114
}
115115

116116
void Scene::RasterizeToImage(uint32_t width,

lib/ui/painting/image_encoding.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ Dart_Handle EncodeImage(CanvasImage* canvas_image,
275275
snapshot_delegate =
276276
UIDartState::Current()->GetSnapshotDelegate()]() mutable {
277277
EncodeImageAndInvokeDataCallback(
278-
std::move(image), std::move(callback), image_format, ui_task_runner,
279-
std::move(raster_task_runner), std::move(io_task_runner),
280-
io_manager->GetResourceContext(), std::move(snapshot_delegate),
278+
image, std::move(callback), image_format, ui_task_runner,
279+
raster_task_runner, io_task_runner,
280+
io_manager->GetResourceContext(), snapshot_delegate,
281281
io_manager->GetIsGpuDisabledSyncSwitch());
282282
}));
283283

lib/ui/painting/immutable_buffer.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ Dart_Handle ImmutableBuffer::initFromFile(Dart_Handle raw_buffer_handle,
139139
sk_data = MakeSkDataWithCopy(bytes, buffer_size);
140140
}
141141
ui_task_runner->PostTask(
142-
[sk_data = std::move(sk_data), ui_task = std::move(ui_task),
143-
buffer_size]() { ui_task(sk_data, buffer_size); });
142+
[sk_data = std::move(sk_data), ui_task = ui_task, buffer_size]() {
143+
ui_task(sk_data, buffer_size);
144+
});
144145
});
145146
return Dart_Null();
146147
}

lib/ui/painting/multi_frame_codec.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ void MultiFrameCodec::State::GetNextFrameAndInvokeCallback(
184184
int duration = 0;
185185
sk_sp<DlImage> dlImage =
186186
GetNextFrameImage(std::move(resourceContext), gpu_disable_sync_switch,
187-
impeller_context, unref_queue);
187+
std::move(impeller_context), std::move(unref_queue));
188188
if (dlImage) {
189189
image = CanvasImage::Create();
190190
image->set_image(dlImage);

lib/ui/ui_dart_state.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ UIDartState::Context::Context(
4949
advisory_script_uri(std::move(advisory_script_uri)),
5050
advisory_script_entrypoint(std::move(advisory_script_entrypoint)),
5151
volatile_path_tracker(std::move(volatile_path_tracker)),
52-
concurrent_task_runner(concurrent_task_runner),
52+
concurrent_task_runner(std::move(concurrent_task_runner)),
5353
enable_impeller(enable_impeller) {}
5454

5555
UIDartState::UIDartState(

0 commit comments

Comments
 (0)