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

Commit 9ee2992

Browse files
authored
Implement 2 suggested Clang Tidy fixes we don't look for yet. (#44816)
I haven't investigated if there are more occurrences or if it's worth enforcing turning the check on generally. (They were flagged on the Google roll, ironically) --- [`readability-redundant-smartptr-get`](https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-smartptr-get.html) > Find and remove redundant calls to smart pointer’s `.get()` method [`performance-for-range-copy`](https://clang.llvm.org/extra/clang-tidy/checks/performance/for-range-copy.html) > Finds C++11 for ranges where the loop variable is copied in each iteration but it would suffice to obtain it by reference.
1 parent 9fae689 commit 9ee2992

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

impeller/entity/contents/content_context.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ std::shared_ptr<Texture> ContentContext::MakeSubpass(
362362
RenderTarget subpass_target;
363363
if (context->GetCapabilities()->SupportsOffscreenMSAA() && msaa_enabled) {
364364
subpass_target = RenderTarget::CreateOffscreenMSAA(
365-
*context, *GetRenderTargetCache().get(), texture_size,
365+
*context, *GetRenderTargetCache(), texture_size,
366366
SPrintF("%s Offscreen", label.c_str()),
367367
RenderTarget::kDefaultColorAttachmentConfigMSAA //
368368
#ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan.
@@ -372,7 +372,7 @@ std::shared_ptr<Texture> ContentContext::MakeSubpass(
372372
);
373373
} else {
374374
subpass_target = RenderTarget::CreateOffscreen(
375-
*context, *GetRenderTargetCache().get(), texture_size,
375+
*context, *GetRenderTargetCache(), texture_size,
376376
SPrintF("%s Offscreen", label.c_str()),
377377
RenderTarget::kDefaultColorAttachmentConfig //
378378
#ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan.

impeller/entity/contents/scene_contents.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ bool SceneContents::Render(const ContentContext& renderer,
4545
}
4646

4747
RenderTarget subpass_target = RenderTarget::CreateOffscreenMSAA(
48-
*renderer.GetContext(), // context
49-
*renderer.GetRenderTargetCache().get(), // allocator
50-
ISize(coverage.value().size), // size
51-
"SceneContents", // label
48+
*renderer.GetContext(), // context
49+
*renderer.GetRenderTargetCache(), // allocator
50+
ISize(coverage.value().size), // size
51+
"SceneContents", // label
5252
RenderTarget::AttachmentConfigMSAA{
5353
.storage_mode = StorageMode::kDeviceTransient,
5454
.resolve_storage_mode = StorageMode::kDevicePrivate,

impeller/entity/entity_pass.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ static EntityPassTarget CreateRenderTarget(ContentContext& renderer,
209209
RenderTarget target;
210210
if (context->GetCapabilities()->SupportsOffscreenMSAA()) {
211211
target = RenderTarget::CreateOffscreenMSAA(
212-
*context, // context
213-
*renderer.GetRenderTargetCache().get(), // allocator
214-
size, // size
215-
"EntityPass", // label
212+
*context, // context
213+
*renderer.GetRenderTargetCache(), // allocator
214+
size, // size
215+
"EntityPass", // label
216216
RenderTarget::AttachmentConfigMSAA{
217217
.storage_mode = StorageMode::kDeviceTransient,
218218
.resolve_storage_mode = StorageMode::kDevicePrivate,
@@ -223,10 +223,10 @@ static EntityPassTarget CreateRenderTarget(ContentContext& renderer,
223223
);
224224
} else {
225225
target = RenderTarget::CreateOffscreen(
226-
*context, // context
227-
*renderer.GetRenderTargetCache().get(), // allocator
228-
size, // size
229-
"EntityPass", // label
226+
*context, // context
227+
*renderer.GetRenderTargetCache(), // allocator
228+
size, // size
229+
"EntityPass", // label
230230
RenderTarget::AttachmentConfig{
231231
.storage_mode = StorageMode::kDevicePrivate,
232232
.load_action = LoadAction::kDontCare,
@@ -386,7 +386,7 @@ bool EntityPass::Render(ContentContext& renderer,
386386
// provided by the caller.
387387
else {
388388
root_render_target.SetupStencilAttachment(
389-
*renderer.GetContext(), *renderer.GetRenderTargetCache().get(),
389+
*renderer.GetContext(), *renderer.GetRenderTargetCache(),
390390
color0.texture->GetSize(),
391391
renderer.GetContext()->GetCapabilities()->SupportsOffscreenMSAA(),
392392
"ImpellerOnscreen",

impeller/entity/render_target_cache.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void RenderTargetCache::Start() {
1919
void RenderTargetCache::End() {
2020
std::vector<TextureData> retain;
2121

22-
for (auto td : texture_data_) {
22+
for (const auto& td : texture_data_) {
2323
if (td.used_this_frame) {
2424
retain.push_back(td);
2525
}

0 commit comments

Comments
 (0)