From 0db2786becdbdea72eb72bd67a24441ba4c73e17 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Thu, 17 Aug 2023 11:25:47 -0700 Subject: [PATCH] Implement 2 suggested Clang Tidy fixes we don't look for yet. --- impeller/entity/contents/content_context.cc | 4 ++-- impeller/entity/contents/scene_contents.cc | 8 ++++---- impeller/entity/entity_pass.cc | 18 +++++++++--------- impeller/entity/render_target_cache.cc | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index 809df7699b24c..94fd796a7eed2 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -362,7 +362,7 @@ std::shared_ptr ContentContext::MakeSubpass( RenderTarget subpass_target; if (context->GetCapabilities()->SupportsOffscreenMSAA() && msaa_enabled) { subpass_target = RenderTarget::CreateOffscreenMSAA( - *context, *GetRenderTargetCache().get(), texture_size, + *context, *GetRenderTargetCache(), texture_size, SPrintF("%s Offscreen", label.c_str()), RenderTarget::kDefaultColorAttachmentConfigMSAA // #ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan. @@ -372,7 +372,7 @@ std::shared_ptr ContentContext::MakeSubpass( ); } else { subpass_target = RenderTarget::CreateOffscreen( - *context, *GetRenderTargetCache().get(), texture_size, + *context, *GetRenderTargetCache(), texture_size, SPrintF("%s Offscreen", label.c_str()), RenderTarget::kDefaultColorAttachmentConfig // #ifndef FML_OS_ANDROID // Reduce PSO variants for Vulkan. diff --git a/impeller/entity/contents/scene_contents.cc b/impeller/entity/contents/scene_contents.cc index bb4f014a2ebdb..3ac03affa5784 100644 --- a/impeller/entity/contents/scene_contents.cc +++ b/impeller/entity/contents/scene_contents.cc @@ -45,10 +45,10 @@ bool SceneContents::Render(const ContentContext& renderer, } RenderTarget subpass_target = RenderTarget::CreateOffscreenMSAA( - *renderer.GetContext(), // context - *renderer.GetRenderTargetCache().get(), // allocator - ISize(coverage.value().size), // size - "SceneContents", // label + *renderer.GetContext(), // context + *renderer.GetRenderTargetCache(), // allocator + ISize(coverage.value().size), // size + "SceneContents", // label RenderTarget::AttachmentConfigMSAA{ .storage_mode = StorageMode::kDeviceTransient, .resolve_storage_mode = StorageMode::kDevicePrivate, diff --git a/impeller/entity/entity_pass.cc b/impeller/entity/entity_pass.cc index a1a6d085f184c..4925c4df4583f 100644 --- a/impeller/entity/entity_pass.cc +++ b/impeller/entity/entity_pass.cc @@ -209,10 +209,10 @@ static EntityPassTarget CreateRenderTarget(ContentContext& renderer, RenderTarget target; if (context->GetCapabilities()->SupportsOffscreenMSAA()) { target = RenderTarget::CreateOffscreenMSAA( - *context, // context - *renderer.GetRenderTargetCache().get(), // allocator - size, // size - "EntityPass", // label + *context, // context + *renderer.GetRenderTargetCache(), // allocator + size, // size + "EntityPass", // label RenderTarget::AttachmentConfigMSAA{ .storage_mode = StorageMode::kDeviceTransient, .resolve_storage_mode = StorageMode::kDevicePrivate, @@ -223,10 +223,10 @@ static EntityPassTarget CreateRenderTarget(ContentContext& renderer, ); } else { target = RenderTarget::CreateOffscreen( - *context, // context - *renderer.GetRenderTargetCache().get(), // allocator - size, // size - "EntityPass", // label + *context, // context + *renderer.GetRenderTargetCache(), // allocator + size, // size + "EntityPass", // label RenderTarget::AttachmentConfig{ .storage_mode = StorageMode::kDevicePrivate, .load_action = LoadAction::kDontCare, @@ -386,7 +386,7 @@ bool EntityPass::Render(ContentContext& renderer, // provided by the caller. else { root_render_target.SetupStencilAttachment( - *renderer.GetContext(), *renderer.GetRenderTargetCache().get(), + *renderer.GetContext(), *renderer.GetRenderTargetCache(), color0.texture->GetSize(), renderer.GetContext()->GetCapabilities()->SupportsOffscreenMSAA(), "ImpellerOnscreen", diff --git a/impeller/entity/render_target_cache.cc b/impeller/entity/render_target_cache.cc index fc2ebf807205b..a26551768975b 100644 --- a/impeller/entity/render_target_cache.cc +++ b/impeller/entity/render_target_cache.cc @@ -19,7 +19,7 @@ void RenderTargetCache::Start() { void RenderTargetCache::End() { std::vector retain; - for (auto td : texture_data_) { + for (const auto& td : texture_data_) { if (td.used_this_frame) { retain.push_back(td); }